From d51ed1f59ef35dec00cd2016d3cb3865ee6dbfd7 Mon Sep 17 00:00:00 2001 From: normmatt234 Date: Sat, 6 Apr 2013 09:27:12 +0000 Subject: [PATCH] Make the asm code increment lsl/lsr/asr rm by 4 if rm is pc. (ASM now passes the armwrestler MOV opcode test) --- src/gba/GBA-arm.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gba/GBA-arm.cpp b/src/gba/GBA-arm.cpp index 533cfd37..27983682 100644 --- a/src/gba/GBA-arm.cpp +++ b/src/gba/GBA-arm.cpp @@ -356,7 +356,11 @@ static void count(u32 opcode, int cond_res) EMIT2(and, KONST(0x1F), ecx) #define VALUE_LOAD_REG \ EMIT2(and, KONST(0x0F), eax) \ - EMIT2(mov, REGREF2(eax,4), eax) \ + EMIT2(cmp, KONST(0x0F), eax) \ + EMIT2(mov, REGREF2(eax,4), eax) \ + EMIT1(jne, LABELREF(3,f)) \ + EMIT2(add, KONST(4), ax) \ + LABEL(3) \ EMIT2(movzx, ch, ecx) \ EMIT2(and, KONST(0x0F), ecx) \ EMIT2(mov, REGREF2(ecx,4), ecx)