Skip to content
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

Clear waiting with disabled interrupt #434

Merged
merged 1 commit into from
Oct 23, 2022
Merged

Conversation

LRFLEW
Copy link
Contributor

@LRFLEW LRFLEW commented Oct 15, 2022

I was looking up documentation on how to use the WAI instruction, when I noticed that the emulator wasn't handling it correctly when the interrupt disable flag was set. Multiple sources I checked indicated that if the interrupt disable flag is set when calling WAI, then the interrupt handler won't be called on an IRQ, but the WAI will end and continue execution from where it was. This PR moves the check for the interrupt disable flag from main.c to cpu/fake6502.c, where it can still set waiting to zero independent of the interrupt disable flag's status.

@mist64 mist64 merged commit d5d813e into commanderx16:master Oct 23, 2022
@LRFLEW LRFLEW mentioned this pull request Oct 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants