diff --git a/src/FileBrowser.cpp b/src/FileBrowser.cpp index 3e92ce5..a2aeec3 100644 --- a/src/FileBrowser.cpp +++ b/src/FileBrowser.cpp @@ -41,6 +41,7 @@ extern Options options; #define PNG_HEIGHT 200 extern void GlobalSetDeviceID(u8 id); +extern void CheckAutoMountImage(EXIT_TYPE reset_reason , FileBrowser* fileBrowser); unsigned char FileBrowser::LSTBuffer[FileBrowser::LSTBuffer_size]; @@ -982,6 +983,10 @@ void FileBrowser::UpdateInputFolders() if (inputMappings->BrowseBack()) PopFolder(); } + if (inputMappings->BrowseAutoLoad()) + { + CheckAutoMountImage(EXIT_RESET, this); + } } } diff --git a/src/InputMappings.cpp b/src/InputMappings.cpp index 17c0d1a..6da1d1c 100644 --- a/src/InputMappings.cpp +++ b/src/InputMappings.cpp @@ -179,6 +179,8 @@ bool InputMappings::CheckKeyboardBrowseMode() // SetKeyboardFlag(PAGEDOWN_LCD_FLAG); else if (keyboard->KeyHeld(KEY_N) && keyboard->KeyEitherAlt() ) SetKeyboardFlag(NEWD64_FLAG); + else if (keyboard->KeyHeld(KEY_A) && keyboard->KeyEitherAlt() ) + SetKeyboardFlag(AUTOLOAD_FLAG); else { unsigned index; @@ -206,6 +208,8 @@ void InputMappings::CheckKeyboardEmulationMode(unsigned numberOfImages, unsigned SetKeyboardFlag(PREV_FLAG); else if (keyboard->KeyHeld(KEY_PAGEDOWN)) SetKeyboardFlag(NEXT_FLAG); + else if (keyboard->KeyHeld(KEY_A) && keyboard->KeyEitherAlt() ) + SetKeyboardFlag(AUTOLOAD_FLAG); else if (numberOfImages > 1) { unsigned index; diff --git a/src/InputMappings.h b/src/InputMappings.h index e884681..50bd586 100644 --- a/src/InputMappings.h +++ b/src/InputMappings.h @@ -38,6 +38,7 @@ #define PAGEUP_LCD_FLAG (1 << 13) #define NEWD64_FLAG (1 << 14) +#define AUTOLOAD_FLAG (1 << 15) // dont exceed 32!! class InputMappings : public Singleton @@ -148,6 +149,11 @@ public: return KeyboardFlag(NEWD64_FLAG); } + inline bool BrowseAutoLoad() + { + return KeyboardFlag(AUTOLOAD_FLAG); + } + // Used by the 2 cores so need to be volatile //volatile static unsigned directDiskSwapRequest; static unsigned directDiskSwapRequest; diff --git a/src/main.cpp b/src/main.cpp index 5e34d83..9e0895d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -102,12 +102,6 @@ unsigned int screenHeight = 768; const char* termainalTextRed = "\E[31m"; const char* termainalTextNormal = "\E[0m"; -typedef enum { - EXIT_UNKNOWN, - EXIT_RESET, - EXIT_CD, - EXIT_KEYBOARD -} EXIT_TYPE; EXIT_TYPE exitReason = EXIT_UNKNOWN; // Hooks required for USPi library @@ -654,7 +648,7 @@ void GlobalSetDeviceID(u8 id) SetVIAsDeviceID(id); } -static void CheckAutoMountImage(EXIT_TYPE reset_reason , FileBrowser* fileBrowser) +void CheckAutoMountImage(EXIT_TYPE reset_reason , FileBrowser* fileBrowser) { const char* autoMountImageName = options.GetAutoMountImageName(); if (autoMountImageName[0] != 0) diff --git a/src/types.h b/src/types.h index 22aa7dc..c50a902 100644 --- a/src/types.h +++ b/src/types.h @@ -16,4 +16,11 @@ typedef enum { LCD_1106_128x64, } LCD_MODEL; +typedef enum { + EXIT_UNKNOWN, + EXIT_RESET, + EXIT_CD, + EXIT_KEYBOARD +} EXIT_TYPE; + #endif