diff --git a/arm9/src/install.c b/arm9/src/install.c index 1392ef8..e9a9dfd 100644 --- a/arm9/src/install.c +++ b/arm9/src/install.c @@ -384,9 +384,11 @@ bool install(char* fpath, bool systemTitle) fixHeader = true; //title id must be one of these - if (h->tid_high == 0x00030004 || - h->tid_high == 0x00030005 || - h->tid_high == 0x00030015) + if (h->tid_high == 0x00030004 || // DSiWare + h->tid_high == 0x00030005 || // "unimportant" system titles + h->tid_high == 0x00030011 || // SRLs in the TWL SDK + h->tid_high == 0x00030015 || // system titles + h->tid_high == 0x00030017) // Launcher {} else { @@ -398,16 +400,39 @@ bool install(char* fpath, bool systemTitle) goto error; } - //offer to patch system titles to normal DSiWare on SysNAND - if(!sdnandMode && h->tid_high != 0x00030004) + //patch dev titles to system titles on SysNAND. + // + //software released through the TWL SDK usually comes as a TAD and an SRL + //things like NandFiler have a TAD with a TID of 0x00030015 and an SRL with 0x00030011 + //the TAD is the installable version, so I'm assuming that 0x00030015 is what the console wants to see on NAND + //this changes the SRL TID accordingly + //not entirely sure why there's even any difference. I think the installed TAD and SRL the same as each other (minus the TID) + if(!sdnandMode && h->tid_high == 0x00030011) { - if(choiceBox("This is set as a system title,\nwould you like to patch it to\nbe a normal DSiWare?\n\nThis is safer, but invalidates\nRSA checks and may not work.\n\nIf the title is homebrew this isstrongly recommended.") == YES) + h->tid_high = 0x00030015; + fixHeader = true; + } + + //offer to patch system titles to normal DSiWare on SysNAND + if(!sdnandMode && h->tid_high != 0x00030004 && h->tid_high != 0x00030017) //do not allow patching home menus to be normal DSiWare! This will trigger "ERROR! - 0x0000000000000008 HWINFO_SECURE" on prototype launchers. May also cause issues on the prod versions. + { + if(choiceBox("This is set as a system/dev\ntitle, would you like to patch\nit to be a normal DSiWare?\n\nThis is safer, but invalidates\nRSA checks and may not work.\n\nIf the title is homebrew this isstrongly recommended.") == YES) { h->tid_high = 0x00030004; fixHeader = true; } } + //offer to patch home menus to be system titles on SysNAND + if(!sdnandMode && h->tid_high == 0x00030017) + { + if(choiceBox("This title is a home menu.\nWould you like to patch it to bea system title?\n\nThis is safer and prevents your\nhome menu from being hidden.") == YES) + { + h->tid_high = 0x00030015; + fixHeader = true; + } + } + //no system titles without Unlaunch if (!unlaunchFound && h->tid_high != 0x00030004) { @@ -430,12 +455,23 @@ bool install(char* fpath, bool systemTitle) tidLow == 0x484e4900 || // Nintendo DSi Camera tidLow == 0x484e4a00 || // Nintendo Zone tidLow == 0x484e4b00 // Nintendo DSi Sound + )) || (h->tid_high == 0x00030011 && ( + tidLow == 0x30535500 || // Twl SystemUpdater + tidLow == 0x34544e00 || // TwlNmenu + tidLow == 0x54574c00 // TWL EVA )) || (h->tid_high == 0x00030015 && ( tidLow == 0x484e4200 || // System Settings - tidLow == 0x484e4600 // Nintendo DSi Shop + tidLow == 0x484e4600 || // Nintendo DSi Shop + tidLow == 0x34544e00 // TwlNmenu + )) || (h->tid_high == 0x00030017 && ( + tidLow == 0x484e4100 // Launcher ))) && ( - (h->tid_low & 0xFF) == region || //only blacklist console region - (h->tid_low & 0xFF) == 'A' || //and 'A' (all region) + (h->tid_low & 0xFF) == region || // Only blacklist console region, or the following programs that have all-region codes: + h->tid_low == 0x484e4541 || // PictoChat + h->tid_low == 0x484e4441 || // Download Play + h->tid_low == 0x30535541 || // Twl SystemUpdater (iirc one version fits in NAND) + h->tid_low == 0x34544e41 || // TwlNmenu (blocking due to potential to uninstall system titles) + h->tid_low == 0x54574c41 || // TWL EVA region == 0 //if the region check failed somehow, blacklist everything )) { diff --git a/arm9/src/rom.c b/arm9/src/rom.c index 2d20728..fab9ddc 100644 --- a/arm9/src/rom.c +++ b/arm9/src/rom.c @@ -212,6 +212,7 @@ void printRomInfo(char const* fpath) { if (h->tid_high == 0x00030004 || h->tid_high == 0x00030005 || + h->tid_high == 0x00030011 || // TID for software in TWL SDK h->tid_high == 0x00030015 || h->tid_high == 0x00030017 || h->tid_high == 0x00030000) diff --git a/arm9/src/storage.c b/arm9/src/storage.c index a15a31d..827c286 100644 --- a/arm9/src/storage.c +++ b/arm9/src/storage.c @@ -436,11 +436,12 @@ int getMenuSlotsFree() { //Get number of open menu slots by subtracting the number of directories in the title folders //Find a better way to do this - const int NUM_OF_DIRS = 3; + const int NUM_OF_DIRS = 4; const char* dirs[] = { "00030004", "00030005", - "00030015" + "00030015", + "00030017" }; int freeSlots = getMenuSlots(); diff --git a/arm9/src/titlemenu.c b/arm9/src/titlemenu.c index 3b231c3..cb8d18d 100644 --- a/arm9/src/titlemenu.c +++ b/arm9/src/titlemenu.c @@ -88,14 +88,15 @@ static void generateList(Menu* m) { if (!m) return; - const int NUM_OF_DIRS = 3; + const int NUM_OF_DIRS = 4; const char* dirs[] = { "00030004", "00030005", - "00030015" + "00030015", + "00030017" }; - const char* blacklist[3][6] = { + const char* blacklist[4][6] = { { // 00030004 NULL //nothing blacklisted }, @@ -111,6 +112,10 @@ static void generateList(Menu* m) "484e42", // System Settings "484e46", // Nintendo DSi Shop NULL + }, + { // 00030017 + "484e41", // Launcher + NULL } }; @@ -153,8 +158,10 @@ static void generateList(Menu* m) if (strcmp(titleId, ent->d_name) == 0) blacklisted = true; - sprintf(titleId, "%s41", blacklist[i][j]); // also blacklist region 'a' - if (strcmp(titleId, ent->d_name) == 0) + // also blacklist specific all-region titles + if ((strcmp("484e4441", ent->d_name) == 0) || // Download Play + (strcmp("484e4541", ent->d_name) == 0) || // PictoChat + (strcmp("34544e41", ent->d_name) == 0)) // TwlNmenu blacklisted = true; } if (blacklisted) continue;