Added hidden / undocumented alternative bootmode

This commit is contained in:
Shadowhand 2017-10-04 19:16:07 +03:00 committed by d0k3
parent 30774a09d9
commit d625c19b79
2 changed files with 20 additions and 5 deletions

View File

@ -60,6 +60,10 @@ ifeq ($(AL3X10MODE),1)
CFLAGS += -DAL3X10MODE CFLAGS += -DAL3X10MODE
endif endif
ifeq ($(SALTMODE),1)
CFLAGS += -DSALTMODE
endif
ifeq ($(SWITCH_SCREENS),1) ifeq ($(SWITCH_SCREENS),1)
CFLAGS += -DSWITCH_SCREENS CFLAGS += -DSWITCH_SCREENS
endif endif

View File

@ -27,6 +27,7 @@
#include "rtc.h" #include "rtc.h"
#include "power.h" #include "power.h"
#include "vff.h" #include "vff.h"
#include QLZ_SPLASH_H #include QLZ_SPLASH_H
#ifdef AUTORUN_SCRIPT #ifdef AUTORUN_SCRIPT
#include "autorun_gm9.h" #include "autorun_gm9.h"
@ -58,6 +59,10 @@
#define BOOTFIRM_PATHS "0:/bootonce.firm", "0:/boot.firm", "1:/boot.firm" #define BOOTFIRM_PATHS "0:/bootonce.firm", "0:/boot.firm", "1:/boot.firm"
#define BOOTFIRM_TEMPS 0x1 // bits mark paths as temporary #define BOOTFIRM_TEMPS 0x1 // bits mark paths as temporary
#ifdef SALTMODE // ShadowHand's own bootmenu key override
#define BOOTMENU_KEY BUTTON_START
#endif
typedef struct { typedef struct {
char path[256]; char path[256];
u32 cursor; u32 cursor;
@ -1681,9 +1686,16 @@ u32 GodMode(bool is_b9s) {
else if (!is_b9s && IS_SIGHAX && (boot_origin & BOOT_NTRBOOT)) disp_mode = "ntrboot mode"; else if (!is_b9s && IS_SIGHAX && (boot_origin & BOOT_NTRBOOT)) disp_mode = "ntrboot mode";
// else if (!is_b9s || !IS_SIGHAX) disp_mode = "unknown mode"; // else if (!is_b9s || !IS_SIGHAX) disp_mode = "unknown mode";
bool show_splash = true;
#ifdef SALTMODE
if (bootmenu) disp_mode = "bootmenu mode";
show_splash = show_splash && bootmenu;
#endif
// show splash screen (if enabled)
ClearScreenF(true, true, COLOR_STD_BG); ClearScreenF(true, true, COLOR_STD_BG);
SplashInit(disp_mode); if (show_splash) SplashInit(disp_mode);
u64 timer = timer_start(); // show splash u64 timer = timer_start(); // for splash delay
if ((sizeof(DirStruct) > 0x78000) || (N_PANES * sizeof(PaneData) > 0x10000)) { if ((sizeof(DirStruct) > 0x78000) || (N_PANES * sizeof(PaneData) > 0x10000)) {
ShowPrompt(false, "Out of memory!"); // just to be safe ShowPrompt(false, "Out of memory!"); // just to be safe
@ -1724,12 +1736,11 @@ u32 GodMode(bool is_b9s) {
ShowPrompt(false, "WARNING:\nNot running from a boot9strap\ncompatible entrypoint. Not\neverything may work as expected.\n \nProvide the recommended\naeskeydb.bin file to make this\nwarning go away."); ShowPrompt(false, "WARNING:\nNot running from a boot9strap\ncompatible entrypoint. Not\neverything may work as expected.\n \nProvide the recommended\naeskeydb.bin file to make this\nwarning go away.");
} }
#ifndef AL3X10MODE #if !defined(AL3X10MODE) && !defined(SALTMODE)
bootmenu = bootmenu || (bootloader && CheckButton(BOOTMENU_KEY)); // second check for boot menu keys bootmenu = bootmenu || (bootloader && CheckButton(BOOTMENU_KEY)); // second check for boot menu keys
while (HID_STATE & BUTTON_ANY); // don't continue while any button is held while (HID_STATE & BUTTON_ANY); // don't continue while any button is held
#endif #endif
while (timer_msec( timer ) < 500); // show splash for at least 0.5 sec if (show_splash) while (timer_msec( timer ) < 500); // show splash for at least 0.5 sec
// bootmenu handler // bootmenu handler
if (bootmenu) { if (bootmenu) {