Automatically show the bootmenu on ntrboot

This commit is contained in:
d0k3 2017-09-20 00:44:18 +02:00
parent 85e584c2d5
commit d6919eba22
2 changed files with 7 additions and 3 deletions

View File

@ -9,6 +9,9 @@
// see: https://www.3dbrew.org/wiki/OTP_Registers#Plaintext_OTP // see: https://www.3dbrew.org/wiki/OTP_Registers#Plaintext_OTP
#define IS_DEVKIT ((*(vu8*) (0x01FFB800+0x19)) != 0x0) #define IS_DEVKIT ((*(vu8*) (0x01FFB800+0x19)) != 0x0)
// check first 8 byte of NTRBOOT blowfish data (0x6A0 in DTCM)
#define IS_NTRBOOT ((*(vu64*) (0x300086A0)) == 0xBFEFD1CD2683A24E)
// see: https://3dbrew.org/wiki/CONFIG11_Registers // see: https://3dbrew.org/wiki/CONFIG11_Registers
// (also returns true for sighaxed systems, maybe change the name later?) // (also returns true for sighaxed systems, maybe change the name later?)
#define IS_A9LH ((*(vu32*) 0x101401C0) == 0) #define IS_A9LH ((*(vu32*) 0x101401C0) == 0)

View File

@ -1584,8 +1584,9 @@ u32 GodMode(bool is_b9s) {
u32 cursor = 0; u32 cursor = 0;
u32 scroll = 0; u32 scroll = 0;
bool bootloader = !is_b9s && IS_SIGHAX; // only when installed to FIRM bool bootloader = !is_b9s && IS_SIGHAX; // only when installed to FIRM / on NTRBOOT
bool bootmenu = bootloader && CheckButton(BOOTMENU_KEY); bool ntrboot = bootloader && IS_NTRBOOT;
bool bootmenu = bootloader && (ntrboot || CheckButton(BOOTMENU_KEY));
bool godmode9 = !bootloader; bool godmode9 = !bootloader;
FirmHeader* firm_in_mem = (FirmHeader*) DIR_BUFFER; FirmHeader* firm_in_mem = (FirmHeader*) DIR_BUFFER;
if (bootloader) { // check for FIRM in FCRAM, but prevent bootloops if (bootloader) { // check for FIRM in FCRAM, but prevent bootloops
@ -1601,7 +1602,7 @@ u32 GodMode(bool is_b9s) {
ClearScreenF(true, true, COLOR_STD_BG); ClearScreenF(true, true, COLOR_STD_BG);
SplashInit(bootmenu ? "bootmenu mode" : bootloader ? "bootloader mode" : NULL); SplashInit(ntrboot ? "ntrboot mode" : bootmenu ? "bootmenu mode" : bootloader ? "bootloader mode" : NULL);
u64 timer = timer_start(); // show splash u64 timer = timer_start(); // show splash
if ((sizeof(DirStruct) > 0x78000) || (N_PANES * sizeof(PaneData) > 0x10000)) { if ((sizeof(DirStruct) > 0x78000) || (N_PANES * sizeof(PaneData) > 0x10000)) {