aboutsummaryrefslogtreecommitdiff
path: root/ARMInterpreter_LoadStore.cpp
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2016-12-03 02:09:04 +0100
committerStapleButter <thetotalworm@gmail.com>2016-12-03 02:09:04 +0100
commit844ca4505570bef9c6c8b16263a2473f7df9020a (patch)
tree93afbf2bc11e56217958583863e03aa6df39f8d4 /ARMInterpreter_LoadStore.cpp
parent23d584ca4c86e5e75947ef4edc1f06e1fbedc2e6 (diff)
add MSR/MRS. also fix misc error with LDR ROR effect.
see shibboleet, I can do it too :>
Diffstat (limited to 'ARMInterpreter_LoadStore.cpp')
-rw-r--r--ARMInterpreter_LoadStore.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/ARMInterpreter_LoadStore.cpp b/ARMInterpreter_LoadStore.cpp
index e319056..b719e35 100644
--- a/ARMInterpreter_LoadStore.cpp
+++ b/ARMInterpreter_LoadStore.cpp
@@ -67,7 +67,7 @@ namespace ARMInterpreter
#define A_LDR \
offset += cpu->R[(cpu->CurInstr>>16) & 0xF]; \
- u32 val = ROR(cpu->Read32(offset), offset&0x3); \
+ u32 val = ROR(cpu->Read32(offset), ((offset&0x3)<<3)); \
if (cpu->CurInstr & (1<<21)) cpu->R[(cpu->CurInstr>>16) & 0xF] = offset; \
if (((cpu->CurInstr>>12) & 0xF) == 15) \
{ \
@@ -83,7 +83,7 @@ namespace ARMInterpreter
#define A_LDR_POST \
u32 addr = cpu->R[(cpu->CurInstr>>16) & 0xF]; \
- u32 val = ROR(cpu->Read32(addr, cpu->CurInstr & (1<<21)), addr&0x3); \
+ u32 val = ROR(cpu->Read32(addr, cpu->CurInstr & (1<<21)), ((addr&0x3)<<3)); \
cpu->R[(cpu->CurInstr>>16) & 0xF] += offset; \
if (((cpu->CurInstr>>12) & 0xF) == 15) \
{ \