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

Cpu simulator doesn't clear D flag on irq #414

Closed
irmen opened this issue Jul 8, 2022 · 0 comments · Fixed by #436
Closed

Cpu simulator doesn't clear D flag on irq #414

irmen opened this issue Jul 8, 2022 · 0 comments · Fixed by #436

Comments

@irmen
Copy link
Contributor

irmen commented Jul 8, 2022

It has come to light that the cpu simulation doesn't properly clear the Decimal (bcd) flag on IRQ and possibly other things. This is improved behavior of the 65C02 over the 6502 NMOS version, and the cpu simulator only seems to simulate the nmos variant's behavior here.

This causes issues: https://www.commanderx16.com/forum/index.php?/topic/3635-mouse_get-kernal-function-issue/

65c02 decimal flag behavior on irq, nmi, brk, reset: http://www.6502.org/tutorials/decimal_mode.html#5

At least the irq6502 routine should be improved: https://github.com/commanderx16/x16-emulator/blob/master/src/cpu/fake6502.c#L180 but most likely the nmi6502 as well and maybe others.

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 a pull request may close this issue.

1 participant