From 0fa706c558e975a43b31fc7eb5f7ad3a7b052415 Mon Sep 17 00:00:00 2001 From: stephena Date: Sat, 21 Aug 2010 21:05:12 +0000 Subject: [PATCH] Fixed bug in debugger rewind states are reported in the Stella tracker. It seems that bankswitching wasn't being enabled before rewinding, and hence any bankswitching being done on state load was being ignored. This also affected the loadstate and savestate debugger commands, which weren't working for exactly the same reason. Bumped version # for impending point release. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2107 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- src/common/Version.hxx | 2 +- src/debugger/Debugger.cxx | 16 +++++++++++++++- src/debugger/DebuggerParser.cxx | 6 ------ src/debugger/gui/PromptWidget.cxx | 2 +- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/common/Version.hxx b/src/common/Version.hxx index 841e44846..d39f8e464 100644 --- a/src/common/Version.hxx +++ b/src/common/Version.hxx @@ -22,7 +22,7 @@ #include -#define STELLA_VERSION "3.2" +#define STELLA_VERSION "3.2.1_pre" #define STELLA_BUILD atoi("$Rev$" + 6) #endif diff --git a/src/debugger/Debugger.cxx b/src/debugger/Debugger.cxx index 6fccbe6be..4fb88d341 100644 --- a/src/debugger/Debugger.cxx +++ b/src/debugger/Debugger.cxx @@ -374,13 +374,21 @@ const string Debugger::setRAM(IntArray& args) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Debugger::saveState(int state) { + mySystem->clearDirtyPages(); + + unlockBankswitchState(); myOSystem->state().saveState(state); + lockBankswitchState(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Debugger::loadState(int state) { + mySystem->clearDirtyPages(); + + unlockBankswitchState(); myOSystem->state().loadState(state); + lockBankswitchState(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -528,7 +536,13 @@ void Debugger::nextFrame(int frames) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool Debugger::rewindState() { - return myRewindManager->rewindState(); + mySystem->clearDirtyPages(); + + unlockBankswitchState(); + bool result = myRewindManager->rewindState(); + lockBankswitchState(); + + return result; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/debugger/DebuggerParser.cxx b/src/debugger/DebuggerParser.cxx index ba5008e56..9e8317d2c 100644 --- a/src/debugger/DebuggerParser.cxx +++ b/src/debugger/DebuggerParser.cxx @@ -1026,10 +1026,7 @@ void DebuggerParser::executeListtraps() void DebuggerParser::executeLoadstate() { if(args[0] >= 0 && args[0] <= 9) - { debugger->loadState(args[0]); - commandResult << "state loaded"; - } else commandResult << red("invalid slot (must be 0-9)"); } @@ -1257,10 +1254,7 @@ void DebuggerParser::executeSaveses() void DebuggerParser::executeSavestate() { if(args[0] >= 0 && args[0] <= 9) - { debugger->saveState(args[0]); - commandResult << "state saved"; - } else commandResult << red("invalid slot (must be 0-9)"); } diff --git a/src/debugger/gui/PromptWidget.cxx b/src/debugger/gui/PromptWidget.cxx index 6a554addb..0dbc9fae5 100644 --- a/src/debugger/gui/PromptWidget.cxx +++ b/src/debugger/gui/PromptWidget.cxx @@ -179,7 +179,7 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers) _exitedEarly = true; return true; } - else + else if(result != "") print(result + "\n"); }