Store the PC register at the appropriate offset
In ARM mode, the GBA CPU stores the PC (r15) register with an offset of 4. This was not handled correctly by the core emulator. Fixes #1200
This commit is contained in:
parent
215e9b1ac2
commit
beab088139
|
@ -1528,7 +1528,7 @@ static INSN_REGPARM void arm121(uint32_t opcode)
|
|||
#define ADDRESS_PREDEC (reg[base].I - offset)
|
||||
#define ADDRESS_PREINC (reg[base].I + offset)
|
||||
|
||||
#define OP_STR CPUWriteMemory(address, reg[dest].I)
|
||||
#define OP_STR CPUWriteMemory(address, reg[dest].I + (dest == 15 ? 4 : 0))
|
||||
#define OP_STRH CPUWriteHalfWord(address, reg[dest].W.W0)
|
||||
#define OP_STRB CPUWriteByte(address, reg[dest].B.B0)
|
||||
#define OP_LDR reg[dest].I = CPUReadMemory(address)
|
||||
|
|
Loading…
Reference in New Issue