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
|
* TIA infrastructure: improve emulation of writes to NUSIZx while graphics
|
||||||
are currently being drawn.
|
are currently being drawn.
|
||||||
|
|
||||||
* TIA infrastructure: fix incorrect VSYNC handling in Q-Bert.
|
|
||||||
|
|
||||||
* TIA infrastructure: add emulation of RSYNC instruction.
|
* TIA infrastructure: add emulation of RSYNC instruction.
|
||||||
|
|
||||||
* Look into adding Blargg NTSC filtering (perhaps as a GLSL program).
|
* 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
|
(2) Fix aliases not being followed correctly in the OSX port
|
||||||
(although I suspect this isn't just an OSX issue).
|
(although I suspect this isn't just an OSX issue).
|
||||||
|
|
||||||
(3) Add 'simpleUI/kiosk' mode to RMB context menu, which disables
|
(3) Add tabs to snapshot view; add cartridge snapshots as well.
|
||||||
all but the most basic functionality.
|
|
||||||
|
|
||||||
(4) Add tabs to snapshot view; add cartridge snapshots as well.
|
|
||||||
|
|
||||||
* More support for copy and paste.
|
* 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)
|
break - Set/clear breakpoint at address (default: current pc)
|
||||||
breakif - Set breakpoint on condition
|
breakif - Set breakpoint on condition
|
||||||
c - Carry Flag: set (to 0 or 1), or toggle (no arg)
|
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
|
clearbreaks - Clear all breakpoints
|
||||||
cleartraps - Clear all traps
|
cleartraps - Clear all traps
|
||||||
clearwatches - Clear all watches
|
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
|
exec - Execute script file
|
||||||
frame - Advance emulation by xx frames (default=1)
|
frame - Advance emulation by xx frames (default=1)
|
||||||
function - Define expression as a function for later use
|
function - Define expression as a function for later use
|
||||||
height - Change height of debugger window
|
|
||||||
help - This cruft
|
help - This cruft
|
||||||
+ list - List source (if loaded with loadlist)
|
+ list - List source (if loaded with loadlist)
|
||||||
listbreaks - List breakpoints
|
listbreaks - List breakpoints
|
||||||
listtraps - List traps
|
listtraps - List traps
|
||||||
listwatches - List watches
|
listwatches - List watches
|
||||||
loadstate - Load emulator state (0-9)
|
|
||||||
+ loadlist - Load DASM listing file
|
+ loadlist - Load DASM listing file
|
||||||
|
loadstate - Load emulator state (0-9)
|
||||||
loadsym - Load symbol file
|
loadsym - Load symbol file
|
||||||
n - Negative Flag: set (to 0 or 1), or toggle (no arg)
|
n - Negative Flag: set (to 0 or 1), or toggle (no arg)
|
||||||
pc - Set Program Counter to address
|
pc - Set Program Counter to address
|
||||||
poke - Set address to value. Can give multiple values (for address+1, etc)
|
poke - Set address to value. Can give multiple values (for address+1, etc)
|
||||||
print - Evaluate and print expression in hex/dec/binary
|
print - Evaluate and print expression in hex/dec/binary
|
||||||
ram - Show RAM contents (no args), or set address xx to value yy
|
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)
|
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
|
riot - Show RIOT timer/input status
|
||||||
rom - Change ROM contents
|
rom - Change ROM contents
|
||||||
run - Exit debugger, return to emulator
|
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
|
<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,
|
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><img src="graphics/debugger_globalbuttons.png"></p>
|
||||||
|
|
||||||
<p>When you use these buttons, the prompt doesn't change. This means the
|
<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
|
status lines with the registers and disassembly will be "stale". You
|
||||||
can update them just by pressing Enter in the prompt.</p>
|
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
|
<p>You can also use the Step, Trace, Scan+1, Frame+1 and Rewind buttons from
|
||||||
the GUI via the keyboard, with Alt-S, Alt-T, Alt-L and Alt-F.</p>
|
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
|
#ifndef VERSION_HXX
|
||||||
#define VERSION_HXX
|
#define VERSION_HXX
|
||||||
|
|
||||||
#define STELLA_BASE_VERSION "3.0_svn"
|
#define STELLA_BASE_VERSION "3.0_alpha3"
|
||||||
|
|
||||||
#ifdef NIGHTLY_BUILD
|
#ifdef NIGHTLY_BUILD
|
||||||
#define STELLA_VERSION STELLA_BASE_VERSION "pre-" NIGHTLY_BUILD
|
#define STELLA_VERSION STELLA_BASE_VERSION "pre-" NIGHTLY_BUILD
|
||||||
|
|
|
@ -126,8 +126,6 @@ Debugger::Debugger(OSystem* osystem)
|
||||||
myReadTraps = new PackedBitArray(0x10000);
|
myReadTraps = new PackedBitArray(0x10000);
|
||||||
myWriteTraps = new PackedBitArray(0x10000);
|
myWriteTraps = new PackedBitArray(0x10000);
|
||||||
|
|
||||||
myRewindManager = new RewindManager(*osystem);
|
|
||||||
|
|
||||||
// Allow access to this object from any class
|
// Allow access to this object from any class
|
||||||
// Technically this violates pure OO programming, but since I know
|
// Technically this violates pure OO programming, but since I know
|
||||||
// there will only be ever one instance of debugger in Stella,
|
// there will only be ever one instance of debugger in Stella,
|
||||||
|
@ -169,6 +167,8 @@ void Debugger::initialize()
|
||||||
myTiaZoom = dd->tiaZoom();
|
myTiaZoom = dd->tiaZoom();
|
||||||
myRom = dd->rom();
|
myRom = dd->rom();
|
||||||
myMessage = dd->message();
|
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,
|
// Make sure cart RAM is added before this is called,
|
||||||
// otherwise the debugger state won't know about it
|
// otherwise the debugger state won't know about it
|
||||||
saveOldState();
|
saveOldState();
|
||||||
|
|
||||||
// Empty the rewind list
|
|
||||||
myRewindManager->clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -764,7 +761,7 @@ void Debugger::saveOldState()
|
||||||
myTiaDebug->saveOldState();
|
myTiaDebug->saveOldState();
|
||||||
|
|
||||||
// Add another rewind level to the Undo list
|
// 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),
|
: myOSystem(system),
|
||||||
|
myRewindButton(button),
|
||||||
mySize(0),
|
mySize(0),
|
||||||
myTop(0)
|
myTop(0)
|
||||||
{
|
{
|
||||||
|
@ -986,6 +984,7 @@ bool Debugger::RewindManager::addState()
|
||||||
mySize++; if(mySize > MAX_SIZE) mySize = MAX_SIZE;
|
mySize++; if(mySize > MAX_SIZE) mySize = MAX_SIZE;
|
||||||
|
|
||||||
myTop = (myTop + 1) % MAX_SIZE;
|
myTop = (myTop + 1) % MAX_SIZE;
|
||||||
|
myRewindButton.setEnabled(true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1004,6 +1003,10 @@ bool Debugger::RewindManager::rewindState()
|
||||||
s.reset();
|
s.reset();
|
||||||
myOSystem.state().loadState(s);
|
myOSystem.state().loadState(s);
|
||||||
myOSystem.console().tia().loadDisplay(s);
|
myOSystem.console().tia().loadDisplay(s);
|
||||||
|
|
||||||
|
if(mySize == 0)
|
||||||
|
myRewindButton.setEnabled(false);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1024,4 +1027,11 @@ void Debugger::RewindManager::clear()
|
||||||
myStateList[i]->reset();
|
myStateList[i]->reset();
|
||||||
|
|
||||||
myTop = mySize = 0;
|
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
|
class RewindManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RewindManager(OSystem& system);
|
RewindManager(OSystem& system, ButtonWidget& button);
|
||||||
virtual ~RewindManager();
|
virtual ~RewindManager();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -421,6 +421,7 @@ class Debugger : public DialogContainer
|
||||||
private:
|
private:
|
||||||
enum { MAX_SIZE = 100 };
|
enum { MAX_SIZE = 100 };
|
||||||
OSystem& myOSystem;
|
OSystem& myOSystem;
|
||||||
|
ButtonWidget& myRewindButton;
|
||||||
Serializer* myStateList[MAX_SIZE];
|
Serializer* myStateList[MAX_SIZE];
|
||||||
uInt32 mySize, myTop;
|
uInt32 mySize, myTop;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1566,7 +1566,7 @@ DebuggerParser::Command DebuggerParser::commands[kNumCommands] = {
|
||||||
|
|
||||||
{
|
{
|
||||||
"list",
|
"list",
|
||||||
"List source (if loaded with loadlst)",
|
"List source (if loaded with loadlist)",
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
{ kARG_WORD, kARG_END_ARGS },
|
{ kARG_WORD, kARG_END_ARGS },
|
||||||
|
|
|
@ -251,12 +251,9 @@ void DebuggerDialog::addRomArea()
|
||||||
DataGridOpsWidget* ops = new DataGridOpsWidget(this, instance().consoleFont(),
|
DataGridOpsWidget* ops = new DataGridOpsWidget(this, instance().consoleFont(),
|
||||||
xpos, 20);
|
xpos, 20);
|
||||||
|
|
||||||
ops->setFlags(WIDGET_BORDER);
|
int bwidth = instance().consoleFont().getStringWidth("Frame +1 "),
|
||||||
|
bheight = instance().consoleFont().getLineHeight() + 2;
|
||||||
const int bwidth = instance().consoleFont().getStringWidth("Frame +1 "),
|
|
||||||
bheight = instance().consoleFont().getLineHeight() + 2;
|
|
||||||
int buttonX = r.right - bwidth - 5, buttonY = r.top + 5;
|
int buttonX = r.right - bwidth - 5, buttonY = r.top + 5;
|
||||||
|
|
||||||
new ButtonWidget(this, instance().consoleFont(), buttonX, buttonY,
|
new ButtonWidget(this, instance().consoleFont(), buttonX, buttonY,
|
||||||
bwidth, bheight, "Step", kDDStepCmd);
|
bwidth, bheight, "Step", kDDStepCmd);
|
||||||
buttonY += bheight + 4;
|
buttonY += bheight + 4;
|
||||||
|
@ -271,7 +268,15 @@ ops->setFlags(WIDGET_BORDER);
|
||||||
buttonY += bheight + 4;
|
buttonY += bheight + 4;
|
||||||
new ButtonWidget(this, instance().consoleFont(), buttonX, buttonY,
|
new ButtonWidget(this, instance().consoleFont(), buttonX, buttonY,
|
||||||
bwidth, bheight, "Exit", kDDExitCmd);
|
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;
|
xpos = r.left + 10; ypos += myRam->getHeight() + 5;
|
||||||
myRom = new RomWidget(this, instance().consoleFont(), xpos, ypos);
|
myRom = new RomWidget(this, instance().consoleFont(), xpos, ypos);
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
class Debugger;
|
class Debugger;
|
||||||
class OSystem;
|
class OSystem;
|
||||||
class DialogContainer;
|
class DialogContainer;
|
||||||
|
class ButtonWidget;
|
||||||
class CpuWidget;
|
class CpuWidget;
|
||||||
class RamWidget;
|
class RamWidget;
|
||||||
class RomWidget;
|
class RomWidget;
|
||||||
|
@ -44,12 +45,13 @@ class DebuggerDialog : public Dialog
|
||||||
int x, int y, int w, int h);
|
int x, int y, int w, int h);
|
||||||
~DebuggerDialog();
|
~DebuggerDialog();
|
||||||
|
|
||||||
PromptWidget* prompt() { return myPrompt; }
|
PromptWidget* prompt() { return myPrompt; }
|
||||||
TiaInfoWidget* tiaInfo() { return myTiaInfo; }
|
TiaInfoWidget* tiaInfo() { return myTiaInfo; }
|
||||||
TiaOutputWidget* tiaOutput() { return myTiaOutput; }
|
TiaOutputWidget* tiaOutput() { return myTiaOutput; }
|
||||||
TiaZoomWidget* tiaZoom() { return myTiaZoom; }
|
TiaZoomWidget* tiaZoom() { return myTiaZoom; }
|
||||||
RomWidget* rom() { return myRom; }
|
RomWidget* rom() { return myRom; }
|
||||||
EditTextWidget* message() { return myMessageBox; }
|
EditTextWidget* message() { return myMessageBox; }
|
||||||
|
ButtonWidget* rewindButton() { return myRewindButton; }
|
||||||
|
|
||||||
virtual void loadConfig();
|
virtual void loadConfig();
|
||||||
virtual void handleKeyDown(int ascii, int keycode, int modifiers);
|
virtual void handleKeyDown(int ascii, int keycode, int modifiers);
|
||||||
|
@ -66,6 +68,7 @@ class DebuggerDialog : public Dialog
|
||||||
RamWidget* myRam;
|
RamWidget* myRam;
|
||||||
RomWidget* myRom;
|
RomWidget* myRom;
|
||||||
EditTextWidget* myMessageBox;
|
EditTextWidget* myMessageBox;
|
||||||
|
ButtonWidget* myRewindButton;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void addTiaArea();
|
void addTiaArea();
|
||||||
|
|
Loading…
Reference in New Issue