all repos — mgba @ 32d1f5bbfb8630834feaa015cf77a499d569ca82

mGBA Game Boy Advance Emulator

ARM7: Fix ARM multiply instructions when PC is a destination register
Jeffrey Pfau jeffrey@endrift.com
Sat, 09 May 2015 13:40:58 -0700
commit

32d1f5bbfb8630834feaa015cf77a499d569ca82

parent

179f12bf09d0eded5aea1f3cdc0d27be9912e1b4

2 files changed, 5 insertions(+), 5 deletions(-)

jump to
M CHANGESCHANGES

@@ -50,6 +50,7 @@ - GBA: Handle out-of-bounds I/O access

- 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
M src/arm/isa-arm.csrc/arm/isa-arm.c

@@ -327,13 +327,12 @@ int rd = (opcode >> 12) & 0xF; \

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, ) \