NMI: Set CPU's nmi flag during irq/nmi flag update instead of right away

Fixes a freeze at power on in Chou Aniki.
The game writes to 4200+4201 (16-bit write) to enable NMIs in the middle of vblank and expects the instruction after the write to run BEFORE the nmi handler is called (not doing so causes the game to freeze)
This commit is contained in:
Sour 2020-03-01 11:20:02 -05:00
parent dc6d295b1a
commit d32f512b7b
2 changed files with 1 additions and 1 deletions

View file

@ -81,7 +81,6 @@ uint8_t InternalRegisters::GetIoPortOutput()
void InternalRegisters::SetNmiFlag(bool nmiFlag)
{
_nmiFlag = nmiFlag;
_cpu->SetNmiFlag(_state.EnableNmi && _nmiFlag);
}
void InternalRegisters::SetIrqFlag(bool irqFlag)

View file

@ -77,4 +77,5 @@ void InternalRegisters::ProcessIrqCounters()
_needIrq = 4;
}
_irqLevel = irqLevel;
_cpu->SetNmiFlag(_state.EnableNmi & _nmiFlag);
}