From 73beb8cb40194f203aa5a9936f0e0022275d26fe Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sat, 25 Mar 2017 19:32:58 -0230 Subject: [PATCH] Re-enabled TIA::saveDisplay() and TIA::loadDisplay(). This means the debugger rewind feature is working again. More testing is required to make sure this is the same as Stella 4.x functionality. --- src/emucore/tia/TIA.cxx | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/src/emucore/tia/TIA.cxx b/src/emucore/tia/TIA.cxx index 411396e1c..837596e93 100644 --- a/src/emucore/tia/TIA.cxx +++ b/src/emucore/tia/TIA.cxx @@ -710,17 +710,38 @@ bool TIA::poke(uInt16 address, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// TODO: stub bool TIA::saveDisplay(Serializer& out) const { - return false; + try + { + out.putByteArray(myCurrentFrameBuffer.get(), 160*320); + } + catch(...) + { + cerr << "ERROR: TIA::saveDisplay" << endl; + return false; + } + + return true; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// TODO: stub bool TIA::loadDisplay(Serializer& in) { - return false; + try + { + // Reset frame buffer pointer and data + clearBuffers(); + in.getByteArray(myCurrentFrameBuffer.get(), 160*320); + memcpy(myPreviousFrameBuffer.get(), myCurrentFrameBuffer.get(), 160*320); + } + catch(...) + { + cerr << "ERROR: TIA::loadDisplay" << endl; + return false; + } + + return true; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -