diff --git a/Changes.txt b/Changes.txt
index c2bc9b4e5..d2d995e9e 100644
--- a/Changes.txt
+++ b/Changes.txt
@@ -97,6 +97,8 @@
* Added option to save and load all TimeMachine states at once.
+ * Added option to automatically save states when exiting emulation.
+
* Added option to change pitch of Pitfall II music.
* ROM Info Launcher can now display multiple lines per property and
diff --git a/docs/graphics/options_developer.png b/docs/graphics/options_developer.png
index 33c42a1ae..8d345f9aa 100644
Binary files a/docs/graphics/options_developer.png and b/docs/graphics/options_developer.png differ
diff --git a/docs/graphics/options_developer_emulation.png b/docs/graphics/options_developer_emulation.png
index 5d31a0e5c..6b8009f35 100644
Binary files a/docs/graphics/options_developer_emulation.png and b/docs/graphics/options_developer_emulation.png differ
diff --git a/docs/graphics/options_developer_timemachine.png b/docs/graphics/options_developer_timemachine.png
index 325b3f1de..8c66c2af5 100644
Binary files a/docs/graphics/options_developer_timemachine.png and b/docs/graphics/options_developer_timemachine.png differ
diff --git a/docs/index.html b/docs/index.html
index 82eb1c9e4..e38dbe470 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -2617,10 +2617,20 @@
If disabled, use the last databus value for those pins instead.
-dev.rwportbreak <1|0> |
- Since the 2600 has no dedicated R/W line, different addresses are used
- for RAM read or write access. If the code reads from such a write address, this causes
- an unwanted, semi-random write to that address.
- When this option is enabled, such reads interrupt emulation and the debugger is entered. |
+ Since the 2600 has no dedicated R/W line, different addresses are
+ used for RAM read or write access.
+ If the code reads from such a write address, this causes an unwanted,
+ semi-random write to that address.
+ When this option is enabled, such reads interrupt emulation and the
+ debugger is entered. |
+
+ -dev.wrportbreak <1|0> |
+ Same as above.
+ If the code writes to such a read address, nothing happens. But a
+ developer should be made aware of it, because this indicates a problem
+ with the code.
+ When this option is enabled, such writes interrupt emulation and the
+ debugger is entered. |
-dev.thumb.trapfatal <1|0> |
When enabled, this allows the Thumb ARM emulation to
@@ -3244,6 +3254,11 @@
| A read from a write port interrupts emulation and the debugger is entered. |
-dev.rwportbreak |
+
+ Break on write to ... |
+ A write to a read port interrupts emulation and the debugger is entered. |
+ -dev.wrportbreak |
+
Fatal ARM emulation ... |
Thumb ARM emulation throws an exception and enters the debugger on fatal errors |
@@ -3364,6 +3379,12 @@
Automatically save no, current or all states when exiting emulation.
-saveonexit |
+
+ Automatically switch... |
+
+ Automatically switch to the next available save state slot after saving a ROM state file.
+ |
+ -autoslot |
diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx
index 366e85307..4689be2ed 100644
--- a/src/emucore/Settings.cxx
+++ b/src/emucore/Settings.cxx
@@ -465,10 +465,11 @@ void Settings::usage() const
<< " scaling/effects)\n"
<< " -ssinterval Number of seconds between snapshots in\n"
<< " continuous snapshot mode\n"
- << " -autoslot <1|0> Automatically switch to next save slot when\n"
- << " state saving\n"
+ << endl
<< " -saveonexit \n"
+ << " -autoslot <1|0> Automatically switch to next save slot when\n"
+ << " state saving\n"
<< endl
<< " -rominfo Display detailed information for the given ROM\n"
<< " -listrominfo Display contents of stella.pro, one line per ROM\n"
@@ -588,6 +589,7 @@ void Settings::usage() const
<< " read/peek\n"
#ifdef DEBUGGER_SUPPORT
<< " -dev.rwportbreak <1|0> Debugger breaks on reads from write ports\n"
+ << " -dev.wrportbreak <1|0> Debugger breaks on writes to read ports\n"
#endif
<< " -dev.thumb.trapfatal <1|0> Determines whether errors in ARM emulation\n"
<< " throw an exception\n"
diff --git a/src/gui/DeveloperDialog.cxx b/src/gui/DeveloperDialog.cxx
index 85be63fdf..28ecf6e7b 100644
--- a/src/gui/DeveloperDialog.cxx
+++ b/src/gui/DeveloperDialog.cxx
@@ -494,6 +494,11 @@ void DeveloperDialog::addTimeMachineTab(const GUI::Font& font)
wid.push_back(r);
ypos += lineHeight + VGAP;
+
+ myAutoSlotWidget = new CheckboxWidget(myTab, font, HBORDER, ypos + 1, "Automatically switch save state slots");
+ wid.push_back(myAutoSlotWidget);
+ ypos += lineHeight + VGAP;
+
// Add message concerning usage
const GUI::Font& infofont = instance().frameBuffer().infoFont();
ypos = myTab->getHeight() - 5 - fontHeight - infofont.getFontHeight() - 10;
@@ -841,6 +846,8 @@ void DeveloperDialog::loadConfig()
// Save on exit
string saveOnExit = instance().settings().getString("saveonexit");
mySaveOnExitGroup->setSelected(saveOnExit == "all" ? 2 : saveOnExit == "current" ? 1 : 0);
+ // Automatically change save state slots
+ myAutoSlotWidget->setState(instance().settings().getBool("autoslot"));
#ifdef DEBUGGER_SUPPORT
uInt32 w, h;
@@ -922,6 +929,8 @@ void DeveloperDialog::saveConfig()
int saveOnExit = mySaveOnExitGroup->getSelected();
instance().settings().setValue("saveonexit",
saveOnExit == 0 ? "none" : saveOnExit == 1 ? "current" : "all");
+ // Automatically change save state slots
+ instance().settings().setValue("autoslot", myAutoSlotWidget->getState());
#ifdef DEBUGGER_SUPPORT
// Debugger font style
@@ -1014,6 +1023,7 @@ void DeveloperDialog::setDefaults()
setWidgetStates(set);
mySaveOnExitGroup->setSelected(0);
+ myAutoSlotWidget->setState(false);
break;
case 4: // Debugger options
diff --git a/src/gui/DeveloperDialog.hxx b/src/gui/DeveloperDialog.hxx
index cb11990ae..ddee5468d 100644
--- a/src/gui/DeveloperDialog.hxx
+++ b/src/gui/DeveloperDialog.hxx
@@ -136,6 +136,7 @@ class DeveloperDialog : public Dialog
PopUpWidget* myStateIntervalWidget{nullptr};
PopUpWidget* myStateHorizonWidget{nullptr};
RadioButtonGroup* mySaveOnExitGroup{nullptr};
+ CheckboxWidget* myAutoSlotWidget{nullptr};
#ifdef DEBUGGER_SUPPORT
// Debugger UI widgets