From d6919eba22a6f3b5307413e3f3b00be94de4fd14 Mon Sep 17 00:00:00 2001 From: d0k3 Date: Wed, 20 Sep 2017 00:44:18 +0200 Subject: [PATCH] Automatically show the bootmenu on ntrboot --- source/common/unittype.h | 3 +++ source/godmode.c | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/source/common/unittype.h b/source/common/unittype.h index 9a53881..6867a5a 100644 --- a/source/common/unittype.h +++ b/source/common/unittype.h @@ -9,6 +9,9 @@ // see: https://www.3dbrew.org/wiki/OTP_Registers#Plaintext_OTP #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 // (also returns true for sighaxed systems, maybe change the name later?) #define IS_A9LH ((*(vu32*) 0x101401C0) == 0) diff --git a/source/godmode.c b/source/godmode.c index 7a606a8..e5fed83 100644 --- a/source/godmode.c +++ b/source/godmode.c @@ -1584,8 +1584,9 @@ u32 GodMode(bool is_b9s) { u32 cursor = 0; u32 scroll = 0; - bool bootloader = !is_b9s && IS_SIGHAX; // only when installed to FIRM - bool bootmenu = bootloader && CheckButton(BOOTMENU_KEY); + bool bootloader = !is_b9s && IS_SIGHAX; // only when installed to FIRM / on NTRBOOT + bool ntrboot = bootloader && IS_NTRBOOT; + bool bootmenu = bootloader && (ntrboot || CheckButton(BOOTMENU_KEY)); bool godmode9 = !bootloader; FirmHeader* firm_in_mem = (FirmHeader*) DIR_BUFFER; 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); - 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 if ((sizeof(DirStruct) > 0x78000) || (N_PANES * sizeof(PaneData) > 0x10000)) {