Skip to content

Commit

Permalink
dtcm not dtcb
Browse files Browse the repository at this point in the history
  • Loading branch information
RSDuck committed Oct 29, 2021
1 parent 6c2ea93 commit c233d99
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ARMJIT_Memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,11 +481,11 @@ void RemapDTCM(u32 newBase, u32 newSize)
// by unmapping DTCM first and then map the holes
u32 oldDTCMBase = NDS::ARM9->DTCMBase;
u32 oldDTCMSize = ~NDS::ARM9->DTCMMask + 1;
u32 oldDTCBEnd = oldDTCMBase + NDS::ARM9->DTCMMask;
u32 oldDTCMEnd = oldDTCMBase + NDS::ARM9->DTCMMask;

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
for (int region = 0; region < memregions_Count; region++)
{
Expand All @@ -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);

bool overlap = (oldDTCMSize > 0 && oldDTCMBase < end && oldDTCBEnd > start)
bool overlap = (oldDTCMSize > 0 && oldDTCMBase < end && oldDTCMEnd > start)
|| (newSize > 0 && newBase < end && newEnd > start);

if (mapping.Num == 0 && overlap)
Expand Down

0 comments on commit c233d99

Please sign in to comment.