From 32d1f5bbfb8630834feaa015cf77a499d569ca82 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sat, 9 May 2015 13:40:58 -0700 Subject: [PATCH] ARM7: Fix ARM multiply instructions when PC is a destination register --- CHANGES | 1 + src/arm/isa-arm.c | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 2a94e20f6..867c3d1c4 100644 --- a/CHANGES +++ b/CHANGES @@ -50,6 +50,7 @@ Bugfixes: - GBA: Fix bounds-checking on EEPROM access - ARM7: Make illegal instruction decoding consistent between ARM and Thumb - GBA BIOS: Initialize a variable that may be uninitialized in very rare cases + - ARM7: Fix ARM multiply instructions when PC is a destination register Misc: - Qt: Show multiplayer numbers in window title - Qt: Handle saving input settings better diff --git a/src/arm/isa-arm.c b/src/arm/isa-arm.c index 802d91a81..77c747601 100644 --- a/src/arm/isa-arm.c +++ b/src/arm/isa-arm.c @@ -327,13 +327,12 @@ static inline void _immediate(struct ARMCore* cpu, uint32_t opcode) { int rdHi = (opcode >> 16) & 0xF; \ int rs = (opcode >> 8) & 0xF; \ int rm = opcode & 0xF; \ - UNUSED(rdHi); \ + if (rdHi == ARM_PC || rd == ARM_PC) { \ + return; \ + } \ ARM_WAIT_MUL(cpu->gprs[rs]); \ BODY; \ - S_BODY; \ - if (rd == ARM_PC) { \ - ARM_WRITE_PC; \ - }) + S_BODY;) #define DEFINE_MULTIPLY_INSTRUCTION_ARM(NAME, BODY, S_BODY) \ DEFINE_MULTIPLY_INSTRUCTION_EX_ARM(NAME, BODY, ) \