mirror of
https://github.com/dborth/snes9xgx.git
synced 2024-11-01 00:15:14 +01:00
enable auto loading and renaming of SRAM saves w/o Auto appended, fix for letterboxing for PAL users
This commit is contained in:
parent
a2f42c3fcc
commit
9a65b6c3f7
@ -229,7 +229,7 @@ done you can proceed to run the emulator via the Homebrew Channel.
|
|||||||
•˜———–—––-- - —————————––––– ———–—––-- - —————————––––– ———–—––-- - ————————•
|
•˜———–—––-- - —————————––––– ———–—––-- - —————————––––– ———–—––-- - ————————•
|
||||||
|
|
||||||
If you are upgrading from a previous version you will need to remove the
|
If you are upgrading from a previous version you will need to remove the
|
||||||
"settings.xml" file from "\apps\Snes9x GX" directory on your SD Card. If you
|
"settings.xml" file from "\apps\Snes9xGX" directory on your SD Card. If you
|
||||||
are not upgrading then don't worry about it.
|
are not upgrading then don't worry about it.
|
||||||
|
|
||||||
The first time you run Snes9x GX it will create a new "settings.xml" file on
|
The first time you run Snes9x GX it will create a new "settings.xml" file on
|
||||||
|
@ -222,16 +222,30 @@ bool MakeFilePath(char filepath[], int type, int method, char * filename, int fi
|
|||||||
if(type == FILE_SRAM) sprintf(ext, "srm");
|
if(type == FILE_SRAM) sprintf(ext, "srm");
|
||||||
else sprintf(ext, "frz");
|
else sprintf(ext, "frz");
|
||||||
|
|
||||||
if(filenum >= 0)
|
if(filenum >= -1)
|
||||||
{
|
{
|
||||||
if(method == METHOD_MC_SLOTA || method == METHOD_MC_SLOTB)
|
if(method == METHOD_MC_SLOTA || method == METHOD_MC_SLOTB)
|
||||||
{
|
{
|
||||||
filename[26] = 0; // truncate filename
|
if(filenum > 9)
|
||||||
sprintf(file, "%s%i.%s", filename, filenum, ext);
|
{
|
||||||
|
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
|
else
|
||||||
{
|
{
|
||||||
if(filenum == 0)
|
if(filenum == -1)
|
||||||
|
sprintf(file, "%s.%s", filename, ext);
|
||||||
|
else if(filenum == 0)
|
||||||
sprintf(file, "%s Auto.%s", filename, ext);
|
sprintf(file, "%s Auto.%s", filename, ext);
|
||||||
else
|
else
|
||||||
sprintf(file, "%s %i.%s", filename, filenum, ext);
|
sprintf(file, "%s %i.%s", filename, filenum, ext);
|
||||||
|
@ -44,7 +44,7 @@ extern char rootdir[10];
|
|||||||
|
|
||||||
extern unsigned long SNESROMSize;
|
extern unsigned long SNESROMSize;
|
||||||
|
|
||||||
bool MakeFilePath(char filepath[], int type, int method, char * filename = NULL, int filenum = -1);
|
bool MakeFilePath(char filepath[], int type, int method, char * filename = NULL, int filenum = -2);
|
||||||
int UpdateDirName(int method);
|
int UpdateDirName(int method);
|
||||||
int OpenGameList();
|
int OpenGameList();
|
||||||
int autoLoadMethod();
|
int autoLoadMethod();
|
||||||
|
@ -94,12 +94,31 @@ LoadSRAMAuto (int method, bool silent)
|
|||||||
if(method == METHOD_AUTO)
|
if(method == METHOD_AUTO)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
char filepath[1024];
|
char filepath[MAXPATHLEN];
|
||||||
|
char fullpath[MAXPATHLEN];
|
||||||
|
char filepath2[MAXPATHLEN];
|
||||||
|
char fullpath2[MAXPATHLEN];
|
||||||
|
|
||||||
|
// look for Auto save file
|
||||||
if(!MakeFilePath(filepath, FILE_SRAM, method, Memory.ROMFilename, 0))
|
if(!MakeFilePath(filepath, FILE_SRAM, method, Memory.ROMFilename, 0))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return LoadSRAM(filepath, method, silent);
|
if (LoadSRAM(filepath, method, silent))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// look for file with no number or Auto appended
|
||||||
|
if(!MakeFilePath(filepath2, FILE_SRAM, method, Memory.ROMFilename, -1))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if(LoadSRAM(filepath2, method, silent))
|
||||||
|
{
|
||||||
|
// rename this file - append Auto
|
||||||
|
sprintf(fullpath, "%s%s", rootdir, filepath); // add device to path
|
||||||
|
sprintf(fullpath2, "%s%s", rootdir, filepath2); // add device to path
|
||||||
|
rename(fullpath2, fullpath); // rename file (to avoid duplicates)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -589,7 +589,7 @@ InitGCVideo ()
|
|||||||
|
|
||||||
VIDEO_Configure (vmode);
|
VIDEO_Configure (vmode);
|
||||||
|
|
||||||
screenheight = vmode->xfbHeight;
|
screenheight = 480;
|
||||||
screenwidth = vmode->fbWidth;
|
screenwidth = vmode->fbWidth;
|
||||||
|
|
||||||
// Allocate the video buffers
|
// Allocate the video buffers
|
||||||
|
Loading…
Reference in New Issue
Block a user