using delayed updates and System::cycles for QT timing now

This commit is contained in:
thrust26 2021-02-06 09:31:13 +01:00
parent 783b30d78a
commit e97529e355
2 changed files with 5 additions and 6 deletions

View File

@ -122,6 +122,7 @@ bool QuadTari::read(DigitalPin pin)
else
// If bit 7 of VBlank is not set, read first, else second controller
readFirst = !(mySystem.tia().registerValue(VBLANK) & 0x80);
cerr << mySystem.tia().dumpPortsCycles() << " ";
if(readFirst)

View File

@ -533,7 +533,7 @@ bool TIA::poke(uInt16 address, uInt8 value)
for (PaddleReader& paddleReader : myPaddleReaders)
paddleReader.vblank(value, myTimestamp);
updateDumpPorts(value);
//updateDumpPorts(value);
myDelayQueue.push(VBLANK, value, Delay::vblank);
@ -1688,7 +1688,7 @@ void TIA::delayedWrite(uInt8 address, uInt8 value)
case VBLANK:
flushLineCache();
myFrameManager->setVblank(value & 0x02);
//updateDumpPorts(value);
updateDumpPorts(value);
break;
case HMOVE:
@ -2010,16 +2010,14 @@ void TIA::updateDumpPorts(uInt8 value)
if(myArePortsDumped != newIsDumped)
{
myArePortsDumped = newIsDumped;
myDumpPortsTimestamp = myTimestamp;
//myDumpPortsTimestamp = mySystem->cycles();
myDumpPortsTimestamp = mySystem->cycles();
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Int64 TIA::dumpPortsCycles()
{
return (myTimestamp - myDumpPortsTimestamp) / 3;
//return mySystem->cycles() - myDumpPortsTimestamp;
return mySystem->cycles() - myDumpPortsTimestamp;
}
#ifdef DEBUGGER_SUPPORT