diff --git a/include/arm9/main.h b/include/arm9/main.h index 6fd4764..6154168 100644 --- a/include/arm9/main.h +++ b/include/arm9/main.h @@ -26,6 +26,7 @@ void devs_close(); bool remount_nand_fs(); +bool ensure_mounted(const char *path); void unmount_fs(); void unmount_nand_fs(); u8 rng_get_byte(); diff --git a/include/arm9/menu.h b/include/arm9/menu.h index c4fcbfa..4e95f5d 100644 --- a/include/arm9/menu.h +++ b/include/arm9/menu.h @@ -4,6 +4,7 @@ #include "arm9/menu_firmloader.h" #include "arm9/menu_nand.h" #include "arm9/menu_options.h" +#include "arm9/menu_filebrowse.h" enum menu_state_type { MENU_STATE_MAIN = 0, @@ -15,7 +16,6 @@ MENU_STATE_NAND_RESTORE, MENU_STATE_FIRM_LAUNCH, MENU_STATE_BROWSER, - MENU_STATE_TEST_CONFIG, MENU_STATE_EXIT, STATE_PREVIOUS // pseudo state for menuSetReturnToState() diff --git a/include/arm9/menu_filebrowse.h b/include/arm9/menu_filebrowse.h new file mode 100644 index 0000000..b629be6 --- /dev/null +++ b/include/arm9/menu_filebrowse.h @@ -0,0 +1,4 @@ +#pragma once + +const char *browseForFile(const char *basePath); + diff --git a/source/arm9/menu.c b/source/arm9/menu.c index 8e72cee..8f1d8cd 100644 --- a/source/arm9/menu.c +++ b/source/arm9/menu.c @@ -20,13 +20,12 @@ const menu_state_options menu_main = { - 5, + 4, { - {"Launch FIRM", MENU_STATE_FIRM_LAUNCH_SETTINGS}, + {"Continue boot", MENU_STATE_FIRM_LAUNCH_SETTINGS}, {"NAND tools...", MENU_STATE_NAND_MENU}, {"Options...", MENU_STATE_OPTIONS_MENU}, {"Browse FIRM...", MENU_STATE_BROWSER}, - {"CONFIG TEST", MENU_STATE_TEST_CONFIG} } }; @@ -186,10 +185,6 @@ menuSetEnterNextState(MENU_STATE_FIRM_LAUNCH); break; - case MENU_STATE_TEST_CONFIG: - menuSetReturnToState(STATE_PREVIOUS); - break; - case MENU_STATE_EXIT: goto exitAndLaunchFirm; break; diff --git a/source/arm9/menu_firmloader.c b/source/arm9/menu_firmloader.c index e28112f..242791b 100644 --- a/source/arm9/menu_firmloader.c +++ b/source/arm9/menu_firmloader.c @@ -27,8 +27,6 @@ bool menuLaunchFirm(const char *filePath, bool quick) { - u32 keys; - if(!filePath) return false; @@ -57,19 +55,6 @@ printf("\n\x1B[32mFirmware verification SUCCESS!\e[0m\n\n"); - /* - printf("Attempting to run firmware, press B to exit...\n"); - - for(int i=0; i<0x800000; i++) - { - hidScanInput(); - keys = hidKeysDown(); - - if(keys & KEY_B) - goto fail; - } - */ - menuSetReturnToState(MENU_STATE_EXIT); return true; @@ -258,11 +243,11 @@ } // check pad value - const u32 *temp; - temp = (const u32 *)configGetData(keyPad); - if(temp) + const u32 *dataPtr; + dataPtr = (const u32 *)configGetData(keyPad); + if(dataPtr) { - expectedPadValue = *temp; + expectedPadValue = *dataPtr; hidScanInput(); padValue = HID_KEY_MASK_ALL & hidKeysHeld(); if(padValue != expectedPadValue) diff --git a/source/arm9/menu_nand.c b/source/arm9/menu_nand.c index b508a55..31287a8 100644 --- a/source/arm9/menu_nand.c +++ b/source/arm9/menu_nand.c @@ -7,6 +7,7 @@ #include "fatfs/ff.h" #include "hid.h" #include "util.h" +#include "arm9/main.h" #include "arm9/menu.h" #include "arm9/timer.h"