C64: Give BA/IRQ counting another go, seems to resolve many issues

This commit is contained in:
SaxxonPike 2019-07-13 16:51:30 -05:00
parent db38d5e65b
commit 154eefd2ad
3 changed files with 7 additions and 4 deletions

View File

@ -137,7 +137,10 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
case 0x0001:
return PortData;
default:
return ReadAec() ? ReadMemory(addr) : ReadBus();
if (ReadAec())
return ReadMemory(addr);
else
return ReadBus();
}
}

View File

@ -72,7 +72,7 @@
if (_badline)
{
_parseAddr = _pointerVm | _vc;
_dataC = ReadMemory(_parseAddr);
_dataC = _baCount >= 0 ? 0xFF : ReadMemory(_parseAddr);
_dataC |= (ReadColorRam(_parseAddr) & 0xF) << 8;
_bufferC[_vmli] = _dataC;
}

View File

@ -320,7 +320,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
{
if (_ba)
_baCount = BaResetCounter;
else if (_baCount > 0)
else if (_baCount >= 0)
_baCount--;
}
@ -343,7 +343,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
// IRQ buffer is treated as a delay line
_irqBuffer >>= 1;
_irqBuffer |= irqTemp ? 0x8 : 0;
_pinAec = _ba || _baCount > 0;
_pinAec = _ba || _baCount >= 0;
_pinBa = _ba;
}