all repos — mgba @ f9a42d87d18ac8869d510b35f5c9477373fca8cc

mGBA Game Boy Advance Emulator

ARM: Fix timing on Thumb shift instructions
Vicki Pfau vi@endrift.com
Sat, 23 May 2020 21:31:55 -0700
commit

f9a42d87d18ac8869d510b35f5c9477373fca8cc

parent

8ab757e1b37049e7e4ae295aabec7bd3061975ed

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

jump to
M CHANGESCHANGES

@@ -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.csrc/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]))