Port option to not append " Auto" from vbagx

This commit is contained in:
libertyernie 2017-08-30 18:44:18 -05:00
parent e41ae649cb
commit 8a7d51928f
5 changed files with 20 additions and 1 deletions

View File

@ -83,6 +83,7 @@ struct SGCSettings
int AutoSave;
int LoadMethod; // For ROMS: Auto, SD, DVD, USB, Network (SMB)
int SaveMethod; // For SRAM, Freeze, Prefs: Auto, SD, USB, SMB
int AppendAuto; // 0 - no, 1 - yes
char LoadFolder[MAXPATHLEN]; // Path to game files
char LastFileLoaded[MAXPATHLEN]; //Last file loaded filename
char SaveFolder[MAXPATHLEN]; // Path to save files

View File

@ -154,6 +154,9 @@ LoadRAMAuto (bool silent)
if (LoadRAM(filepath, silent))
return true;
if (!GCSettings.AppendAuto)
return false;
// look for file with no number or Auto appended
if(!MakeFilePath(filepath2, FILE_RAM, romFilename, -1))
return false;

View File

@ -280,6 +280,9 @@ bool MakeFilePath(char filepath[], int type, char * filename, int filenum)
if(filenum == -1)
sprintf(file, "%s.%s", filename, ext);
else if(filenum == 0)
if (GCSettings.AppendAuto <= 0)
sprintf(file, "%s.%s", filename, ext);
else
sprintf(file, "%s Auto.%s", filename, ext);
else
sprintf(file, "%s %i.%s", filename, filenum, ext);

View File

@ -3549,6 +3549,7 @@ static int MenuSettingsFile()
sprintf(options.name[i++], "Screenshots Folder");
sprintf(options.name[i++], "Auto Load");
sprintf(options.name[i++], "Auto Save");
sprintf(options.name[i++], "Append Auto to .SAV Files");
options.length = i;
for(i=0; i < options.length; i++)
@ -3634,6 +3635,12 @@ static int MenuSettingsFile()
if (GCSettings.AutoSave > 3)
GCSettings.AutoSave = 0;
break;
case 8:
GCSettings.AppendAuto++;
if (GCSettings.AppendAuto > 1)
GCSettings.AppendAuto = 0;
break;
}
if(ret >= 0 || firstRun)
@ -3706,6 +3713,9 @@ static int MenuSettingsFile()
else if (GCSettings.AutoSave == 2) sprintf (options.value[7],"State");
else if (GCSettings.AutoSave == 3) sprintf (options.value[7],"Both");
if (GCSettings.AppendAuto == 0) sprintf (options.value[10], "Off");
else if (GCSettings.AppendAuto == 1) sprintf (options.value[10], "On");
optionBrowser.TriggerUpdate();
}

View File

@ -126,6 +126,7 @@ preparePrefsData ()
createXMLSetting("LoadFolder", "Load Folder", GCSettings.LoadFolder);
createXMLSetting("LastFileLoaded", "Last File Loaded", GCSettings.LastFileLoaded);
createXMLSetting("SaveFolder", "Save Folder", GCSettings.SaveFolder);
createXMLSetting("AppendAuto", "Append Auto to .SAV Files", toStr(GCSettings.AppendAuto));
createXMLSetting("CheatFolder", "Cheats Folder", GCSettings.CheatFolder);
createXMLSetting("gamegenie", "Game Genie", toStr(GCSettings.gamegenie));
createXMLSetting("ScreenshotsFolder", "Screenshots Folder", GCSettings.ScreenshotsFolder);
@ -299,6 +300,7 @@ decodePrefsData ()
loadXMLSetting(GCSettings.LoadFolder, "LoadFolder", sizeof(GCSettings.LoadFolder));
loadXMLSetting(GCSettings.LastFileLoaded, "LastFileLoaded", sizeof(GCSettings.LastFileLoaded));
loadXMLSetting(GCSettings.SaveFolder, "SaveFolder", sizeof(GCSettings.SaveFolder));
loadXMLSetting(&GCSettings.AppendAuto, "AppendAuto");
loadXMLSetting(GCSettings.CheatFolder, "CheatFolder", sizeof(GCSettings.CheatFolder));
loadXMLSetting(&GCSettings.gamegenie, "gamegenie");
loadXMLSetting(GCSettings.ScreenshotsFolder, "ScreenshotsFolder", sizeof(GCSettings.ScreenshotsFolder));