Added '_scanend' pseudo-register to track scanlines at end of last frame. Fixes #624.

This commit is contained in:
Stephen Anthony 2020-05-04 14:19:02 -02:30
parent a2e5204835
commit f3f0617940
5 changed files with 11 additions and 4 deletions

View File

@ -40,6 +40,9 @@
* Removed unused CV+ and DASH bank switching types.
* Added debugger pseudo-register '_scanend', which gives the number of
scanlines at the end of the last frame.
-Have fun!

View File

@ -755,6 +755,7 @@ that holds 'number of scanlines' on an actual console).</p>
<tr><td> _fcycles</td><td> Number of cycles since frame started</td></tr>
<tr><td> _icycles</td><td> Number of cycles of last instruction</td></tr>
<tr><td> _scan</td><td> Current scanline count</td></tr>
<tr><td> _scanend</td><td> Scanline count at end of last frame</td></tr>
<tr><td> _scycles</td><td> Number of cycles in current scanline</td></tr>
<tr><td> _vblank</td><td> Whether vertical blank is enabled (1 or 0)</td></tr>
<tr><td> _vsync</td><td> Whether vertical sync is enabled (1 or 0)</td></tr>

View File

@ -875,7 +875,7 @@ std::array<Debugger::BuiltinFunction, 18> Debugger::ourBuiltinFunctions = { {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Names are defined here, but processed in YaccParser
std::array<Debugger::PseudoRegister, 11> Debugger::ourPseudoRegisters = { {
std::array<Debugger::PseudoRegister, 12> Debugger::ourPseudoRegisters = { {
// Debugger::PseudoRegister Debugger::ourPseudoRegisters[NUM_PSEUDO_REGS] = {
{ "_bank", "Currently selected bank" },
{ "_cclocks", "Color clocks on current scanline" },
@ -883,8 +883,9 @@ std::array<Debugger::PseudoRegister, 11> Debugger::ourPseudoRegisters = { {
{ "_cycleslo", "Lower 32 bits of number of cycles since emulation started" },
{ "_fcount", "Number of frames since emulation started" },
{ "_fcycles", "Number of cycles since frame started" },
{ "_icycles", "Number of cycles of last instruction" },
{ "_icycles", "Number of cycles of last instruction" },
{ "_scan", "Current scanline count" },
{ "_scanend", "Scanline count at end of last frame" },
{ "_scycles", "Number of cycles in current scanline" },
{ "_vblank", "Whether vertical blank is enabled (1 or 0)" },
{ "_vsync", "Whether vertical sync is enabled (1 or 0)" }

View File

@ -363,7 +363,7 @@ class Debugger : public DialogContainer
string name, help;
};
static std::array<BuiltinFunction, 18> ourBuiltinFunctions;
static std::array<PseudoRegister, 11> ourPseudoRegisters;
static std::array<PseudoRegister, 12> ourPseudoRegisters;
private:
// rewind/unwind n states

View File

@ -234,7 +234,9 @@ TiaMethod getTiaSpecial(char* ch)
{
if(BSPF::equalsIgnoreCase(ch, "_scan"))
return &TIADebug::scanlines;
if(BSPF::equalsIgnoreCase(ch, "_scycles"))
else if(BSPF::equalsIgnoreCase(ch, "_scanend"))
return &TIADebug::scanlinesLastFrame;
else if(BSPF::equalsIgnoreCase(ch, "_scycles"))
return &TIADebug::cyclesThisLine;
else if(BSPF::equalsIgnoreCase(ch, "_fcount"))
return &TIADebug::frameCount;