C64: Raster IRQ is edge triggered, how'd I miss this?
This commit is contained in:
parent
92eb569b12
commit
ac52d0e5f6
|
@ -85,11 +85,11 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
|
|||
|
||||
public void ExecutePhase()
|
||||
{
|
||||
_cpu.RDY = ReadRdy();
|
||||
_irqDelay >>= 1;
|
||||
_nmiDelay >>= 1;
|
||||
_irqDelay |= ReadIrq() ? 0x0 : 0x2;
|
||||
_nmiDelay |= ReadNmi() ? 0x0 : 0x2;
|
||||
_cpu.RDY = ReadRdy();
|
||||
_cpu.IRQ = (_irqDelay & 1) != 0;
|
||||
_cpu.NMI |= (_nmiDelay & 3) == 2;
|
||||
_cpu.ExecuteOne();
|
||||
|
|
|
@ -50,6 +50,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
|
|||
private int _pointerCb;
|
||||
private int _pointerVm;
|
||||
private int _rasterInterruptLine;
|
||||
private bool _rasterInterruptTriggered;
|
||||
private int _rasterLine;
|
||||
private int _rasterX;
|
||||
private bool _rasterXHold;
|
||||
|
|
|
@ -220,6 +220,9 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
|
|||
_vc = 0;
|
||||
_refreshCounter = 0xFF;
|
||||
}
|
||||
|
||||
if (_rasterLine == BadLineDisableRaster)
|
||||
_badlineEnable = false;
|
||||
}
|
||||
|
||||
// bg collision clear
|
||||
|
@ -242,17 +245,15 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
|
|||
_spriteSpriteCollisionClearPending = false;
|
||||
}
|
||||
|
||||
// start of rasterline
|
||||
if ((_cycle == RasterIrqLineXCycle && _rasterLine > 0) || (_cycle == RasterIrqLine0Cycle && _rasterLine == 0))
|
||||
// raster IRQ is edge triggered
|
||||
if (_rasterInterruptLine != _rasterLine)
|
||||
{
|
||||
if (_rasterLine == BadLineDisableRaster)
|
||||
_badlineEnable = false;
|
||||
|
||||
// raster compares are done here
|
||||
if (_rasterLine == _rasterInterruptLine)
|
||||
{
|
||||
_intRaster = true;
|
||||
}
|
||||
_rasterInterruptTriggered = false;
|
||||
}
|
||||
else if (!_rasterInterruptTriggered)
|
||||
{
|
||||
_intRaster = true;
|
||||
_rasterInterruptTriggered = true;
|
||||
}
|
||||
|
||||
// render
|
||||
|
|
Loading…
Reference in New Issue