PPU: $4200 writes should immediately trigger an IRQ on the current scanline if horizontal IRQs are disabled (fixes test_irq4200)

This commit is contained in:
Sour 2019-04-08 10:17:14 -04:00
parent 41af179c61
commit 2ac5dc7b9e

View file

@ -128,7 +128,7 @@ void InternalRegisters::Write(uint16_t addr, uint8_t value)
{
switch(addr) {
case 0x4200:
if((value & 0x20) && !_enableVerticalIrq && _console->GetPpu()->GetScanline() == _verticalTimer) {
if((value & 0x30) == 0x20 && !_enableVerticalIrq && _console->GetPpu()->GetScanline() == _verticalTimer) {
//When enabling vertical irqs, if the current scanline matches the target scanline, set the irq flag right away
_console->GetCpu()->SetIrqSource(IrqSource::Ppu);
}