diff --git a/README.md b/README.md index 20193fe..a3521cd 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ This has *barely* been tested and should be used with *extreme caution*. Please ## Features - Install DSiWare and homebrew onto your hiyaCFW SDNAND and SysNAND DSi Menus. -- Delete system titles and others hidden from Data Management. +- Delete system titles and others hidden from Data Management on SDNAND. - Backup and restore installed titles. diff --git a/arm9/src/install.c b/arm9/src/install.c index 736ed23..df9da17 100644 --- a/arm9/src/install.c +++ b/arm9/src/install.c @@ -299,12 +299,8 @@ bool install(char* fpath, bool systemTitle) return false; } - if(!sdnandMode && !nandio_unlock_writing()) - return false; - //start installation clearScreen(&bottomScreen); - iprintf("Installing %s\n\n", fpath); swiWaitForVBlank(); tDSiHeader* h = getRomHeader(fpath); @@ -327,8 +323,7 @@ bool install(char* fpath, bool systemTitle) //title id must be one of these if (h->tid_high == 0x00030004 || h->tid_high == 0x00030005 || - h->tid_high == 0x00030015 || - h->tid_high == 0x00030017) + h->tid_high == 0x00030015) {} else { @@ -340,6 +335,24 @@ bool install(char* fpath, bool systemTitle) goto error; } + if (!sdnandMode && + (h->tid_high == 0x00030005 || + h->tid_high == 0x00030015)) + { + iprintf("\x1B[31m"); //red + iprintf("Error: "); + iprintf("\x1B[33m"); //yellow + iprintf("This title cannot be\ninstalled to SysNAND.\n"); + iprintf("\x1B[47m"); //white + goto error; + } + + if(!sdnandMode && !nandio_unlock_writing()) + return false; + + clearScreen(&bottomScreen); + iprintf("Installing %s\n\n", fpath); swiWaitForVBlank(); + //get install size iprintf("Install Size: "); swiWaitForVBlank(); @@ -371,7 +384,7 @@ bool install(char* fpath, bool systemTitle) { if (!_checkDsiSpace(installSize)) { - if (choicePrint("Install as system title?")) + if (sdnandMode && choicePrint("Install as system title?")) { h->tid_high = 0x00030015; fixHeader = true; diff --git a/arm9/src/installmenu.c b/arm9/src/installmenu.c index 969ecf1..83426f3 100644 --- a/arm9/src/installmenu.c +++ b/arm9/src/installmenu.c @@ -100,7 +100,8 @@ void installMenu() break; case INSTALL_MENU_SYSTEM_TITLE: - install(m->items[m->cursor].value, true); + if (sdnandMode) + install(m->items[m->cursor].value, true); break; case INSTALL_MENU_DELETE: @@ -247,7 +248,7 @@ static int subMenu() Menu* m = newMenu(); addMenuItem(m, "Install", NULL, 0); - addMenuItem(m, "Install as System Title", NULL, 0); + addMenuItem(m, sdnandMode ? "Install as System Title" : "\x1B[37m[Disabled]\x1B[47m", NULL, 0); addMenuItem(m, "Delete", NULL, 0); addMenuItem(m, "Back - [B]", NULL, 0); diff --git a/arm9/src/titlemenu.c b/arm9/src/titlemenu.c index ad7cd9b..93122c4 100644 --- a/arm9/src/titlemenu.c +++ b/arm9/src/titlemenu.c @@ -79,12 +79,16 @@ static void generateList(Menu* m) { if (!m) return; - const int NUM_OF_DIRS = 3; - const char* dirs[] = { + const int NUM_OF_DIRS = sdnandMode ? 3 : 1; + const char* sdnandDirs[] = { "00030004", "00030005", "00030015" }; + const char* nandDirs[] = { + "00030004" + }; + const char** dirs = sdnandMode ? sdnandDirs : nandDirs; //Reset menu clearMenu(m);