diff --git a/desmume/src/thumb_instructions.cpp b/desmume/src/thumb_instructions.cpp index b53442255..48aa63cf5 100644 --- a/desmume/src/thumb_instructions.cpp +++ b/desmume/src/thumb_instructions.cpp @@ -1016,22 +1016,22 @@ TEMPLATE static u32 FASTCALL OP_BL_THUMB(const u32 i) TEMPLATE static u32 FASTCALL OP_BX_THUMB(const u32 i) { - // When using PC as operand with BX opcode, switch to ARM state and jump to (instruct_adr+4) - // Reference: http://nocash.emubase.de/gbatek.htm#thumb5hiregisteroperationsbranchexchange - if (REG_POS(cpu->instruction, 3) == 15) - { + // When using PC as operand with BX opcode, switch to ARM state and jump to (instruct_adr+4) + // Reference: http://nocash.emubase.de/gbatek.htm#thumb5hiregisteroperationsbranchexchange + if (REG_POS(cpu->instruction, 3) == 15) + { cpu->CPSR.bits.T = 0; cpu->R[15] &= 0xFFFFFFFC; cpu->next_instruction = cpu->R[15]; - } - else - { + } + else + { u32 Rm = cpu->R[REG_POS(cpu->instruction, 3)]; cpu->CPSR.bits.T = BIT0(Rm); cpu->R[15] = (Rm & 0xFFFFFFFE); cpu->next_instruction = cpu->R[15]; - } + } return 3; }