WSYNC should only work when the last access was a read.

This commit is contained in:
Stephen Anthony 2016-12-19 15:56:26 -03:30
parent 07287fe761
commit a6bc247852
1 changed files with 9 additions and 3 deletions

View File

@ -347,9 +347,15 @@ bool TIA::poke(uInt16 address, uInt8 value)
switch (address) switch (address)
{ {
case WSYNC: case WSYNC:
mySubClock += (228 - myHctr) % 228; // It appears that the 6507 only halts during a read cycle so
mySystem->incrementCycles(mySubClock / 3); // we test here for follow-on writes which should be ignored as
mySubClock %= 3; // far as halting the processor is concerned.
if (mySystem->m6502().lastAccessWasRead())
{
mySubClock += (228 - myHctr) % 228;
mySystem->incrementCycles(mySubClock / 3);
mySubClock %= 3;
}
break; break;
case VSYNC: case VSYNC: