mirror of
https://github.com/dborth/snes9xgx.git
synced 2024-11-24 11:39:21 +01:00
correction for loading settings from usb, set widescreen to maximum size
This commit is contained in:
parent
17278b6332
commit
3a5f1f06e7
@ -352,10 +352,12 @@ SavePrefs (bool silent)
|
|||||||
char filepath[1024];
|
char filepath[1024];
|
||||||
int datasize;
|
int datasize;
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
|
int method = appLoadMethod;
|
||||||
|
|
||||||
// We'll save using the first available method (probably SD) since this
|
// We'll save using the first available method (probably SD) since this
|
||||||
// is the method preferences will be loaded from by default
|
// is the method preferences will be loaded from by default
|
||||||
int method = autoSaveMethod(silent);
|
if(method == METHOD_AUTO)
|
||||||
|
autoSaveMethod(silent);
|
||||||
|
|
||||||
if(method == METHOD_AUTO)
|
if(method == METHOD_AUTO)
|
||||||
return false;
|
return false;
|
||||||
@ -433,6 +435,19 @@ bool LoadPrefs()
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
bool prefFound = false;
|
bool prefFound = false;
|
||||||
|
|
||||||
|
if(appLoadMethod == METHOD_SD)
|
||||||
|
{
|
||||||
|
if(ChangeInterface(METHOD_SD, SILENT))
|
||||||
|
prefFound = LoadPrefsFromMethod(METHOD_SD);
|
||||||
|
}
|
||||||
|
else if(appLoadMethod == METHOD_USB)
|
||||||
|
{
|
||||||
|
if(ChangeInterface(METHOD_USB, SILENT))
|
||||||
|
prefFound = LoadPrefsFromMethod(METHOD_USB);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if(ChangeInterface(METHOD_SD, SILENT))
|
if(ChangeInterface(METHOD_SD, SILENT))
|
||||||
prefFound = LoadPrefsFromMethod(METHOD_SD);
|
prefFound = LoadPrefsFromMethod(METHOD_SD);
|
||||||
if(!prefFound && ChangeInterface(METHOD_USB, SILENT))
|
if(!prefFound && ChangeInterface(METHOD_USB, SILENT))
|
||||||
@ -443,6 +458,7 @@ bool LoadPrefs()
|
|||||||
prefFound = LoadPrefsFromMethod(METHOD_MC_SLOTB);
|
prefFound = LoadPrefsFromMethod(METHOD_MC_SLOTB);
|
||||||
if(!prefFound && ChangeInterface(METHOD_SMB, SILENT))
|
if(!prefFound && ChangeInterface(METHOD_SMB, SILENT))
|
||||||
prefFound = LoadPrefsFromMethod(METHOD_SMB);
|
prefFound = LoadPrefsFromMethod(METHOD_SMB);
|
||||||
|
}
|
||||||
|
|
||||||
prefLoaded = true; // attempted to load preferences
|
prefLoaded = true; // attempted to load preferences
|
||||||
|
|
||||||
|
@ -63,6 +63,7 @@ int ShutdownRequested = 0;
|
|||||||
int ResetRequested = 0;
|
int ResetRequested = 0;
|
||||||
int ExitRequested = 0;
|
int ExitRequested = 0;
|
||||||
char appPath[1024];
|
char appPath[1024];
|
||||||
|
int appLoadMethod = METHOD_AUTO;
|
||||||
FreeTypeGX *fontSystem;
|
FreeTypeGX *fontSystem;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -279,22 +280,27 @@ emulate ()
|
|||||||
} // main loop
|
} // main loop
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateAppPath(char origpath[])
|
static void CreateAppPath(char origpath[])
|
||||||
{
|
{
|
||||||
#ifdef HW_DOL
|
#ifdef HW_DOL
|
||||||
sprintf(appPath, GCSettings.SaveFolder);
|
sprintf(appPath, GCSettings.SaveFolder);
|
||||||
#else
|
#else
|
||||||
char path[1024];
|
char path[1024];
|
||||||
strcpy(path, origpath); // make a copy so we don't mess up original
|
strncpy(path, origpath, 1024); // make a copy so we don't mess up original
|
||||||
|
|
||||||
char * loc;
|
char * loc;
|
||||||
int pos = -1;
|
int pos = -1;
|
||||||
|
|
||||||
|
if(strncmp(path, "sd:/", 5) == 0 || strncmp(path, "fat:/", 5) == 0)
|
||||||
|
appLoadMethod = METHOD_SD;
|
||||||
|
else if(strncmp(path, "usb:/", 5) == 0)
|
||||||
|
appLoadMethod = METHOD_USB;
|
||||||
|
|
||||||
loc = strrchr(path,'/');
|
loc = strrchr(path,'/');
|
||||||
if (loc != NULL)
|
if (loc != NULL)
|
||||||
*loc = 0; // strip file name
|
*loc = 0; // strip file name
|
||||||
|
|
||||||
loc = strchr(path,'/'); // looking for / from fat:/
|
loc = strchr(path,'/'); // looking for first / (after sd: or usb:)
|
||||||
if (loc != NULL)
|
if (loc != NULL)
|
||||||
pos = loc - path + 1;
|
pos = loc - path + 1;
|
||||||
|
|
||||||
|
@ -99,6 +99,7 @@ extern int ConfigRequested;
|
|||||||
extern int ShutdownRequested;
|
extern int ShutdownRequested;
|
||||||
extern int ExitRequested;
|
extern int ExitRequested;
|
||||||
extern char appPath[];
|
extern char appPath[];
|
||||||
|
extern int appLoadMethod;
|
||||||
extern FreeTypeGX *fontSystem;
|
extern FreeTypeGX *fontSystem;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -553,8 +553,7 @@ static void SetupVideoMode()
|
|||||||
// widescreen fix
|
// widescreen fix
|
||||||
if(CONF_GetAspectRatio() == CONF_ASPECT_16_9)
|
if(CONF_GetAspectRatio() == CONF_ASPECT_16_9)
|
||||||
{
|
{
|
||||||
vmode->viWidth = VI_MAX_WIDTH_PAL-12;
|
vmode->viWidth = VI_MAX_WIDTH_PAL;
|
||||||
vmode->viXOrigin = ((VI_MAX_WIDTH_PAL - vmode->viWidth) / 2) + 2;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user