Browse Source

Merge pull request #950 from lioncash/bx

dyncom: Properly retrieve the PC value in BX if used.
Lioncash 11 years ago
parent
commit
25652e5cd5
1 changed files with 5 additions and 3 deletions
  1. 5 3
      src/core/arm/dyncom/arm_dyncom_interpreter.cpp

+ 5 - 3
src/core/arm/dyncom/arm_dyncom_interpreter.cpp

@@ -4144,11 +4144,13 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) {
         if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) {
         if (inst_base->cond == 0xE || CondPassed(cpu, inst_base->cond)) {
             bx_inst* const inst_cream = (bx_inst*)inst_base->component;
             bx_inst* const inst_cream = (bx_inst*)inst_base->component;
 
 
+            u32 address = RM;
+
             if (inst_cream->Rm == 15)
             if (inst_cream->Rm == 15)
-                LOG_WARNING(Core_ARM11, "BX at pc %x: use of Rm = R15 is discouraged", cpu->Reg[15]);
+                address += 2 * GET_INST_SIZE(cpu);
 
 
-            cpu->TFlag = cpu->Reg[inst_cream->Rm] & 0x1;
-            cpu->Reg[15] = cpu->Reg[inst_cream->Rm] & 0xfffffffe;
+            cpu->TFlag   = address & 1;
+            cpu->Reg[15] = address & 0xfffffffe;
             INC_PC(sizeof(bx_inst));
             INC_PC(sizeof(bx_inst));
             goto DISPATCH;
             goto DISPATCH;
         }
         }