Sorcery
Sorcery copied to clipboard
NMI handler destroys flags before saving context
The LD HL, I instruction, as used here, is documented to affect flags, which causes an incorrect save of the F register in the NMI context. (The flags are actually affected differently than the documentation, but they are affected regardless, so the issue remains.)
https://github.com/TheMachine02/Sorcery/blob/b245ea1f98e55f1554b1213426d47711fb5b094f/kernel/nmi.asm#L22