all repos — mgba @ dbe9796b34d8bec97b7df5c488edd4b0bdafe1aa

mGBA Game Boy Advance Emulator

Implement B
Jeffrey Pfau jeffrey@endrift.com
Sat, 13 Apr 2013 12:38:47 -0700
commit

dbe9796b34d8bec97b7df5c488edd4b0bdafe1aa

parent

abd522a2cec531fab6838f2292e2b8c99da4dd43

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

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

@@ -358,7 +358,11 @@ cpu->gprs[ARM_SP] = address + 4)

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