mirror of https://github.com/stella-emu/stella.git
Added button for rewind to the debugger, next to the buttons which it
applies to. Bumped version # to alpha3. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1860 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
28f347cf86
commit
ddc77bd7e7
7
Todo.txt
7
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.
|
||||
|
||||
|
|
|
@ -569,7 +569,7 @@ can also get rid of all traps at once with the "cleartraps" command.</p>
|
|||
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.</p>
|
|||
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)</li>
|
|||
|
||||
<p>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.</p>
|
||||
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.</p>
|
||||
<p><img src="graphics/debugger_globalbuttons.png"></p>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
<p>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.</p>
|
||||
<p>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.</p>
|
||||
|
||||
|
||||
<!-- ///////////////////////////////////////////////////////////////////////// -->
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 889 B After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 31 KiB |
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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 },
|
||||
|
|
|
@ -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 "),
|
||||
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);
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
class Debugger;
|
||||
class OSystem;
|
||||
class DialogContainer;
|
||||
class ButtonWidget;
|
||||
class CpuWidget;
|
||||
class RamWidget;
|
||||
class RomWidget;
|
||||
|
@ -50,6 +51,7 @@ class DebuggerDialog : public Dialog
|
|||
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();
|
||||
|
|
Loading…
Reference in New Issue