icount was missing from the savestates

When you load a state, icount (*icountptr) would remain whatever it was before loading, messing with the remaining cycles and with the amount of code executed per run() call. This introduced non-determinism and badly influenced usage of savestates while debugging. machine().time() would also return wrong values after that, since it adds remaining cycles.
This commit is contained in:
vadosnaprimer 2017-12-06 18:48:21 +03:00
parent a66cb36cc7
commit a88483233d

View File

@ -499,6 +499,7 @@ void device_execute_interface::interface_post_start()
assert_always(m_icountptr != nullptr, "m_icountptr never initialized!");
// register for save states
device().save_pointer(NAME(m_icountptr), 1);
device().save_item(NAME(m_suspend));
device().save_item(NAME(m_nextsuspend));
device().save_item(NAME(m_eatcycles));