pseudo-op "_scycles" (cycles into current scanline) added

This commit is contained in:
thrust26 2017-10-12 21:08:24 +02:00
parent 3045a0ddf7
commit 53d4745479
5 changed files with 11 additions and 1 deletions

View File

@ -732,6 +732,7 @@ Debugger::PseudoRegister Debugger::ourPseudoRegisters[NUM_PSEUDO_REGS] = {
{ "_cyclesHi", "Higher 32 bits of number of cycles since emulation started"},
{ "_rwport", "Address at which a read from a write port occurred" },
{ "_scan", "Current scanline count" },
{ "_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)" }
// CPU address access functions:

View File

@ -322,7 +322,7 @@ class Debugger : public DialogContainer
string name, help;
};
static const uInt32 NUM_BUILTIN_FUNCS = 18;
static const uInt32 NUM_PSEUDO_REGS = 10;
static const uInt32 NUM_PSEUDO_REGS = 11;
static BuiltinFunction ourBuiltinFunctions[NUM_BUILTIN_FUNCS];
static PseudoRegister ourPseudoRegisters[NUM_PSEUDO_REGS];

View File

@ -730,6 +730,12 @@ int TIADebug::clocksThisLine() const
return myTIA.clocksThisLine();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int TIADebug::cyclesThisLine() const
{
return myTIA.clocksThisLine()/3;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIADebug::vsync() const
{

View File

@ -163,6 +163,7 @@ class TIADebug : public DebuggerSystem
int cyclesLo() const;
int cyclesHi() const;
int clocksThisLine() const;
int cyclesThisLine() const;
bool vsync() const;
bool vblank() const;
int vsyncAsInt() const { return int(vsync()); } // so we can use _vsync pseudo-register

View File

@ -229,6 +229,8 @@ TiaMethod getTiaSpecial(char* ch)
{
if(BSPF::equalsIgnoreCase(ch, "_scan"))
return &TIADebug::scanlines;
if(BSPF::equalsIgnoreCase(ch, "_scycles"))
return &TIADebug::cyclesThisLine;
else if(BSPF::equalsIgnoreCase(ch, "_fcount"))
return &TIADebug::frameCount;
else if(BSPF::equalsIgnoreCase(ch, "_fcycles"))