dtcm not dtcb

This commit is contained in:
RSDuck 2021-10-29 12:09:00 +02:00
parent 6c2ea93173
commit c233d99211
1 changed files with 3 additions and 3 deletions

View File

@ -481,11 +481,11 @@ void RemapDTCM(u32 newBase, u32 newSize)
// by unmapping DTCM first and then map the holes // by unmapping DTCM first and then map the holes
u32 oldDTCMBase = NDS::ARM9->DTCMBase; u32 oldDTCMBase = NDS::ARM9->DTCMBase;
u32 oldDTCMSize = ~NDS::ARM9->DTCMMask + 1; u32 oldDTCMSize = ~NDS::ARM9->DTCMMask + 1;
u32 oldDTCBEnd = oldDTCMBase + NDS::ARM9->DTCMMask; u32 oldDTCMEnd = oldDTCMBase + NDS::ARM9->DTCMMask;
u32 newEnd = newBase + newSize; u32 newEnd = newBase + newSize;
printf("remapping DTCM %x %x %x %x\n", newBase, newEnd, oldDTCMBase, oldDTCBEnd); printf("remapping DTCM %x %x %x %x\n", newBase, newEnd, oldDTCMBase, oldDTCMEnd);
// unmap all regions containing the old or the current DTCM mapping // unmap all regions containing the old or the current DTCM mapping
for (int region = 0; region < memregions_Count; region++) for (int region = 0; region < memregions_Count; region++)
{ {
@ -501,7 +501,7 @@ void RemapDTCM(u32 newBase, u32 newSize)
printf("unmapping %d %x %x %x %x\n", region, mapping.Addr, mapping.Size, mapping.Num, mapping.LocalOffset); printf("unmapping %d %x %x %x %x\n", region, mapping.Addr, mapping.Size, mapping.Num, mapping.LocalOffset);
bool overlap = (oldDTCMSize > 0 && oldDTCMBase < end && oldDTCBEnd > start) bool overlap = (oldDTCMSize > 0 && oldDTCMBase < end && oldDTCMEnd > start)
|| (newSize > 0 && newBase < end && newEnd > start); || (newSize > 0 && newBase < end && newEnd > start);
if (mapping.Num == 0 && overlap) if (mapping.Num == 0 && overlap)