summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/machine.cpp
diff options
context:
space:
mode:
author Firehawke <Firehawke@users.noreply.github.com>2017-12-13 21:31:27 -0700
committer Firehawke <Firehawke@users.noreply.github.com>2017-12-13 21:31:27 -0700
commit9ece34eb218c5c1960468294c733fd00ac7fa696 (patch)
tree7160ed8d2cbe2127aaaef0a21f8736403b0f8a7c /src/emu/machine.cpp
parent54155441e9ba9941e85d80c4834a66376a11e791 (diff)
Revert "Revert "Merge branch 'master' of https://github.com/mamedev/mame""
This reverts commit 54155441e9ba9941e85d80c4834a66376a11e791.
Diffstat (limited to 'src/emu/machine.cpp')
-rw-r--r--src/emu/machine.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp
index fa6375ef937..f55bfb6c5ad 100644
--- a/src/emu/machine.cpp
+++ b/src/emu/machine.cpp
@@ -683,6 +683,42 @@ void running_machine::immediate_load(const char *filename)
//-------------------------------------------------
+// rewind_capture - capture and append a new
+// state to the rewind list
+//-------------------------------------------------
+
+void running_machine::rewind_capture()
+{
+ if (m_save.rewind()->enabled())
+ m_save.rewind()->capture();
+}
+
+
+//-------------------------------------------------
+// rewind_step - a single step back through
+// rewind states
+//-------------------------------------------------
+
+void running_machine::rewind_step()
+{
+ if (m_save.rewind()->enabled())
+ m_save.rewind()->step();
+}
+
+
+//-------------------------------------------------
+// rewind_invalidate - mark all the future rewind
+// states as invalid
+//-------------------------------------------------
+
+void running_machine::rewind_invalidate()
+{
+ if (m_save.rewind()->enabled())
+ m_save.rewind()->invalidate();
+}
+
+
+//-------------------------------------------------
// pause - pause the system
//-------------------------------------------------
@@ -721,7 +757,10 @@ void running_machine::resume()
void running_machine::toggle_pause()
{
if (paused())
+ {
+ rewind_invalidate();
resume();
+ }
else
pause();
}