branlwyd / bdcpu16

DCPU-16 simulator based on version 1.7 of the DCPU-16 specification. See http://dcpu.com/.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

skip doesn't work properly with interrupts

branlwyd opened this issue · comments

Currently, IF* instruction skipping is implemented by setting a skip flag and then checking that flag when executing an instruction. However if an interrupt is received while this is happening, the interrupt handler will continue to skip. This is incorrect.

The solution is to skip all at once before attempting to handle an interrupt.

Fixed in bce4f06 by checking the skip flag before handling an interrupt in Cpu.skip(). Closing.