Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion source/filebrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down
17 changes: 15 additions & 2 deletions source/fileop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -208,6 +209,7 @@ void UnmountAllFAT()
fatUnmount("port2:");
fatUnmount("carda:");
fatUnmount("cardb:");
fatUnmount("gcloader:");
#endif
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions source/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand All @@ -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);
Expand Down
8 changes: 6 additions & 2 deletions source/preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions source/vbagx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -37,7 +37,8 @@ enum
DEVICE_SMB,
DEVICE_SD_SLOTA,
DEVICE_SD_SLOTB,
DEVICE_SD_PORT2
DEVICE_SD_PORT2,
DEVICE_SD_GCLOADER,
};

enum
Expand Down