From ec40edc2271a122139a229a734de73993a7be033 Mon Sep 17 00:00:00 2001 From: ApacheThunder Date: Fri, 12 Jul 2024 23:34:50 -0500 Subject: [PATCH] Change GBA mode button .. * GBA mode trigger now occurs on B button instead of A button as some flashcarts like DSTT use a launcher that already uses this button for GBA mode. * FileBrowser trigger remapped to trigger from any button not assigned to the other actions. So if shoulder buttons or Start/Select button is used file browser comes up. This ensures user can enter filebrowser without triggering any special mode their flashcart's main loader might have for the button they wanted to use. This isn't relevent for original R4 but if user wishes to use this bootstrap on other carts (like DSTT) then it would have been an issue. DSTT appearently boots into GBA mode if B was used on boot. --- Makefile | 2 +- arm9/source/main.cpp | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index aacd764..fe5f060 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ export TOPDIR := $(CURDIR) export HBMENU_MAJOR := 1 export HBMENU_MINOR := 0 -export HBMENU_PATCH := 1 +export HBMENU_PATCH := 2 VERSION := $(HBMENU_MAJOR).$(HBMENU_MINOR).$(HBMENU_PATCH) diff --git a/arm9/source/main.cpp b/arm9/source/main.cpp index 079e44e..56d557d 100644 --- a/arm9/source/main.cpp +++ b/arm9/source/main.cpp @@ -143,6 +143,11 @@ int stop(void) { int FileBrowser() { InitGUI(); consoleClear(); + while(1) { + swiWaitForVBlank(); + scanKeys(); + if (!keysHeld())break; + } vector extensionList = argsGetExtensionList(); chdir("/nds"); while(1) { @@ -179,10 +184,9 @@ int main(int argc, char **argv) { swiWaitForVBlank(); scanKeys(); switch (keysDown()) { - case KEY_A: { + case KEY_B: { if (!isDSiMode()) { gbaMode(); } else { FileBrowser(); } } break; - case KEY_B: FileBrowser(); break; case KEY_X: { if((access("/Misc.nds", F_OK) == 0)) { runNdsFile("/Misc.nds", 0, NULL); @@ -197,7 +201,7 @@ int main(int argc, char **argv) { FileBrowser(); } } break; - default: { + case 0: { if((access("/r4tf.nds", F_OK) == 0)) { runNdsFile("/r4tf.nds", 0, NULL); } else if((access("/boot.nds", F_OK) == 0)) { @@ -206,6 +210,7 @@ int main(int argc, char **argv) { FileBrowser(); } } break; + default: FileBrowser(); break; } return stop(); }