diff --git a/docs/index.html b/docs/index.html index e82767747..aa6bdb75f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -866,6 +866,12 @@ saving a ROM state file. + +
-md5instate <1|0>
+ 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. + +
-audiofirst <1|0>
Initialize the audio subsystem before video when emulating a diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx index 519249cb6..438e22876 100644 --- a/src/emucore/Settings.cxx +++ b/src/emucore/Settings.cxx @@ -114,6 +114,7 @@ Settings::Settings(OSystem* osystem) // Misc options setInternal("autoslot", "false"); + setInternal("md5instate", "true"); setInternal("showinfo", "false"); setInternal("tiadriven", "false"); setInternal("avoxport", ""); @@ -358,6 +359,7 @@ void Settings::usage() << " -sa1 Stelladaptor 1 emulates specified joystick port\n" << " -sa2 Stelladaptor 2 emulates specified joystick port\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" << " -fastscbios <1|0> Disable Supercharger BIOS progress loading bars\n" << " -ssdir The directory to save snapshot files to\n" diff --git a/src/emucore/StateManager.cxx b/src/emucore/StateManager.cxx index 355d6d280..c21f86a5a 100644 --- a/src/emucore/StateManager.cxx +++ b/src/emucore/StateManager.cxx @@ -199,10 +199,19 @@ void StateManager::loadState(int slot) // If so, do a complete state load using the Console if(in.getString() != STATE_HEADER) buf << "Incompatible state " << slot << " file"; - else if(in.getString() == md5 && myOSystem->console().load(in)) - buf << "State " << slot << " loaded"; 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()); }