diff --git a/src/ARM.cpp b/src/ARM.cpp index dd0be6af..50ef8fd5 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 5b5f935a..77244f24 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 3de9c1fa..0bde139c 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;