all repos — mgba @ c143dec77dcd716c457334413d72746f0a277fd4

mGBA Game Boy Advance Emulator

Fix ADD(4) and MOV(3)
Jeffrey Pfau jeffrey@endrift.com
Tue, 16 Apr 2013 23:52:30 -0700
commit

c143dec77dcd716c457334413d72746f0a277fd4

parent

4b4914afb695c63e1bf2ffa85a061631f3975f20

1 files changed, 11 insertions(+), 2 deletions(-)

jump to
M src/arm/isa-thumb.csrc/arm/isa-thumb.c

@@ -255,9 +255,18 @@ DEFINE_INSTRUCTION_WITH_HIGH_EX_THUMB(NAME ## 01, 0, 8, BODY) \

DEFINE_INSTRUCTION_WITH_HIGH_EX_THUMB(NAME ## 10, 8, 0, BODY) \ DEFINE_INSTRUCTION_WITH_HIGH_EX_THUMB(NAME ## 11, 8, 8, BODY) -DEFINE_INSTRUCTION_WITH_HIGH_THUMB(ADD4, cpu->gprs[rd] += cpu->gprs[rm]) +DEFINE_INSTRUCTION_WITH_HIGH_THUMB(ADD4, + cpu->gprs[rd] += cpu->gprs[rm]; + if (rd == ARM_PC) { + THUMB_WRITE_PC; + }) + DEFINE_INSTRUCTION_WITH_HIGH_THUMB(CMP3, int32_t aluOut = cpu->gprs[rd] - cpu->gprs[rm]; THUMB_SUBTRACTION_S(cpu->gprs[rd], cpu->gprs[rm], aluOut)) -DEFINE_INSTRUCTION_WITH_HIGH_THUMB(MOV3, cpu->gprs[rd] = cpu->gprs[rm]) +DEFINE_INSTRUCTION_WITH_HIGH_THUMB(MOV3, + cpu->gprs[rd] = cpu->gprs[rm]; + if (rd == ARM_PC) { + THUMB_WRITE_PC; + }) #define DEFINE_IMMEDIATE_WITH_REGISTER_EX_THUMB(NAME, RD, BODY) \ DEFINE_INSTRUCTION_THUMB(NAME, \