diff --git a/CHANGES b/CHANGES index 7a5f13fbd..206c2256b 100644 --- a/CHANGES +++ b/CHANGES @@ -31,6 +31,7 @@ Bugfixes: - Libretro: Fix aspect ratio - Qt: Fix some potential crashes with the gamepad mapping - Debugger: Fix watchpoints in gdb + - ARM7: Fix decoding of some ARM ALU instructions with shifters Misc: - Qt: Window size command line options are now supported - Qt: Increase usability of key mapper diff --git a/src/arm/decoder-arm.c b/src/arm/decoder-arm.c index 9a5cb7b57..c77ce6756 100644 --- a/src/arm/decoder-arm.c +++ b/src/arm/decoder-arm.c @@ -11,9 +11,9 @@ #define ADDR_MODE_1_SHIFT(OP) \ info->op3.reg = opcode & 0x0000000F; \ + info->op3.shifterOp = ARM_SHIFT_ ## OP; \ info->operandFormat |= ARM_OPERAND_REGISTER_3; \ if (opcode & 0x00000010) { \ - info->op3.shifterOp = ARM_SHIFT_ ## OP; \ info->op3.shifterReg = (opcode >> 8) & 0xF; \ ++info->iCycles; \ info->operandFormat |= ARM_OPERAND_SHIFT_REGISTER_3; \ @@ -101,11 +101,13 @@ info->affectsCPSR = S; \ SHIFTER; \ if (SKIPPED == 1) { \ - info->operandFormat >>= 8; \ info->op1 = info->op2; \ info->op2 = info->op3; \ + info->operandFormat >>= 8; \ } else if (SKIPPED == 2) { \ - info->operandFormat &= ~ARM_OPERAND_2; \ + info->op2 = info->op3; \ + info->operandFormat |= info->operandFormat >>= 8; \ + info->operandFormat &= ~ARM_OPERAND_3; \ } \ if (info->op1.reg == ARM_PC) { \ info->branchType = ARM_BRANCH_INDIRECT; \