ROUTINE: in a,(#66) bit 1,a jr z,SPLIT bit 0,a jr z,REFRESH
Don’t you have those flags reversed? I would expect a 1 (nz) indicates an interrupt, not a 0 (z).
ROUTINE: in a,(#66) bit 1,a jr z,SPLIT bit 0,a jr z,REFRESH
Don’t you have those flags reversed? I would expect a 1 (nz) indicates an interrupt, not a 0 (z).
Yes, it may be reversed. But this code will be triggered on a non-V9990 INT and should "do nothing and exit".
Anyway, i reversed and it stopped crashing. but this is bugging me, Just works is not as good as "it didn't worked because xyz".
jr z: It jumps to the handler if the bit is 0.
jr nz: It jumps to the handler if the bit is 1.
The hang occurs if an interrupt occurs which is not handled, because the interrupt continues to be triggered again as soon as it ei’s and returns at the end, and control is never returned to the main program. I think interrupt flag bit value 1 means: interrupt. Flag bit value 0 means: no interrupt. Unfortunately the V9990 manual is not explicit about this I think, but it is the most logical meaning of the bit values, and if it no longer crashes that seems to confirm it. The openMSX source code also confirms this.
Oh, now I get it. The interrupt signal from V9990 will be kept raised until my code resets it, but since my ISR didn't catch this interrupt, the moment interrupts get enabled it will trigger another INT and loop forever.
Many thanks, Grauw!