all repos — mgba @ 9e400e86da63f038e0acb2a8402beefda4fa42f6

mGBA Game Boy Advance Emulator

ARM: multiply wait macros should write to local variable instead of global cycle count
Jeffrey Pfau jeffrey@endrift.com
Mon, 17 Nov 2014 00:14:37 -0800
commit

9e400e86da63f038e0acb2a8402beefda4fa42f6

parent

3c41bd2427df6bec37032957370da5ef882407a5

1 files changed, 4 insertions(+), 4 deletions(-)

jump to
M src/arm/isa-inlines.hsrc/arm/isa-inlines.h

@@ -31,13 +31,13 @@ #define ARM_V_SUBTRACTION(M, N, D) ((ARM_SIGN((M) ^ (N))) && (ARM_SIGN((M) ^ (D))))

#define ARM_WAIT_MUL(R) \ if ((R & 0xFFFFFF00) == 0xFFFFFF00 || !(R & 0xFFFFFF00)) { \ - cpu->cycles += 1; \ + currentCycles += 1; \ } else if ((R & 0xFFFF0000) == 0xFFFF0000 || !(R & 0xFFFF0000)) { \ - cpu->cycles += 2; \ + currentCycles += 2; \ } else if ((R & 0xFF000000) == 0xFF000000 || !(R & 0xFF000000)) { \ - cpu->cycles += 3; \ + currentCycles += 3; \ } else { \ - cpu->cycles += 4; \ + currentCycles += 4; \ } #define ARM_STUB cpu->irqh.hitStub(cpu, opcode)