-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Z80 EI bug #2
Comments
Thanks for reporting. |
I haven't properly verified it, but I think/hope this is cause of many intermittent issues I was having. Sonic Wings is just strange in that it reliably induces the edge case and fails catastrophically when it does (IRQ handler changes YM register address to ack the interrupt, unrelated main thread write then goes to timer control register, too, and stops the timer IRQ -> hang). In theory the hazard exists everywhere there is an address/data port style device that is used in interrupts. |
FYI, there's another one: in |
There's an issue with how ZiKore implements the EI instruction - a pending IRQ should only execute after the next instruction. This is a real issue when code is written like this (from Sonic Wings 2 sound code):
Fix is to jump directly into zk_nextop after the IRQ hooks from zk_irqon.
My fix looks like this, though it also delays NMI in cases where it shouldn't (megayume doesn't have NMI impl. Neoyume does, but the commit is more messy): IRQsome/MegaYume@3817e5c
The text was updated successfully, but these errors were encountered: