all repos — mgba @ dd850b8d33dc0d07b88b6d8bc327f0ca15ef00a6

mGBA Game Boy Advance Emulator

SM83: HALT should not consume an extra T-state
Vicki Pfau vi@endrift.com
Wed, 17 Mar 2021 18:19:44 -0700
commit

dd850b8d33dc0d07b88b6d8bc327f0ca15ef00a6

parent

039a64ee62da13d83c09c7f7f017a69358e19c71

2 files changed, 5 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -65,6 +65,7 @@ - GBA Video: Emulate sprite cycle limits in OpenGL renderer (fixes mgba.io/i/1635)

- GBA Video: Fix OBJWIN erratic rendering in OpenGL renderer - SM83: Emulate HALT bug - SM83: Improve mid-M-cycle interrupts + - SM83: HALT should not consume an extra T-state Other fixes: - 3DS: Fix thread cleanup - All: Improve export headers (fixes mgba.io/i/1738)
M src/sm83/isa-sm83.csrc/sm83/isa-sm83.c

@@ -761,7 +761,10 @@ cpu->f.c = low;)

DEFINE_INSTRUCTION_SM83(DI, cpu->irqh.setInterrupts(cpu, false)); DEFINE_INSTRUCTION_SM83(EI, cpu->irqh.setInterrupts(cpu, true)); -DEFINE_INSTRUCTION_SM83(HALT, cpu->irqh.halt(cpu)); +DEFINE_INSTRUCTION_SM83(HALT, + cpu->irqh.halt(cpu); + // XXX: Subtract the cycles that will be added later in the tick function + cpu->cycles -= cpu->tMultiplier;); #define DEFINE_RST_INSTRUCTION_SM83(VEC) \ DEFINE_INSTRUCTION_SM83(RST ## VEC ## UpdateSPL, \