all repos — mgba @ 780b4521cf14abf3b76a47406b4de17ec3f0d9fb

mGBA Game Boy Advance Emulator

ARM: Fix stepping when events are pending
Vicki Pfau vi@endrift.com
Fri, 20 Dec 2019 21:08:28 -0800
commit

780b4521cf14abf3b76a47406b4de17ec3f0d9fb

parent

2cb5a08f4f02468e351cab80a92f5803ec3356cf

2 files changed, 4 insertions(+), 3 deletions(-)

jump to
M CHANGESCHANGES

@@ -89,6 +89,7 @@ Changes from beta 1:

Emulation fixes: - ARM: Fix STR writeback pipeline stage - ARM: Partially fix LDM/STM writeback with empty register list + - ARM: Fix stepping when events are pending - GBA DMA: Fix case where DMAs could get misaligned (fixes mgba.io/i/1092) - GBA Video: Fix OpenGL renderer 512x512 backgrounds (fixes mgba.io/i/1572) - GBA Memory: Fix open bus from IWRAM (fixes mgba.io/i/1575)
M src/arm/arm.csrc/arm/arm.c

@@ -276,13 +276,13 @@ instruction(cpu, opcode);

} void ARMRun(struct ARMCore* cpu) { + while (cpu->cycles >= cpu->nextEvent) { + cpu->irqh.processEvents(cpu); + } if (cpu->executionMode == MODE_THUMB) { ThumbStep(cpu); } else { ARMStep(cpu); - } - if (cpu->cycles >= cpu->nextEvent) { - cpu->irqh.processEvents(cpu); } }