ARM7: Handle writeback for PC in addressing modes 2 and 3

This commit is contained in:
Jeffrey Pfau 2015-05-08 01:23:44 -07:00
parent 3c844a9ae9
commit ebcb344d64
2 changed files with 7 additions and 1 deletions

View File

@ -45,6 +45,7 @@ Bugfixes:
- SDL: Fix boundary conditions for joystick adjustments - SDL: Fix boundary conditions for joystick adjustments
- Util: Fix a null-pointer issue when attempting to delete a key - Util: Fix a null-pointer issue when attempting to delete a key
- SDL: Allocate properly sized input maps - SDL: Allocate properly sized input maps
- ARM7: Handle writeback for PC in addressing modes 2 and 3
Misc: Misc:
- Qt: Show multiplayer numbers in window title - Qt: Show multiplayer numbers in window title
- Qt: Handle saving input settings better - Qt: Handle saving input settings better

View File

@ -233,7 +233,12 @@ static inline void _immediate(struct ARMCore* cpu, uint32_t opcode) {
#define ADDR_MODE_2_RM (cpu->gprs[rm]) #define ADDR_MODE_2_RM (cpu->gprs[rm])
#define ADDR_MODE_2_IMMEDIATE (opcode & 0x00000FFF) #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_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_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_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) #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)