Attempt to fix timer
Attempt to fix timer

The gist of this is that I stepped through a timer interrupt handler and noticed the interrupt was always firing before it was finished, which seemed wrong. The way the interrupt was structured it would basically save the CPU regs, disable timer interrupts, mask out some bits of PSW (including NP and ID, effectively masking out interrupt handling status), change a bunch of VSU regs, reenable timer interrupts, restore CPU regs. The issue is that as soon as it would reenable timer interrupts, because of the PSW masking, the interrupt would immediately fire again, since the timer interrupt was never ACK'd. Since the code never explicitly clears timer zero status and only seems to affect timer interrupt enable, it could be the case that disabling timer interrupts would also effectively ack the interrupt. This fix emulates that behavior with an explicit interrupt state in the timer that gets cleared when the zero interrupt is disabled. It appears to work quite well in fixing the apparent issue.

jwestfall69/rustual-boy,jwestfall69/rustual-boy