fix uninitialised memory mapping

This commit is contained in:
RSDuck 2019-07-21 23:56:24 +02:00 committed by RSDuck
parent 4a0f6b3b4b
commit 51b6b7a7d5
3 changed files with 10 additions and 2 deletions

View File

@ -102,7 +102,6 @@ void ARM::Reset()
void ARMv5::Reset()
{
CP15Reset();
ARM::Reset();
}

View File

@ -257,9 +257,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++)

View File

@ -247,7 +247,9 @@ void SetARM9RegionTimings(u32 addrstart, u32 addrend, int buswidth, int nonseq,
ARM9MemTimings[i][3] = S32;
}
ARM9->UpdateRegionTimings(addrstart<<14, addrend<<14);
ARM9->UpdateRegionTimings(addrstart<<14, addrend == 0x40000
? 0xFFFFFFFF
: (addrend<<14));
}
void SetARM7RegionTimings(u32 addrstart, u32 addrend, int buswidth, int nonseq, int seq)
@ -459,6 +461,11 @@ void Reset()
fclose(f);
}
// has to be called before InitTimings
// otherwise some PU settings are completely
// unitialised on the first run
ARM9->CP15Reset();
// TODO for later: configure this when emulating a DSi
ARM9ClockShift = 1;