diff --git a/Todo.txt b/Todo.txt index 8580bdab7..8b20958c0 100644 --- a/Todo.txt +++ b/Todo.txt @@ -22,8 +22,6 @@ Stephen Anthony at stephena@users.sourceforge.net. * TIA infrastructure: improve emulation of writes to NUSIZx while graphics are currently being drawn. - * TIA infrastructure: fix incorrect VSYNC handling in Q-Bert. - * TIA infrastructure: add emulation of RSYNC instruction. * Look into adding Blargg NTSC filtering (perhaps as a GLSL program). @@ -64,10 +62,7 @@ Stephen Anthony at stephena@users.sourceforge.net. (2) Fix aliases not being followed correctly in the OSX port (although I suspect this isn't just an OSX issue). - (3) Add 'simpleUI/kiosk' mode to RMB context menu, which disables - all but the most basic functionality. - - (4) Add tabs to snapshot view; add cartridge snapshots as well. + (3) Add tabs to snapshot view; add cartridge snapshots as well. * More support for copy and paste. diff --git a/docs/debugger.html b/docs/debugger.html index 6edf62a59..d10a80d11 100644 --- a/docs/debugger.html +++ b/docs/debugger.html @@ -569,7 +569,7 @@ can also get rid of all traps at once with the "cleartraps" command.

break - Set/clear breakpoint at address (default: current pc) breakif - Set breakpoint on condition c - Carry Flag: set (to 0 or 1), or toggle (no arg) - cheetah - Use Cheetah cheat code (see http://members.cox.net/rcolbert/) + cheat - Use a cheat code (see Stella manual for cheat types) clearbreaks - Clear all breakpoints cleartraps - Clear all traps clearwatches - Clear all watches @@ -583,22 +583,21 @@ can also get rid of all traps at once with the "cleartraps" command.

exec - Execute script file frame - Advance emulation by xx frames (default=1) function - Define expression as a function for later use - height - Change height of debugger window help - This cruft + list - List source (if loaded with loadlist) listbreaks - List breakpoints listtraps - List traps listwatches - List watches - loadstate - Load emulator state (0-9) + loadlist - Load DASM listing file + loadstate - Load emulator state (0-9) loadsym - Load symbol file n - Negative Flag: set (to 0 or 1), or toggle (no arg) pc - Set Program Counter to address poke - Set address to value. Can give multiple values (for address+1, etc) print - Evaluate and print expression in hex/dec/binary ram - Show RAM contents (no args), or set address xx to value yy - reload - Reload ROM and symbol file reset - Reset 6507 to init vector (does not reset TIA, RIOT) + rewind - Rewind state to last step/trace/scanline/frame advance riot - Show RIOT timer/input status rom - Change ROM contents run - Exit debugger, return to emulator @@ -1003,15 +1002,17 @@ if the PC hits $D010, even though it shouldn't)

There are also buttons on the right that always show up no matter which tab you're looking at. These are always active. They are: Step, Trace, -Scan+1, Frame+1 and Exit.

+Scan+1, Frame+1 and Exit. The larger button to the left (labeled '<') +performs the rewind operation, which will undo the previous Step/Trace/Scan/Frame +advance. The rewind buffer is currently 100 levels deep.

When you use these buttons, the prompt doesn't change. This means the status lines with the registers and disassembly will be "stale". You can update them just by pressing Enter in the prompt.

-

You can also use the Step, Trace, Scan+1 and Frame+1 buttons from anywhere in -the GUI via the keyboard, with Alt-S, Alt-T, Alt-L and Alt-F.

+

You can also use the Step, Trace, Scan+1, Frame+1 and Rewind buttons from +anywhere in the GUI via the keyboard, with Alt-S, Alt-T, Alt-L, Alt-F and Alt-R.

diff --git a/docs/graphics/debugger_globalbuttons.png b/docs/graphics/debugger_globalbuttons.png index 53e594866..a2d81026d 100644 Binary files a/docs/graphics/debugger_globalbuttons.png and b/docs/graphics/debugger_globalbuttons.png differ diff --git a/docs/graphics/debugger_main.png b/docs/graphics/debugger_main.png index 946631064..adccf3c64 100644 Binary files a/docs/graphics/debugger_main.png and b/docs/graphics/debugger_main.png differ diff --git a/src/common/Version.hxx b/src/common/Version.hxx index 4269bc09e..a6b1a6e0a 100644 --- a/src/common/Version.hxx +++ b/src/common/Version.hxx @@ -19,7 +19,7 @@ #ifndef VERSION_HXX #define VERSION_HXX -#define STELLA_BASE_VERSION "3.0_svn" +#define STELLA_BASE_VERSION "3.0_alpha3" #ifdef NIGHTLY_BUILD #define STELLA_VERSION STELLA_BASE_VERSION "pre-" NIGHTLY_BUILD diff --git a/src/debugger/Debugger.cxx b/src/debugger/Debugger.cxx index 2d458ea53..3e832cb66 100644 --- a/src/debugger/Debugger.cxx +++ b/src/debugger/Debugger.cxx @@ -126,8 +126,6 @@ Debugger::Debugger(OSystem* osystem) myReadTraps = new PackedBitArray(0x10000); myWriteTraps = new PackedBitArray(0x10000); - myRewindManager = new RewindManager(*osystem); - // Allow access to this object from any class // Technically this violates pure OO programming, but since I know // there will only be ever one instance of debugger in Stella, @@ -169,6 +167,8 @@ void Debugger::initialize() myTiaZoom = dd->tiaZoom(); myRom = dd->rom(); myMessage = dd->message(); + + myRewindManager = new RewindManager(*myOSystem, *dd->rewindButton()); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -220,9 +220,6 @@ void Debugger::setConsole(Console* console) // Make sure cart RAM is added before this is called, // otherwise the debugger state won't know about it saveOldState(); - - // Empty the rewind list - myRewindManager->clear(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -764,7 +761,7 @@ void Debugger::saveOldState() myTiaDebug->saveOldState(); // Add another rewind level to the Undo list - myRewindManager->addState(); + if(myRewindManager) myRewindManager->addState(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -953,8 +950,9 @@ void Debugger::unlockBankswitchState() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Debugger::RewindManager::RewindManager(OSystem& system) +Debugger::RewindManager::RewindManager(OSystem& system, ButtonWidget& button) : myOSystem(system), + myRewindButton(button), mySize(0), myTop(0) { @@ -986,6 +984,7 @@ bool Debugger::RewindManager::addState() mySize++; if(mySize > MAX_SIZE) mySize = MAX_SIZE; myTop = (myTop + 1) % MAX_SIZE; + myRewindButton.setEnabled(true); return true; } } @@ -1004,6 +1003,10 @@ bool Debugger::RewindManager::rewindState() s.reset(); myOSystem.state().loadState(s); myOSystem.console().tia().loadDisplay(s); + + if(mySize == 0) + myRewindButton.setEnabled(false); + return true; } else @@ -1024,4 +1027,11 @@ void Debugger::RewindManager::clear() myStateList[i]->reset(); myTop = mySize = 0; + + // We use Widget::clearFlags here instead of Widget::setEnabled(), + // since the latter implies an immediate draw/update, but this method + // might be called before any UI exists + // TODO - fix this deficiency in the UI core; we shouldn't have to worry + // about such things at this level + myRewindButton.clearFlags(WIDGET_ENABLED); } diff --git a/src/debugger/Debugger.hxx b/src/debugger/Debugger.hxx index 9b0737d47..76f601cbd 100644 --- a/src/debugger/Debugger.hxx +++ b/src/debugger/Debugger.hxx @@ -409,7 +409,7 @@ class Debugger : public DialogContainer class RewindManager { public: - RewindManager(OSystem& system); + RewindManager(OSystem& system, ButtonWidget& button); virtual ~RewindManager(); public: @@ -421,6 +421,7 @@ class Debugger : public DialogContainer private: enum { MAX_SIZE = 100 }; OSystem& myOSystem; + ButtonWidget& myRewindButton; Serializer* myStateList[MAX_SIZE]; uInt32 mySize, myTop; }; diff --git a/src/debugger/DebuggerParser.cxx b/src/debugger/DebuggerParser.cxx index ed750bbad..fc87102e2 100644 --- a/src/debugger/DebuggerParser.cxx +++ b/src/debugger/DebuggerParser.cxx @@ -1566,7 +1566,7 @@ DebuggerParser::Command DebuggerParser::commands[kNumCommands] = { { "list", - "List source (if loaded with loadlst)", + "List source (if loaded with loadlist)", true, false, { kARG_WORD, kARG_END_ARGS }, diff --git a/src/debugger/gui/DebuggerDialog.cxx b/src/debugger/gui/DebuggerDialog.cxx index 22a5b65bf..66dfc6c79 100644 --- a/src/debugger/gui/DebuggerDialog.cxx +++ b/src/debugger/gui/DebuggerDialog.cxx @@ -251,12 +251,9 @@ void DebuggerDialog::addRomArea() DataGridOpsWidget* ops = new DataGridOpsWidget(this, instance().consoleFont(), xpos, 20); -ops->setFlags(WIDGET_BORDER); - - const int bwidth = instance().consoleFont().getStringWidth("Frame +1 "), - bheight = instance().consoleFont().getLineHeight() + 2; + int bwidth = instance().consoleFont().getStringWidth("Frame +1 "), + bheight = instance().consoleFont().getLineHeight() + 2; int buttonX = r.right - bwidth - 5, buttonY = r.top + 5; - new ButtonWidget(this, instance().consoleFont(), buttonX, buttonY, bwidth, bheight, "Step", kDDStepCmd); buttonY += bheight + 4; @@ -271,7 +268,15 @@ ops->setFlags(WIDGET_BORDER); buttonY += bheight + 4; new ButtonWidget(this, instance().consoleFont(), buttonX, buttonY, bwidth, bheight, "Exit", kDDExitCmd); - buttonY += bheight + 4; + + bwidth = instance().consoleFont().getStringWidth("< ") + 4; + bheight = bheight * 5 + 4*4; + buttonX -= (bwidth + 5); + buttonY = r.top + 5; + myRewindButton = + new ButtonWidget(this, instance().consoleFont(), buttonX, buttonY, + bwidth, bheight, "<", kDDRewindCmd); + myRewindButton->clearFlags(WIDGET_ENABLED); xpos = r.left + 10; ypos += myRam->getHeight() + 5; myRom = new RomWidget(this, instance().consoleFont(), xpos, ypos); diff --git a/src/debugger/gui/DebuggerDialog.hxx b/src/debugger/gui/DebuggerDialog.hxx index 5e2d70ee2..0f1c923e8 100644 --- a/src/debugger/gui/DebuggerDialog.hxx +++ b/src/debugger/gui/DebuggerDialog.hxx @@ -25,6 +25,7 @@ class Debugger; class OSystem; class DialogContainer; +class ButtonWidget; class CpuWidget; class RamWidget; class RomWidget; @@ -44,12 +45,13 @@ class DebuggerDialog : public Dialog int x, int y, int w, int h); ~DebuggerDialog(); - PromptWidget* prompt() { return myPrompt; } - TiaInfoWidget* tiaInfo() { return myTiaInfo; } - TiaOutputWidget* tiaOutput() { return myTiaOutput; } - TiaZoomWidget* tiaZoom() { return myTiaZoom; } - RomWidget* rom() { return myRom; } - EditTextWidget* message() { return myMessageBox; } + PromptWidget* prompt() { return myPrompt; } + TiaInfoWidget* tiaInfo() { return myTiaInfo; } + TiaOutputWidget* tiaOutput() { return myTiaOutput; } + TiaZoomWidget* tiaZoom() { return myTiaZoom; } + RomWidget* rom() { return myRom; } + EditTextWidget* message() { return myMessageBox; } + ButtonWidget* rewindButton() { return myRewindButton; } virtual void loadConfig(); virtual void handleKeyDown(int ascii, int keycode, int modifiers); @@ -66,6 +68,7 @@ class DebuggerDialog : public Dialog RamWidget* myRam; RomWidget* myRom; EditTextWidget* myMessageBox; + ButtonWidget* myRewindButton; private: void addTiaArea();