mirror of https://github.com/stella-emu/stella.git
Added '-md5instate' commandline argument, which determines how a state load
is related to the currently running ROM. If enabled (the default and current behaviour), state files that do not match the currently loaded ROM will not be loaded. Otherwise, the state file will attempt to load. Note that in the latter case, this will probably cause 'bad things' to happen. It's mostly for developers who are constantly recompiling a ROM, and wish to use a previously created state file even when the ROM MD5 changes. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1915 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
88df583c23
commit
48a48d8619
|
@ -866,6 +866,12 @@
|
||||||
saving a ROM state file.</td>
|
saving a ROM state file.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><pre>-md5instate <1|0></pre></td>
|
||||||
|
<td>When loading state files, check if the MD5 of the current ROM matches that
|
||||||
|
saved in the state file. If disabled, no such check is performed.</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><pre>-audiofirst <1|0></pre></td>
|
<td><pre>-audiofirst <1|0></pre></td>
|
||||||
<td>Initialize the audio subsystem before video when emulating a
|
<td>Initialize the audio subsystem before video when emulating a
|
||||||
|
|
|
@ -114,6 +114,7 @@ Settings::Settings(OSystem* osystem)
|
||||||
|
|
||||||
// Misc options
|
// Misc options
|
||||||
setInternal("autoslot", "false");
|
setInternal("autoslot", "false");
|
||||||
|
setInternal("md5instate", "true");
|
||||||
setInternal("showinfo", "false");
|
setInternal("showinfo", "false");
|
||||||
setInternal("tiadriven", "false");
|
setInternal("tiadriven", "false");
|
||||||
setInternal("avoxport", "");
|
setInternal("avoxport", "");
|
||||||
|
@ -358,6 +359,7 @@ void Settings::usage()
|
||||||
<< " -sa1 <left|right> Stelladaptor 1 emulates specified joystick port\n"
|
<< " -sa1 <left|right> Stelladaptor 1 emulates specified joystick port\n"
|
||||||
<< " -sa2 <left|right> Stelladaptor 2 emulates specified joystick port\n"
|
<< " -sa2 <left|right> Stelladaptor 2 emulates specified joystick port\n"
|
||||||
<< " -autoslot <1|0> Automatically switch to next save slot when state saving\n"
|
<< " -autoslot <1|0> Automatically switch to next save slot when state saving\n"
|
||||||
|
<< " -md5instate <1|0> ROM MD5 information is saved in a state file, tying the state file to the ROM\n"
|
||||||
<< " -audiofirst <1|0> Initial audio before video (required for some ATI video cards)\n"
|
<< " -audiofirst <1|0> Initial audio before video (required for some ATI video cards)\n"
|
||||||
<< " -fastscbios <1|0> Disable Supercharger BIOS progress loading bars\n"
|
<< " -fastscbios <1|0> Disable Supercharger BIOS progress loading bars\n"
|
||||||
<< " -ssdir <path> The directory to save snapshot files to\n"
|
<< " -ssdir <path> The directory to save snapshot files to\n"
|
||||||
|
|
|
@ -199,10 +199,19 @@ void StateManager::loadState(int slot)
|
||||||
// If so, do a complete state load using the Console
|
// If so, do a complete state load using the Console
|
||||||
if(in.getString() != STATE_HEADER)
|
if(in.getString() != STATE_HEADER)
|
||||||
buf << "Incompatible state " << slot << " file";
|
buf << "Incompatible state " << slot << " file";
|
||||||
else if(in.getString() == md5 && myOSystem->console().load(in))
|
|
||||||
buf << "State " << slot << " loaded";
|
|
||||||
else
|
else
|
||||||
buf << "Invalid data in state " << slot << " file";
|
{
|
||||||
|
const string& s = in.getString();
|
||||||
|
if(myOSystem->settings().getBool("md5instate") ? s == md5 : true)
|
||||||
|
{
|
||||||
|
if(myOSystem->console().load(in))
|
||||||
|
buf << "State " << slot << " loaded";
|
||||||
|
else
|
||||||
|
buf << "Invalid data in state " << slot << " file";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
buf << "State " << slot << " file doesn't match current ROM";
|
||||||
|
}
|
||||||
|
|
||||||
myOSystem->frameBuffer().showMessage(buf.str());
|
myOSystem->frameBuffer().showMessage(buf.str());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue