ARM: Fix timing on Thumb shift instructions
Vicki Pfau vi@endrift.com
Sat, 23 May 2020 21:31:55 -0700
2 files changed,
5 insertions(+),
0 deletions(-)
M
CHANGES
→
CHANGES
@@ -5,6 +5,7 @@ - Add APNG recording
Emulation fixes: - ARM: Fix ALU reading PC after shifting - ARM: Fix STR storing PC after address calculation + - ARM: Fix timing on Thumb shift instructions - GB: Fix GBC game registers after skipping BIOS - GB MBC: Support 4MB MBC30 ROMs (fixes mgba.io/i/1713) - GB Video: Fix state after skipping BIOS (fixes mgba.io/i/1715 and mgba.io/i/1716)
M
src/arm/isa-thumb.c
→
src/arm/isa-thumb.c
@@ -157,6 +157,7 @@ }
cpu->gprs[rd] = 0; } } + ++currentCycles; THUMB_NEUTRAL_S( , , cpu->gprs[rd])) DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(LSR2,@@ -174,6 +175,7 @@ }
cpu->gprs[rd] = 0; } } + ++currentCycles; THUMB_NEUTRAL_S( , , cpu->gprs[rd])) DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(ASR2,@@ -191,6 +193,7 @@ cpu->gprs[rd] = 0;
} } } + ++currentCycles; THUMB_NEUTRAL_S( , , cpu->gprs[rd])) DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(ADC,@@ -215,6 +218,7 @@ } else {
cpu->cpsr.c = ARM_SIGN(cpu->gprs[rd]); } } + ++currentCycles; THUMB_NEUTRAL_S( , , cpu->gprs[rd]);) DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(TST, int32_t aluOut = cpu->gprs[rd] & cpu->gprs[rn]; THUMB_NEUTRAL_S(cpu->gprs[rd], cpu->gprs[rn], aluOut)) DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(NEG, THUMB_SUBTRACTION(cpu->gprs[rd], 0, cpu->gprs[rn]))