diff --git a/include/arm11/menu/menu.h b/include/arm11/menu/menu.h index 88e2d9a..bf69be9 100644 --- a/include/arm11/menu/menu.h +++ b/include/arm11/menu/menu.h @@ -34,7 +34,7 @@ MENU_RET_REBOOT }; -#define MENU_MAX_ENTRIES 8 +#define MENU_MAX_ENTRIES 10 #define MENU_MAX_DEPTH 4 #define MENU_OFFSET_TITLE 5 diff --git a/include/arm11/menu/menu_fb3ds.h b/include/arm11/menu/menu_fb3ds.h index c326a03..39334fb 100644 --- a/include/arm11/menu/menu_fb3ds.h +++ b/include/arm11/menu/menu_fb3ds.h @@ -61,6 +61,7 @@ #define DESC_BOOT_QUICK "In quick boot mode, splash is displayed and the boot is continued via the first available autoboot slot.\n \n! To enter the menu, hold the HOME button at boot !" #define DESC_BOOT_QUIET "In quiet boot mode, splash is not displayed and the boot is continued via the first available autoboot slot.\n \n! To enter the menu, hold the HOME button at boot !" #define DESC_CHANGE_BOOT "Change fastboot3ds boot mode. This allows you to set up how your console boots." +#define DESC_FCRAM_BOOT "Enable booting firm from FCRAM. This is required for proper A9NC and A9SP support, don't enable this if you use neither." #define DESC_SPLASH_CUSTOM "Select a custom splash. This is compatible with Luma 3DS format splash screens." #define DESC_SPLASH_DEFAULT "Use default fastboot3DS splash screen." @@ -95,7 +96,7 @@ { "Boot from file...", DESC_BOOT_FILE, &menuLaunchFirm, 0xFF }, { "NAND tools...", DESC_NAND_TOOLS, NULL, 5 }, { "Miscellaneous...", DESC_MISC, NULL, 6 }, - { "Debug...", LOREM, NULL, 13 } + // { "Debug...", LOREM, NULL, 13 } } }, { // 1 @@ -110,7 +111,7 @@ } }, { // 2 - "Boot Setup", N_BOOTSLOTS + 2, &menuPresetBootConfig, MENU_FLAG_SLOTS | MENU_FLAG_BOOTMODE | MENU_FLAG_CONFIG, + "Boot Setup", N_BOOTSLOTS + 3, &menuPresetBootConfig, MENU_FLAG_SLOTS | MENU_FLAG_BOOTMODE | MENU_FLAG_CONFIG, { SUBENTRY_SLOT_SETUP(1), SUBENTRY_SLOT_SETUP(2), @@ -119,7 +120,8 @@ SUBENTRY_SLOT_SETUP(5), SUBENTRY_SLOT_SETUP(6), { "Change boot mode...", DESC_CHANGE_BOOT, NULL, 3 }, - { "Change splash...", DESC_CHANGE_SPLASH, NULL, 4 } + { "Change splash...", DESC_CHANGE_SPLASH, NULL, 4 }, + { "Enable FCRAM Boot", DESC_FCRAM_BOOT, &menuSwitchFcramBoot, 0 } } }, { // 3 diff --git a/include/arm11/menu/menu_func.h b/include/arm11/menu/menu_func.h index 742105c..54e2310 100644 --- a/include/arm11/menu/menu_func.h +++ b/include/arm11/menu/menu_func.h @@ -48,6 +48,7 @@ u32 menuReturn(PrintConsole* term_con, PrintConsole* menu_con, u32 param); u32 menuSetBootMode(PrintConsole* term_con, PrintConsole* menu_con, u32 param); u32 menuSetSplash(PrintConsole* term_con, PrintConsole* menu_con, u32 param); +u32 menuSwitchFcramBoot(PrintConsole* term_con, PrintConsole* menu_con, u32 param); u32 menuSetupBootSlot(PrintConsole* term_con, PrintConsole* menu_con, u32 param); u32 menuSetupBootKeys(PrintConsole* term_con, PrintConsole* menu_con, u32 param); u32 menuLaunchFirm(PrintConsole* term_con, PrintConsole* menu_con, u32 param); diff --git a/source/arm11/main.c b/source/arm11/main.c index c06387f..6d3ad44 100644 --- a/source/arm11/main.c +++ b/source/arm11/main.c @@ -24,6 +24,7 @@ #include "arm11/menu/menu_fb3ds.h" #include "arm11/menu/menu_util.h" #include "arm11/menu/splash.h" +#include "arm11/bootenv.h" #include "arm11/console.h" #include "arm11/config.h" #include "arm11/debug.h" @@ -135,8 +136,8 @@ // firm from FCRAM handling - // even checking for this should be optional (!!!) - if (!startFirmLaunch) + if (!startFirmLaunch && configRamFirmBootEnabled() && + (getBootEnv() == BOOTENV_NATIVE_FIRM)) { if (loadVerifyFirm("ram", false) == 0) startFirmLaunch = true; diff --git a/source/arm11/menu/menu_func.c b/source/arm11/menu/menu_func.c index 2f52daf..502793b 100644 --- a/source/arm11/menu/menu_func.c +++ b/source/arm11/menu/menu_func.c @@ -92,6 +92,9 @@ if (configDataExist(KSplashScreen)) res |= 1 << (N_BOOTSLOTS+1); + if (configRamFirmBootEnabled()) + res |= 1 << (N_BOOTSLOTS+2); + return res; } @@ -153,6 +156,17 @@ return res; } +u32 menuSwitchFcramBoot(PrintConsole* term_con, PrintConsole* menu_con, u32 param) +{ + (void) term_con; + (void) menu_con; + (void) param; + bool fcram_next = !configRamFirmBootEnabled(); + u32 res = (configSetKeyData(KRamFirmBoot, &fcram_next)) ? MENU_OK : MENU_FAIL; + + return res; +} + u32 menuSetSplash(PrintConsole* term_con, PrintConsole* menu_con, u32 param) { char* res_path = NULL;