mirror of https://github.com/stella-emu/stella.git
Updated makefile and SDL port for state loading and saving.
For now, state support is present only in the SDL port. The following keys are used to access state stuff: F9: save state to current slot F10: change current slot (cycles from 0 through 9) F11: load state from current slot Messages will appear onscreen indicating success or failure. State files are saved named as the md5sum of the current ROM, with an extension of .stx appended, where x is the current slot (from 0 through 9). For now, these state files are saved in the current working directory. I plan on moving them to a $HOME/.stella/state directory for both the X11 and SDL ports. The Windows and DOS versions can choose other, more relevant locations. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@96 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
8a51196556
commit
b1df602401
|
@ -13,7 +13,7 @@
|
|||
## See the file "license" for information on usage and redistribution of
|
||||
## this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
##
|
||||
## $Id: makefile,v 1.15 2002-04-22 00:53:19 bwmott Exp $
|
||||
## $Id: makefile,v 1.16 2002-05-13 19:29:44 stephena Exp $
|
||||
##============================================================================
|
||||
|
||||
##============================================================================
|
||||
|
@ -229,6 +229,7 @@ CORE_OBJS = Booster.o Cart.o Cart2K.o Cart3F.o Cart4K.o CartAR.o CartDPC.o \
|
|||
Console.o Control.o Driving.o \
|
||||
Event.o Joystick.o Keyboard.o M6532.o MD5.o MediaSrc.o Paddles.o \
|
||||
Props.o PropsSet.o Random.o Sound.o Switches.o Settings.o TIA.o \
|
||||
Serializer.o Deserializer.o \
|
||||
$(M6502_OBJS)
|
||||
|
||||
stella.exe: $(CORE_OBJS) $(OBJS)
|
||||
|
@ -372,6 +373,12 @@ Switches.o: $(CORE)/Switches.cxx
|
|||
Sound.o: $(CORE)/Sound.cxx
|
||||
$(CXX) -c $(CXXFLAGS) $(OPTIONS) $(CORE)/Sound.cxx
|
||||
|
||||
Serializer.o: $(CORE)/Serializer.cxx
|
||||
$(CXX) -c $(CXXFLAGS) $(OPTIONS) $(CORE)/Serializer.cxx
|
||||
|
||||
Deserializer.o: $(CORE)/Deserializer.cxx
|
||||
$(CXX) -c $(CXXFLAGS) $(OPTIONS) $(CORE)/Deserializer.cxx
|
||||
|
||||
Settings.o: $(UI)/common/Settings.cxx $(UI)/common/Settings.hxx
|
||||
$(CXX) -c $(CXXFLAGS) $(OPTIONS) $(LDFLAGS) $(UI)/common/Settings.cxx
|
||||
|
||||
|
@ -431,4 +438,3 @@ NullDev.o: $(CORE)/m6502/src/NullDev.cxx
|
|||
|
||||
System.o: $(CORE)/m6502/src/System.cxx
|
||||
$(CXX) -c $(CXXFLAGS) $(OPTIONS) $(CORE)/m6502/src/System.cxx
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: mainSDL.cxx,v 1.22 2002-04-18 17:18:48 stephena Exp $
|
||||
// $Id: mainSDL.cxx,v 1.23 2002-05-13 19:29:44 stephena Exp $
|
||||
//============================================================================
|
||||
|
||||
#include <fstream>
|
||||
|
@ -201,7 +201,6 @@ static bool isCentered = false;
|
|||
static uInt32 currentState = 0;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
This routine should be called once the console is created to setup
|
||||
the SDL window for us to use. Return false if any operation fails,
|
||||
|
@ -622,23 +621,25 @@ void grabMouse(bool grab)
|
|||
*/
|
||||
void saveState()
|
||||
{
|
||||
#if 0
|
||||
// Do a state save using the MediaSource
|
||||
// ...
|
||||
char buf[40];
|
||||
|
||||
// First get the name for the current state file
|
||||
string md5 = theConsole->properties().get("Cartridge.MD5");
|
||||
snprintf(buf, 39, "%s.st%d", md5.c_str(), currentState);
|
||||
string fileName = buf;
|
||||
|
||||
// Do a state save using the System
|
||||
int result = theConsole->system().saveState(fileName, md5);
|
||||
|
||||
// Print appropriate message
|
||||
char buf[40];
|
||||
if(true) // if the state saved correctly
|
||||
if(result == 1)
|
||||
snprintf(buf, 39, "State %d saved", currentState);
|
||||
else
|
||||
snprintf(buf, 39, "Error saving state %d", currentState);
|
||||
snprintf(buf, 39, "Error saving state %d %d", currentState, result);
|
||||
|
||||
string message = buf;
|
||||
theConsole->mediaSource().showMessage(message, MESSAGE_INTERVAL *
|
||||
settings->theDesiredFrameRate);
|
||||
#else
|
||||
cerr << "State saving not yet implemented\n";
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -652,14 +653,12 @@ void changeState()
|
|||
else
|
||||
++currentState;
|
||||
|
||||
#if 0
|
||||
// Print appropriate message
|
||||
char buf[40];
|
||||
snprintf(buf, 39, "Changed to state slot %d", currentState);
|
||||
string message = buf;
|
||||
theConsole->mediaSource().showMessage(message, MESSAGE_INTERVAL *
|
||||
settings->theDesiredFrameRate);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -668,23 +667,25 @@ void changeState()
|
|||
*/
|
||||
void loadState()
|
||||
{
|
||||
#if 0
|
||||
// Do a state load using the MediaSource
|
||||
// ...
|
||||
char buf[40];
|
||||
|
||||
// First get the name for the current state file
|
||||
string md5 = theConsole->properties().get("Cartridge.MD5");
|
||||
snprintf(buf, 39, "%s.st%d", md5.c_str(), currentState);
|
||||
string fileName = buf;
|
||||
|
||||
// Do a state load using the System
|
||||
int result = theConsole->system().loadState(fileName, md5);
|
||||
|
||||
// Print appropriate message
|
||||
char buf[40];
|
||||
if(true) // if the state loaded correctly
|
||||
if(result == 1)
|
||||
snprintf(buf, 39, "State %d loaded", currentState);
|
||||
else
|
||||
snprintf(buf, 39, "Error loading state %d", currentState);
|
||||
snprintf(buf, 39, "Error loading state %d %d", currentState, result);
|
||||
|
||||
string message = buf;
|
||||
theConsole->mediaSource().showMessage(message, MESSAGE_INTERVAL *
|
||||
settings->theDesiredFrameRate);
|
||||
#else
|
||||
cerr << "State loading not yet implemented\n";
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue