mirror of
https://github.com/libretro/Mesen-S.git
synced 2025-03-01 13:16:44 +00:00
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:
parent
dc6d295b1a
commit
d32f512b7b
@ -81,7 +81,6 @@ uint8_t InternalRegisters::GetIoPortOutput()
|
|||||||
void InternalRegisters::SetNmiFlag(bool nmiFlag)
|
void InternalRegisters::SetNmiFlag(bool nmiFlag)
|
||||||
{
|
{
|
||||||
_nmiFlag = nmiFlag;
|
_nmiFlag = nmiFlag;
|
||||||
_cpu->SetNmiFlag(_state.EnableNmi && _nmiFlag);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void InternalRegisters::SetIrqFlag(bool irqFlag)
|
void InternalRegisters::SetIrqFlag(bool irqFlag)
|
||||||
|
@ -77,4 +77,5 @@ void InternalRegisters::ProcessIrqCounters()
|
|||||||
_needIrq = 4;
|
_needIrq = 4;
|
||||||
}
|
}
|
||||||
_irqLevel = irqLevel;
|
_irqLevel = irqLevel;
|
||||||
|
_cpu->SetNmiFlag(_state.EnableNmi & _nmiFlag);
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user