ARM7: Handle writeback for PC in addressing modes 2 and 3
Jeffrey Pfau jeffrey@endrift.com
Fri, 08 May 2015 01:23:44 -0700
2 files changed,
7 insertions(+),
1 deletions(-)
M
CHANGES
→
CHANGES
@@ -45,6 +45,7 @@ - Video: Fix an issue with very long filenames
- SDL: Fix boundary conditions for joystick adjustments - Util: Fix a null-pointer issue when attempting to delete a key - SDL: Allocate properly sized input maps + - ARM7: Handle writeback for PC in addressing modes 2 and 3 Misc: - Qt: Show multiplayer numbers in window title - Qt: Handle saving input settings better
M
src/arm/isa-arm.c
→
src/arm/isa-arm.c
@@ -233,7 +233,12 @@ #define ADDR_MODE_2_RN (cpu->gprs[rn])
#define ADDR_MODE_2_RM (cpu->gprs[rm]) #define ADDR_MODE_2_IMMEDIATE (opcode & 0x00000FFF) #define ADDR_MODE_2_INDEX(U_OP, M) (cpu->gprs[rn] U_OP M) -#define ADDR_MODE_2_WRITEBACK(ADDR) (cpu->gprs[rn] = ADDR) +#define ADDR_MODE_2_WRITEBACK(ADDR) \ + cpu->gprs[rn] = ADDR; \ + if (UNLIKELY(rn == ARM_PC)) { \ + ARM_WRITE_PC; \ + } + #define ADDR_MODE_2_LSL (cpu->gprs[rm] << ADDR_MODE_2_I) #define ADDR_MODE_2_LSR (ADDR_MODE_2_I_TEST ? ((uint32_t) cpu->gprs[rm]) >> ADDR_MODE_2_I : 0) #define ADDR_MODE_2_ASR (ADDR_MODE_2_I_TEST ? ((int32_t) cpu->gprs[rm]) >> ADDR_MODE_2_I : ((int32_t) cpu->gprs[rm]) >> 31)