all repos — mgba @ 910ff621b32c461a6210aca06f94f38de95b76b3

mGBA Game Boy Advance Emulator

ARM7: Fix timing of multiplies to use N cycles
Jeffrey Pfau jeffrey@endrift.com
Fri, 12 Jun 2015 03:26:50 -0700
commit

910ff621b32c461a6210aca06f94f38de95b76b3

parent

f8fd3ae2cc71c15b6bb0f98819250470d6e6f54a

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

jump to
M CHANGESCHANGES

@@ -42,6 +42,7 @@ - GBA Video: Fix out-of-bounds tiles in mosaic

- GBA Memory: Fix potential DMA issue when loading a savestate - GBA Audio: Fix audio pitch changing when adjusting buffer size - SDL: Fix SDL build when OpenGL is missing + - ARM7: Fix timing of multiplies to use N cycles Misc: - Qt: Handle saving input settings better - Debugger: Free watchpoints in addition to breakpoints
M src/arm/isa-arm.csrc/arm/isa-arm.c

@@ -332,7 +332,8 @@ return; \

} \ ARM_WAIT_MUL(cpu->gprs[rs]); \ BODY; \ - S_BODY;) + S_BODY; \ + currentCycles += cpu->memory.activeNonseqCycles32 - cpu->memory.activeSeqCycles32) #define DEFINE_MULTIPLY_INSTRUCTION_ARM(NAME, BODY, S_BODY) \ DEFINE_MULTIPLY_INSTRUCTION_EX_ARM(NAME, BODY, ) \
M src/arm/isa-thumb.csrc/arm/isa-thumb.c

@@ -231,7 +231,7 @@ DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(NEG, THUMB_SUBTRACTION(cpu->gprs[rd], 0, cpu->gprs[rn]))

DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(CMP2, int32_t aluOut = cpu->gprs[rd] - cpu->gprs[rn]; THUMB_SUBTRACTION_S(cpu->gprs[rd], cpu->gprs[rn], aluOut)) DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(CMN, int32_t aluOut = cpu->gprs[rd] + cpu->gprs[rn]; THUMB_ADDITION_S(cpu->gprs[rd], cpu->gprs[rn], aluOut)) DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(ORR, cpu->gprs[rd] = cpu->gprs[rd] | cpu->gprs[rn]; THUMB_NEUTRAL_S( , , cpu->gprs[rd])) -DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(MUL, ARM_WAIT_MUL(cpu->gprs[rd]); cpu->gprs[rd] *= cpu->gprs[rn]; THUMB_NEUTRAL_S( , , cpu->gprs[rd])) +DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(MUL, ARM_WAIT_MUL(cpu->gprs[rd]); cpu->gprs[rd] *= cpu->gprs[rn]; THUMB_NEUTRAL_S( , , cpu->gprs[rd]); currentCycles += cpu->memory.activeNonseqCycles16 - cpu->memory.activeSeqCycles16) DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(BIC, cpu->gprs[rd] = cpu->gprs[rd] & ~cpu->gprs[rn]; THUMB_NEUTRAL_S( , , cpu->gprs[rd])) DEFINE_DATA_FORM_5_INSTRUCTION_THUMB(MVN, cpu->gprs[rd] = ~cpu->gprs[rn]; THUMB_NEUTRAL_S( , , cpu->gprs[rd]))