all repos — mgba @ c27dde73e7051ea1da0c604c0ba98d7c347de8fe

mGBA Game Boy Advance Emulator

ARM7: Fix regression with Thumb branches
Jeffrey Pfau jeffrey@endrift.com
Wed, 21 Oct 2015 19:57:29 -0700
commit

c27dde73e7051ea1da0c604c0ba98d7c347de8fe

parent

5922beb47536508c3ae46654ec6637d670fa4a3d

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

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

@@ -308,8 +308,8 @@

#define DEFINE_CONDITIONAL_BRANCH_THUMB(COND) \ DEFINE_INSTRUCTION_THUMB(B ## COND, \ if (ARM_COND_ ## COND) { \ - uint8_t immediate = opcode; \ - cpu->gprs[ARM_PC] += immediate << 1; \ + int8_t immediate = opcode; \ + cpu->gprs[ARM_PC] += (int32_t) immediate << 1; \ THUMB_WRITE_PC; \ })