mirror of
https://github.com/dborth/vbagx.git
synced 2024-11-22 10:39:18 +01:00
fix memory card saves
This commit is contained in:
parent
993a3eb00f
commit
e0f60f7ba6
@ -217,10 +217,22 @@ bool MakeFilePath(char filepath[], int type, int method, char * filename, int fi
|
||||
if(filenum >= -1)
|
||||
{
|
||||
if(method == METHOD_MC_SLOTA || method == METHOD_MC_SLOTB)
|
||||
{
|
||||
if(filenum > 9)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if(filenum == -1)
|
||||
{
|
||||
filename[27] = 0; // truncate filename
|
||||
sprintf(file, "%s.%s", filename, ext);
|
||||
}
|
||||
else
|
||||
{
|
||||
filename[26] = 0; // truncate filename
|
||||
sprintf(file, "%s%i.%s", filename, filenum, ext);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(filenum == -1)
|
||||
|
@ -325,10 +325,13 @@ bool LoadBatteryOrStateAuto(int method, int action, bool silent)
|
||||
|
||||
if (action==FILE_SRAM)
|
||||
{
|
||||
if (!LoadBatteryOrState(filepath, method, action, SILENT))
|
||||
{
|
||||
if (LoadBatteryOrState(filepath, method, action, SILENT))
|
||||
return true;
|
||||
|
||||
// look for file with no number or Auto appended
|
||||
if(!MakeFilePath(filepath2, action, method, ROMFilename, -1))
|
||||
return false;
|
||||
|
||||
if(LoadBatteryOrState(filepath2, method, action, silent))
|
||||
{
|
||||
// rename this file - append Auto
|
||||
@ -337,16 +340,8 @@ bool LoadBatteryOrStateAuto(int method, int action, bool silent)
|
||||
rename(fullpath2, fullpath); // rename file (to avoid duplicates)
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return LoadBatteryOrState(filepath, method, action, silent);
|
||||
|
Loading…
Reference in New Issue
Block a user