Backup savestate is created before a state is loaded

This commit is contained in:
adelikat 2008-12-19 22:11:01 +00:00
parent 5a0185c0ad
commit fe5d1b2313
4 changed files with 18 additions and 2 deletions

View File

@ -1,4 +1,5 @@
---version 2.0.4 yet to be released---
19-dec-2008 - adelikat - Backup savestate is made before loading a state
18-dec-2008 - adelikat - win32 - turbo bypasses sound better if muteturbo is checked
18-dec-2008 - shinydoofy - sdl - fixed compiling errors for SDL due to r1037
18-dec-2008 - adelikat - win32 - fullscreen mode fixed (both enters and returns to fullscreen just fine)

View File

@ -55,5 +55,4 @@ void FCEUD_LoadStateFrom()
// Load save state if a file was selected.
FCEUI_LoadState(nameo);
}
}
}

View File

@ -48,6 +48,8 @@
#include "zlib.h"
#include "driver.h"
using namespace std;
static void (*SPreSave)(void);
static void (*SPostSave)(void);
@ -795,6 +797,7 @@ void FCEUI_LoadState(const char *fname)
information expected in newer save states, desynchronization won't occur(at least not
from this ;)).
*/
BackupSaveState();
if(FCEUSS_Load(fname))
{
@ -836,3 +839,15 @@ void FCEU_DrawSaveStates(uint8 *XBuf)
StateShow--;
}
void BackupSaveState()
{
//Everytime a load state is loaded, this is run prior so that the user has a backup of the previous emulator state
string filename;
int x;
filename = strdup(FCEU_MakeFName(FCEUMKF_STATE,CurrentState,0).c_str()); //Generate normal savestate filename
x = filename.find_last_of("."); //Find last dot
filename = filename.substr(0,x); //Chop off file extension
filename.append(".bak"); //add .bak
}

View File

@ -61,3 +61,4 @@ void AddExState(void *v, uint32 s, int type, char *desc);
void FCEU_DrawSaveStates(uint8 *XBuf);
void BackupSaveState(); //Makes a backupsavestate