all repos — mgba @ 67750e351b484d0898ee03e1886216b86607fbb8

mGBA Game Boy Advance Emulator

Fix sign-extension on BL1
Jeffrey Pfau jeffrey@endrift.com
Fri, 12 Apr 2013 22:59:19 -0700
commit

67750e351b484d0898ee03e1886216b86607fbb8

parent

eed0e77079187b0e81b8174d3162faad1270112b

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

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

@@ -344,8 +344,8 @@ DEFINE_INSTRUCTION_THUMB(ILL, ARM_STUB)

DEFINE_INSTRUCTION_THUMB(BKPT, ARM_STUB) DEFINE_INSTRUCTION_THUMB(B, ARM_STUB) DEFINE_INSTRUCTION_THUMB(BL1, \ - int16_t immediate = (opcode & 0x07FF) << 7; \ - cpu->gprs[ARM_LR] = cpu->gprs[ARM_PC] + (((int32_t) immediate) << 5);) + int16_t immediate = (opcode & 0x07FF) << 5; \ + cpu->gprs[ARM_LR] = cpu->gprs[ARM_PC] + (((int32_t) immediate) << 7);) DEFINE_INSTRUCTION_THUMB(BL2, \ uint16_t immediate = (opcode & 0x07FF) << 1; \