Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions makerom/src/ncch.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ int GetBasicOptions(ncch_settings *ncchset, user_settings *usrset)
ncchset->options.UseOnSD = ncchset->rsfSet->Option.UseOnSD;
ncchset->options.Encrypt = ncchset->rsfSet->Option.EnableCrypt;
ncchset->options.FreeProductCode = ncchset->rsfSet->Option.FreeProductCode;
ncchset->options.KtrProgramId = ncchset->rsfSet->Option.UseKtrProgramId;
ncchset->options.IsCfa = (usrset->ncch.ncchType == CFA);
ncchset->options.IsBuildingCodeSection = (usrset->ncch.elfPath != NULL);
ncchset->options.UseRomFS = ((ncchset->rsfSet->RomFs.RootPath && strlen(ncchset->rsfSet->RomFs.RootPath) > 0) || usrset->ncch.romfsPath);
Expand Down
1 change: 1 addition & 0 deletions makerom/src/ncch_build.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ typedef struct
bool UseRomFS;
bool noCodePadding;
bool baremetal;
bool KtrProgramId;

bool useSecCrypto;
u8 keyXID;
Expand Down
1 change: 1 addition & 0 deletions makerom/src/rsf_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ void GET_Option(ctr_yaml_context *ctx, rsf_settings *rsf)
else if(cmpYamlValue("EnableCompress",ctx)) SetBoolYAMLValue(&rsf->Option.EnableCompress,"EnableCompress",ctx);
else if(cmpYamlValue("FreeProductCode",ctx)) SetBoolYAMLValue(&rsf->Option.FreeProductCode,"FreeProductCode",ctx);
else if(cmpYamlValue("UseOnSD",ctx)) SetBoolYAMLValue(&rsf->Option.UseOnSD,"UseOnSD",ctx);
else if(cmpYamlValue("UseKtrProgramId",ctx)) SetBoolYAMLValue(&rsf->Option.UseKtrProgramId,"UseKtrProgramId",ctx);
else{
fprintf(stderr,"[RSF ERROR] Unrecognised key '%s'\n",GetYamlString(ctx));
ctx->error = YAML_UNKNOWN_KEY;
Expand Down
3 changes: 3 additions & 0 deletions makerom/src/titleid.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ int GetProgramID(u64 *dest, rsf_settings *rsf, bool IsForExheader)
programId |= (u64)uniqueId<<8;
programId |= (u64)category<<32;
programId |= (u64)type<<48;

if (rsf->Option.UseKtrProgramId)
programId |= 0x20000000;

*dest = programId;

Expand Down
1 change: 1 addition & 0 deletions makerom/src/user_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ void SetDefaults(user_settings *set)
set->ncch.noCodePadding = false;
set->ncch.baremetal = false;
set->ncch.pageSize = DEFAULT_STACK_SIZE;
set->ncch.ktrProgramId = false;

// RSF Settings
clrmem(&set->common.rsfSet, sizeof(rsf_settings));
Expand Down
2 changes: 2 additions & 0 deletions makerom/src/user_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ typedef struct
bool EnableCompress;
bool FreeProductCode;
bool UseOnSD;
bool UseKtrProgramId;
} Option;

struct{
Expand Down Expand Up @@ -271,6 +272,7 @@ typedef struct
bool baremetal; // abuse K9/LGY K11's lack of memory management to support arbitrary VMA and RWX phdr
u32 pageSize; // Memory page size (256 for Kernel9, 4096 for anything else)
bool useSecCrypto;
bool ktrProgramId;
u8 keyXID;
} ncch; // Ncch0 Build

Expand Down
Loading