diff --git a/src/debugger/TIADebug.cxx b/src/debugger/TIADebug.cxx index 84fae67ec..6a6dd008d 100644 --- a/src/debugger/TIADebug.cxx +++ b/src/debugger/TIADebug.cxx @@ -691,7 +691,7 @@ void TIADebug::setENABLOld(bool b) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - int TIADebug::frameCount() const { - return myTIA.myFrameManager.frameCount(); + return myTIA.frameCount(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/tia/TIA.cxx b/src/emucore/tia/TIA.cxx index d1e925b2f..cb2c386da 100644 --- a/src/emucore/tia/TIA.cxx +++ b/src/emucore/tia/TIA.cxx @@ -813,18 +813,6 @@ bool TIA::enableColorLoss(bool enabled) return true; } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -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 { @@ -1628,4 +1616,4 @@ void TIA::setAccessFlags(uInt16 address, uInt8 flags) myAccessBase[address & TIA_READ_MASK] |= flags; } } -#endif // DEBUGGER_SUPPORT \ No newline at end of file +#endif // DEBUGGER_SUPPORT diff --git a/src/emucore/tia/TIA.hxx b/src/emucore/tia/TIA.hxx index 538aebaf2..7e388124a 100644 --- a/src/emucore/tia/TIA.hxx +++ b/src/emucore/tia/TIA.hxx @@ -38,6 +38,7 @@ #include "PaddleReader.hxx" #include "DelayQueueIterator.hxx" #include "Control.hxx" +#include "System.hxx" /** This class is a device that emulates the Television Interface Adaptor @@ -259,14 +260,21 @@ class TIA : public Device uInt32 scanlinesLastFrame() const { return myFrameManager.scanlinesLastFrame(); } /** - Answers the system cycles from the start of the current frame. + Answers the total system cycles from the start of the emulation. */ - uInt32 frameCycles() const; + uInt64 cycles() const { return uInt64(mySystem->cycles()); } /** - Answers the total system cycles from the start of the current ROM's emulation. + Answers the frame count from the start of the emulation. */ - uInt64 cycles() const; + uInt32 frameCount() const { return myFrameManager.frameCount(); } + + /** + Answers the system cycles from the start of the current frame. + */ + uInt32 frameCycles() const { + return uInt32(mySystem->cycles() - myCyclesAtFrameStart); + } /** Answers whether the TIA is currently in being rendered @@ -548,10 +556,10 @@ class TIA : public Device #ifdef DEBUGGER_SUPPORT void createAccessBase(); /** - Query/change the given address type to use the given disassembly flags + Query/change the given address type to use the given disassembly flags - @param address The address to modify - @param flags A bitfield of DisasmType directives for the given address + @param address The address to modify + @param flags A bitfield of DisasmType directives for the given address */ uInt8 getAccessFlags(uInt16 address) const override; void setAccessFlags(uInt16 address, uInt8 flags) override; @@ -729,7 +737,7 @@ class TIA : public Device uInt64 myCyclesAtFrameStart; #ifdef DEBUGGER_SUPPORT - // The arrays containing information about every byte of TIA + // The arrays containing information about every byte of TIA // indicating whether and how (RW) it is used. BytePtr myAccessBase; // The array used to skip the first two TIA access trackings