diff --git a/source/filebrowser.cpp b/source/filebrowser.cpp index 78f48e7..dd9a6e7 100644 --- a/source/filebrowser.cpp +++ b/source/filebrowser.cpp @@ -68,6 +68,8 @@ int autoLoadMethod() device = DEVICE_SD_SLOTB; else if(ChangeInterface(DEVICE_SD_PORT2, SILENT)) device = DEVICE_SD_PORT2; + else if(ChangeInterface(DEVICE_SD_GCLOADER, SILENT)) + device = DEVICE_SD_GCLOADER; else if(ChangeInterface(DEVICE_DVD, SILENT)) device = DEVICE_DVD; else if(ChangeInterface(DEVICE_SMB, SILENT)) @@ -101,6 +103,8 @@ int autoSaveMethod(bool silent) device = DEVICE_SD_SLOTB; else if(ChangeInterface(DEVICE_SD_PORT2, SILENT)) device = DEVICE_SD_PORT2; + else if(ChangeInterface(DEVICE_SD_GCLOADER, SILENT)) + device = DEVICE_SD_GCLOADER; else if(ChangeInterface(DEVICE_SMB, SILENT)) device = DEVICE_SMB; else if(!silent) @@ -171,7 +175,8 @@ bool IsDeviceRoot(char * path) strcmp(path, "smb:/") == 0 || strcmp(path, "carda:/") == 0 || strcmp(path, "cardb:/") == 0 || - strcmp(path, "port2:/") == 0) + strcmp(path, "port2:/") == 0 || + strcmp(path, "gcloader:/") == 0 ) { return true; } diff --git a/source/fileop.cpp b/source/fileop.cpp index 957a47a..73a5a7e 100644 --- a/source/fileop.cpp +++ b/source/fileop.cpp @@ -44,8 +44,8 @@ unsigned char *savebuffer = NULL; u8 *ext_font_ttf = NULL; static mutex_t bufferLock = LWP_MUTEX_NULL; FILE * file; // file pointer - the only one we should ever use! -bool unmountRequired[8] = { false, false, false, false, false, false, false, false }; -bool isMounted[8] = { false, false, false, false, false, false, false, false }; +bool unmountRequired[9] = { false, false, false, false, false, false, false, false, false }; +bool isMounted[9] = { false, false, false, false, false, false, false, false, false }; #ifdef HW_RVL static DISC_INTERFACE* sd = &__io_wiisd; @@ -56,6 +56,7 @@ bool isMounted[8] = { false, false, false, false, false, false, false, false }; static DISC_INTERFACE* cardb = &__io_gcsdb; static DISC_INTERFACE* port2 = &__io_gcsd2; static DISC_INTERFACE* dvd = &__io_gcdvd; + static DISC_INTERFACE* gcloader = &__io_gcode; #endif // folder parsing thread @@ -208,6 +209,7 @@ void UnmountAllFAT() fatUnmount("port2:"); fatUnmount("carda:"); fatUnmount("cardb:"); + fatUnmount("gcloader:"); #endif } @@ -255,6 +257,11 @@ static bool MountFAT(int device, int silent) sprintf(name2, "port2:"); disc = port2; break; + case DEVICE_SD_GCLOADER: + sprintf(name, "gcloader"); + sprintf(name2, "gcloader:"); + disc = gcloader; + break; #endif default: return false; // unknown device @@ -390,6 +397,11 @@ bool FindDevice(char * filepath, int * device) *device = DEVICE_DVD; return true; } + else if(strncmp(filepath, "gcloader:", 9) == 0) + { + *device = DEVICE_SD_GCLOADER; + return true; + } return false; } @@ -426,6 +438,7 @@ bool ChangeInterface(int device, bool silent) case DEVICE_SD_SLOTA: case DEVICE_SD_SLOTB: case DEVICE_SD_PORT2: + case DEVICE_SD_GCLOADER: #endif mounted = MountFAT(device, silent); break; diff --git a/source/menu.cpp b/source/menu.cpp index d6ab63e..70fa20f 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -3786,9 +3786,9 @@ static int MenuSettingsFile() #endif // correct load/save methods out of bounds - if(GCSettings.LoadMethod > 7) + if(GCSettings.LoadMethod > 8) GCSettings.LoadMethod = 0; - if(GCSettings.SaveMethod > 7) + if(GCSettings.SaveMethod > 8) GCSettings.SaveMethod = 0; if (GCSettings.LoadMethod == DEVICE_AUTO) sprintf (options.value[0],"Auto Detect"); @@ -3799,6 +3799,7 @@ static int MenuSettingsFile() else if (GCSettings.LoadMethod == DEVICE_SD_SLOTA) sprintf (options.value[0],"SD Gecko Slot A"); else if (GCSettings.LoadMethod == DEVICE_SD_SLOTB) sprintf (options.value[0],"SD Gecko Slot B"); else if (GCSettings.LoadMethod == DEVICE_SD_PORT2) sprintf (options.value[0],"SD in SP2"); + else if (GCSettings.LoadMethod == DEVICE_SD_GCLOADER) sprintf (options.value[0],"GC Loader"); if (GCSettings.SaveMethod == DEVICE_AUTO) sprintf (options.value[1],"Auto Detect"); else if (GCSettings.SaveMethod == DEVICE_SD) sprintf (options.value[1],"SD"); @@ -3807,6 +3808,7 @@ static int MenuSettingsFile() else if (GCSettings.SaveMethod == DEVICE_SD_SLOTA) sprintf (options.value[1],"SD Gecko Slot A"); else if (GCSettings.SaveMethod == DEVICE_SD_SLOTB) sprintf (options.value[1],"SD Gecko Slot B"); else if (GCSettings.SaveMethod == DEVICE_SD_PORT2) sprintf (options.value[1],"SD in SP2"); + else if (GCSettings.SaveMethod == DEVICE_SD_GCLOADER) sprintf (options.value[1],"GC Loader"); snprintf (options.value[2], 35, "%s", GCSettings.LoadFolder); snprintf (options.value[3], 35, "%s", GCSettings.SaveFolder); diff --git a/source/preferences.cpp b/source/preferences.cpp index 444865a..5888ec1 100644 --- a/source/preferences.cpp +++ b/source/preferences.cpp @@ -592,9 +592,9 @@ decodePalsData () ***************************************************************************/ void FixInvalidSettings() { - if(GCSettings.LoadMethod > 7) + if(GCSettings.LoadMethod > 8) GCSettings.LoadMethod = DEVICE_AUTO; - if(GCSettings.SaveMethod > 7) + if(GCSettings.SaveMethod > 8) GCSettings.SaveMethod = DEVICE_AUTO; if(!(GCSettings.gbaZoomHor >= 0.5 && GCSettings.gbaZoomHor <= 1.6)) GCSettings.gbaZoomHor = 1.0; @@ -840,6 +840,10 @@ bool LoadPrefs() sprintf(filepath[0], "port2:/%s", APPFOLDER); prefFound = LoadPrefsFromMethod(filepath[0]); } + else if(ChangeInterface(DEVICE_SD_GCLOADER, SILENT)) { + sprintf(filepath[0], "gcloader:/%s", APPFOLDER); + prefFound = LoadPrefsFromMethod(filepath[0]); + } #endif prefLoaded = true; // attempted to load preferences diff --git a/source/vbagx.h b/source/vbagx.h index d25da84..1100295 100644 --- a/source/vbagx.h +++ b/source/vbagx.h @@ -25,8 +25,8 @@ #define NOTSILENT 0 #define SILENT 1 -const char pathPrefix[9][8] = -{ "", "sd:/", "usb:/", "dvd:/", "smb:/", "carda:/", "cardb:/", "port2:/" }; +const char pathPrefix[10][11] = +{ "", "sd:/", "usb:/", "dvd:/", "smb:/", "carda:/", "cardb:/", "port2:/", "gcloader:/" }; enum { @@ -37,7 +37,8 @@ enum DEVICE_SMB, DEVICE_SD_SLOTA, DEVICE_SD_SLOTB, - DEVICE_SD_PORT2 + DEVICE_SD_PORT2, + DEVICE_SD_GCLOADER, }; enum