From ff4603d81f7dec9f84b70e821e4f27c3137a6df5 Mon Sep 17 00:00:00 2001 From: Markus Uhr Date: Mon, 13 Nov 2017 22:02:46 +0100 Subject: [PATCH] Bugfix: redraw TiaOutputWidget on savesnap when executing in a script. --- src/debugger/DebuggerParser.cxx | 7 +++++-- src/debugger/DebuggerParser.hxx | 2 ++ src/debugger/gui/TiaOutputWidget.cxx | 9 +++++++-- src/debugger/gui/TiaOutputWidget.hxx | 3 ++- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/debugger/DebuggerParser.cxx b/src/debugger/DebuggerParser.cxx index 8751f14af..f8401d0b9 100644 --- a/src/debugger/DebuggerParser.cxx +++ b/src/debugger/DebuggerParser.cxx @@ -58,7 +58,8 @@ using std::right; DebuggerParser::DebuggerParser(Debugger& d, Settings& s) : debugger(d), settings(s), - argCount(0) + argCount(0), + execDepth(0) { } @@ -1064,7 +1065,9 @@ void DebuggerParser::executeExec() file += ".script"; FilesystemNode node(debugger.myOSystem.defaultSaveDir() + file); + execDepth++; commandResult << exec(node); + execDepth--; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1695,7 +1698,7 @@ void DebuggerParser::executeSaveses() // "savesnap" void DebuggerParser::executeSavesnap() { - debugger.tiaOutput().saveSnapshot(); + debugger.tiaOutput().saveSnapshot(execDepth); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/debugger/DebuggerParser.hxx b/src/debugger/DebuggerParser.hxx index 3f1706b9d..ce3ca7599 100644 --- a/src/debugger/DebuggerParser.hxx +++ b/src/debugger/DebuggerParser.hxx @@ -123,6 +123,8 @@ class DebuggerParser StringList argStrings; uInt32 argCount; + uInt32 execDepth; + StringList myWatches; // Keep track of traps (read and/or write) diff --git a/src/debugger/gui/TiaOutputWidget.cxx b/src/debugger/gui/TiaOutputWidget.cxx index d2e73e851..60fd21652 100644 --- a/src/debugger/gui/TiaOutputWidget.cxx +++ b/src/debugger/gui/TiaOutputWidget.cxx @@ -58,8 +58,11 @@ void TiaOutputWidget::loadConfig() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void TiaOutputWidget::saveSnapshot() +void TiaOutputWidget::saveSnapshot(int execDepth) { + if (execDepth > 0) { + drawWidget(false); + } int number = int(instance().getTicks() / 1000); ostringstream sspath; sspath << instance().snapshotSaveDir() @@ -80,7 +83,9 @@ void TiaOutputWidget::saveSnapshot() { message = e.what(); } - instance().frameBuffer().showMessage(message); + if (execDepth == 0) { + instance().frameBuffer().showMessage(message); + } } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/debugger/gui/TiaOutputWidget.hxx b/src/debugger/gui/TiaOutputWidget.hxx index 5be537e91..0b755c329 100644 --- a/src/debugger/gui/TiaOutputWidget.hxx +++ b/src/debugger/gui/TiaOutputWidget.hxx @@ -36,7 +36,8 @@ class TiaOutputWidget : public Widget, public CommandSender void loadConfig() override; void setZoomWidget(TiaZoomWidget* w) { myZoom = w; } - void saveSnapshot(); + void saveSnapshot() { saveSnapshot(0); }; + void saveSnapshot(int execDepth); // Eventually, these methods will enable access to the onscreen TIA image // For example, clicking an area may cause an action