ARM: Fix timing on Thumb shift instructions

This commit is contained in:
Vicki Pfau 2020-05-23 21:31:55 -07:00
parent 8ab757e1b3
commit f9a42d87d1
2 changed files with 5 additions and 0 deletions

View File

@ -5,6 +5,7 @@ Features:
Emulation fixes: Emulation fixes:
- ARM: Fix ALU reading PC after shifting - ARM: Fix ALU reading PC after shifting
- ARM: Fix STR storing PC after address calculation - ARM: Fix STR storing PC after address calculation
- ARM: Fix timing on Thumb shift instructions
- GB: Fix GBC game registers after skipping BIOS - GB: Fix GBC game registers after skipping BIOS
- GB MBC: Support 4MB MBC30 ROMs (fixes mgba.io/i/1713) - 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) - GB Video: Fix state after skipping BIOS (fixes mgba.io/i/1715 and mgba.io/i/1716)

View File

@ -157,6 +157,7 @@ DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(LSL2,
cpu->gprs[rd] = 0; cpu->gprs[rd] = 0;
} }
} }
++currentCycles;
THUMB_NEUTRAL_S( , , cpu->gprs[rd])) THUMB_NEUTRAL_S( , , cpu->gprs[rd]))
DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(LSR2, DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(LSR2,
@ -174,6 +175,7 @@ DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(LSR2,
cpu->gprs[rd] = 0; cpu->gprs[rd] = 0;
} }
} }
++currentCycles;
THUMB_NEUTRAL_S( , , cpu->gprs[rd])) THUMB_NEUTRAL_S( , , cpu->gprs[rd]))
DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(ASR2, DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(ASR2,
@ -191,6 +193,7 @@ DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(ASR2,
} }
} }
} }
++currentCycles;
THUMB_NEUTRAL_S( , , cpu->gprs[rd])) THUMB_NEUTRAL_S( , , cpu->gprs[rd]))
DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(ADC, DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(ADC,
@ -215,6 +218,7 @@ DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(ROR,
cpu->cpsr.c = ARM_SIGN(cpu->gprs[rd]); cpu->cpsr.c = ARM_SIGN(cpu->gprs[rd]);
} }
} }
++currentCycles;
THUMB_NEUTRAL_S( , , cpu->gprs[rd]);) 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(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])) DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(NEG, THUMB_SUBTRACTION(cpu->gprs[rd], 0, cpu->gprs[rn]))