aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRSDuck <RSDuck@users.noreply.github.com>2019-07-21 23:56:24 +0200
committerRSDuck <rsduck@users.noreply.github.com>2020-06-16 11:54:47 +0200
commit00cd9af033cfaffce262dc972170dbec177af3e1 (patch)
tree757085f4ed0bb9783a3e0dd4c45c5651a53f8b61
parentd74b15eecc4c5d82703535e0d5c687c3cf225eae (diff)
fix uninitialised memory mapping
-rw-r--r--src/ARM.cpp1
-rw-r--r--src/CP15.cpp2
-rw-r--r--src/NDS.cpp4
3 files changed, 6 insertions, 1 deletions
diff --git a/src/ARM.cpp b/src/ARM.cpp
index dd0be6a..50ef8fd 100644
--- a/src/ARM.cpp
+++ b/src/ARM.cpp
@@ -124,7 +124,6 @@ void ARMv5::Reset()
GetMemRegion = NDS::ARM9GetMemRegion;
}
- CP15Reset();
ARM::Reset();
}
diff --git a/src/CP15.cpp b/src/CP15.cpp
index 5b5f935..77244f2 100644
--- a/src/CP15.cpp
+++ b/src/CP15.cpp
@@ -258,9 +258,11 @@ void ARMv5::UpdatePURegions(bool update_all)
void ARMv5::UpdateRegionTimings(u32 addrstart, u32 addrend)
{
+ printf("initialising region timings %x %x\n", addrstart, addrend);
addrstart >>= 12;
addrend >>= 12;
+
if (addrend == 0xFFFFF) addrend++;
for (u32 i = addrstart; i < addrend; i++)
diff --git a/src/NDS.cpp b/src/NDS.cpp
index 3de9c1f..0bde139 100644
--- a/src/NDS.cpp
+++ b/src/NDS.cpp
@@ -501,6 +501,10 @@ void Reset()
ARM9ClockShift = 1;
MainRAMMask = 0x3FFFFF;
}
+ // has to be called before InitTimings
+ // otherwise some PU settings are completely
+ // unitialised on the first run
+ ARM9->CP15Reset();
ARM9Timestamp = 0; ARM9Target = 0;
ARM7Timestamp = 0; ARM7Target = 0;