aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2018-12-11 16:41:18 +0100
committerStapleButter <thetotalworm@gmail.com>2018-12-11 16:41:18 +0100
commit91b2f6459613b8af8308e25ff89f5bef61c2b8b3 (patch)
tree01562b4b54b9ac642e644b3710317ff7aa2a0064 /src
parentbeb092f93eacde92e300c15cbbc0c4081d2676d0 (diff)
add back faster prefetch for ARM9
Diffstat (limited to 'src')
-rw-r--r--src/ARM.cpp9
-rw-r--r--src/CP15.cpp2
2 files changed, 8 insertions, 3 deletions
diff --git a/src/ARM.cpp b/src/ARM.cpp
index 8566663..4ee72a3 100644
--- a/src/ARM.cpp
+++ b/src/ARM.cpp
@@ -144,7 +144,10 @@ void ARM::SetupCodeMem(u32 addr)
}
else
{
- NDS::ARM7GetMemRegion(addr, false, &CodeMem);
+ // not sure it's worth it for the ARM7
+ // esp. as everything there generally runs on WRAM
+ // and due to how it's mapped, we can't use this optimization
+ //NDS::ARM7GetMemRegion(addr, false, &CodeMem);
}
}
@@ -176,7 +179,7 @@ void ARMv5::JumpTo(u32 addr, bool restorecpsr)
addr &= ~0x1;
R[15] = addr+2;
- //if (newregion != oldregion) SetupCodeMem(addr);
+ if (newregion != oldregion) SetupCodeMem(addr);
// two-opcodes-at-once fetch
// doesn't matter if we put garbage in the MSbs there
@@ -200,7 +203,7 @@ void ARMv5::JumpTo(u32 addr, bool restorecpsr)
addr &= ~0x3;
R[15] = addr+4;
- //if (newregion != oldregion) SetupCodeMem(addr);
+ if (newregion != oldregion) SetupCodeMem(addr);
NextInstr[0] = CodeRead32(addr);
NextInstr[1] = CodeRead32(addr+4);
diff --git a/src/CP15.cpp b/src/CP15.cpp
index a29601c..432ae1f 100644
--- a/src/CP15.cpp
+++ b/src/CP15.cpp
@@ -514,6 +514,8 @@ u32 ARMv5::CodeRead32(u32 addr)
return *(u32*)&ITCM[addr & 0x7FFF];
}
+ if (CodeMem.Mem) return *(u32*)&CodeMem.Mem[addr & CodeMem.Mask];
+
return NDS::ARM9Read32(addr);
}