all repos — mgba @ 6c44cf8dfc43376bdcb7dd385412bd00b3103dcb

mGBA Game Boy Advance Emulator

Implement BL
Jeffrey Pfau jeffrey@endrift.com
Sat, 27 Apr 2013 02:54:16 -0700
commit

6c44cf8dfc43376bdcb7dd385412bd00b3103dcb

parent

21b9222357165070842290e3bd804388b57bfb49

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

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

@@ -588,7 +588,12 @@ offset >>= 6;

cpu->gprs[ARM_PC] += offset; ARM_WRITE_PC;) -DEFINE_INSTRUCTION_ARM(BL, ARM_STUB) +DEFINE_INSTRUCTION_ARM(BL, + int32_t immediate = (opcode & 0x00FFFFFF) << 8; + cpu->gprs[ARM_LR] = cpu->gprs[ARM_PC] - WORD_SIZE_ARM; + cpu->gprs[ARM_PC] += immediate >> 6; + ARM_WRITE_PC;) + DEFINE_INSTRUCTION_ARM(BX, int rm = opcode & 0x0000000F; _ARMSetMode(cpu, cpu->gprs[rm] & 0x00000001);