SDL: implemented FCEUD_SaveStateAs and FCEUD_LoadStateFrom

This commit is contained in:
shinydoofy 2009-04-12 16:38:59 +00:00
parent 447383efd2
commit b4f4f62553
3 changed files with 36 additions and 2 deletions

View File

@ -1,3 +1,4 @@
12-apr-2009 - shinydoofy - sdl - implemented saving/loading a savestate from a specific file on Alt+S/L
11-apr-2009 - shinydoofy - sdl - implemented starting an FM2 movie on Alt+R
11-apr-2009 - adelikat - made default save slot 0 instead of 1, Win32 - remember last slot used
11-apr-2009 - shinydoofy - sdl - added --pauseframe to pause movie playback on frame x

View File

@ -353,6 +353,31 @@ void FCEUD_MovieRecordTo()
FCEUI_SaveMovie(fname.c_str(), MOVIE_FLAG_FROM_POWERON, author);
}
/**
* Lets the user save a savestate to a specific file
**/
void FCEUD_SaveStateAs()
{
std::string fname = GetFilename("Save savestate as...", true, "Savestates|*.fc0");
if (!fname.size())
return; // no filename selected, quit the whole thing
FCEUI_SaveState(fname.c_str());
}
/**
* Lets the user load a savestate from a specific file
*/
void FCEUD_LoadStateFrom()
{
std::string fname = GetFilename("Load savestate from...", false, "Savestates|*.fc?");
if (!fname.size())
return; // no filename selected, quit the whole thing
FCEUI_LoadState(fname.c_str());
}
/**
* Parse keyboard commands and execute accordingly.
*/
@ -411,6 +436,16 @@ KeyboardCommands()
FCEUD_MovieRecordTo();
}
// Save a state from a file
if(keyonly(S) && is_alt) {
FCEUD_SaveStateAs();
}
// Load a state from a file
if(keyonly(L) && is_alt) {
FCEUD_LoadStateFrom();
}
// Famicom disk-system games
if(gametype==GIT_FDS)
{

View File

@ -713,8 +713,6 @@ void FCEUD_PrintError(const char *errormsg)
#define DUMMY(__f) void __f(void) {printf("%s\n", #__f); FCEU_DispMessage("Not implemented.");}
DUMMY(FCEUD_HideMenuToggle)
DUMMY(FCEUD_SaveStateAs)
DUMMY(FCEUD_LoadStateFrom)
DUMMY(FCEUD_MovieReplayFrom)
DUMMY(FCEUD_ToggleStatusIcon)
DUMMY(FCEUD_AviRecordTo)