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 else
// If bit 7 of VBlank is not set, read first, else second controller // If bit 7 of VBlank is not set, read first, else second controller
readFirst = !(mySystem.tia().registerValue(VBLANK) & 0x80); readFirst = !(mySystem.tia().registerValue(VBLANK) & 0x80);
cerr << mySystem.tia().dumpPortsCycles() << " "; cerr << mySystem.tia().dumpPortsCycles() << " ";
if(readFirst) if(readFirst)

View File

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