added _cyclesLo and _cyclesHi to debugger prompt

This commit is contained in:
thrust26 2017-09-19 20:49:48 +02:00
parent aed2945a56
commit ba764fdc06
6 changed files with 31 additions and 0 deletions

View File

@ -99,6 +99,8 @@ static const char* const pseudo_registers[][2] = {
{ "_cclocks", "Color clocks on current scanline" },
{ "_fcount", "Number of frames since emulation started" },
{ "_fcycles", "Number of cycles since frame started" },
{ "_cyclesLo", "Lower 32 bits of number of cycles since emulation started"},
{ "_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" },
{ "_vblank", "Whether vertical blank is enabled (1 or 0)" },

View File

@ -700,6 +700,18 @@ int TIADebug::frameCycles() const
return myTIA.frameCycles();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int TIADebug::cyclesLo() const
{
return (int)myTIA.cycles();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int TIADebug::cyclesHi() const
{
return (int)(myTIA.cycles() >> 32);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int TIADebug::scanlines() const
{

View File

@ -160,6 +160,8 @@ class TIADebug : public DebuggerSystem
int scanlinesLastFrame() const;
int frameCount() const;
int frameCycles() const;
int cyclesLo() const;
int cyclesHi() const;
int clocksThisLine() const;
bool vsync() const;
bool vblank() const;

View File

@ -819,6 +819,12 @@ uInt32 TIA::frameCycles() const
return uInt32(mySystem->cycles() - myCyclesAtFrameStart);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt64 TIA::cycles() const
{
return uInt64(mySystem->cycles());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool TIA::electronBeamPos(uInt32& x, uInt32& y) const
{

View File

@ -263,6 +263,11 @@ class TIA : public Device
*/
uInt32 frameCycles() const;
/**
Answers the total system cycles from the start of the current ROM's emulation.
*/
uInt64 cycles() const;
/**
Answers whether the TIA is currently in being rendered
(we're in between the start and end of drawing a frame).

View File

@ -219,6 +219,10 @@ TiaMethod getTiaSpecial(char* ch)
return &TIADebug::frameCount;
else if(BSPF::equalsIgnoreCase(ch, "_fcycles"))
return &TIADebug::frameCycles;
else if(BSPF::equalsIgnoreCase(ch, "_cyclesLo"))
return &TIADebug::cyclesLo;
else if(BSPF::equalsIgnoreCase(ch, "_cyclesHi"))
return &TIADebug::cyclesHi;
else if(BSPF::equalsIgnoreCase(ch, "_cclocks"))
return &TIADebug::clocksThisLine;
else if(BSPF::equalsIgnoreCase(ch, "_vsync"))