eliminated cycles() method in TIA.hxx

This commit is contained in:
thrust26 2024-12-29 12:14:52 +01:00
parent 9b1a72aeea
commit 42dda2b0cc
6 changed files with 11 additions and 16 deletions

View File

@ -114,7 +114,7 @@ bool RewindManager::addState(string_view message, bool timeMachine)
interval = interval * scanlines / 262;
}
if(myOSystem.console().tia().cycles() - lastState.cycles < interval)
if(myOSystem.console().system().cycles() - lastState.cycles < interval)
return false;
}
@ -135,7 +135,7 @@ bool RewindManager::addState(string_view message, bool timeMachine)
if(myStateManager.saveState(s) && myOSystem.console().tia().saveDisplay(s))
{
state.message = message;
state.cycles = myOSystem.console().tia().cycles();
state.cycles = myOSystem.console().system().cycles();
myLastTimeMachineAdd = timeMachine;
return true;
}
@ -145,7 +145,7 @@ bool RewindManager::addState(string_view message, bool timeMachine)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 RewindManager::rewindStates(uInt32 numStates)
{
const uInt64 startCycles = myOSystem.console().tia().cycles();
const uInt64 startCycles = myOSystem.console().system().cycles();
uInt32 i{0};
string message;
@ -185,7 +185,7 @@ uInt32 RewindManager::rewindStates(uInt32 numStates)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 RewindManager::unwindStates(uInt32 numStates)
{
const uInt64 startCycles = myOSystem.console().tia().cycles();
const uInt64 startCycles = myOSystem.console().system().cycles();
uInt32 i{0};
string message;

View File

@ -670,9 +670,9 @@ uInt16 Debugger::windStates(uInt16 numStates, bool unwind, string& message)
unlockSystem();
const uInt64 startCycles = myOSystem.console().tia().cycles();
const uInt64 startCycles = myOSystem.console().system().cycles();
const uInt16 winds = r.windStates(numStates, unwind);
message = r.getUnitString(myOSystem.console().tia().cycles() - startCycles);
message = r.getUnitString(myOSystem.console().system().cycles() - startCycles);
lockSystem();

View File

@ -927,13 +927,13 @@ int TIADebug::frameWsyncCycles() const
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int TIADebug::cyclesLo() const
{
return static_cast<int>(myTIA.cycles());
return static_cast<int>(mySystem.cycles());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int TIADebug::cyclesHi() const
{
return static_cast<int>(myTIA.cycles() >> 32);
return static_cast<int>(mySystem.cycles() >> 32);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -570,7 +570,7 @@ bool TIA::poke(uInt16 address, uInt8 value)
break;
case VSYNC:
myFrameManager->setVsync(value & 0x02, mySystem->cycles());
myFrameManager->setVsync(value & 0x02, myTimestamp / 3);
myShadowRegisters[address] = value;
break;
@ -1935,7 +1935,7 @@ void TIA::delayedWrite(uInt8 address, uInt8 value)
{
case VBLANK:
flushLineCache();
myFrameManager->setVblank(value & 0x02, mySystem->cycles());
myFrameManager->setVblank(value & 0x02, myTimestamp / 3);
break;
case HMOVE:

View File

@ -339,11 +339,6 @@ class TIA : public Device
*/
uInt32 frameBufferScanlinesLastFrame() const { return myFrameBufferScanlines; }
/**
Answers the total system cycles from the start of the emulation.
*/
uInt64 cycles() const { return mySystem->cycles(); }
#ifdef DEBUGGER_SUPPORT
/**
Answers the frame count from the start of the emulation.

View File

@ -529,7 +529,7 @@ void TimeMachineDialog::handleWinds(Int32 numWinds)
if(numWinds < 0) r.rewindStates(-numWinds);
else if(numWinds > 0) r.unwindStates(numWinds);
const uInt64 elapsed = instance().console().tia().cycles() - startCycles;
const uInt64 elapsed = instance().console().system().cycles() - startCycles;
if(elapsed > 0)
{
const string message = r.getUnitString(elapsed);