mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-08-30 14:17:36 +00:00
More memory fixes
This commit is contained in:
parent
ee81cb7fd3
commit
d26235cf8b
2 changed files with 3 additions and 1 deletions
|
@ -186,6 +186,8 @@ class Memory {
|
||||||
// perms |= Common::MemoryPermission::Execute;
|
// perms |= Common::MemoryPermission::Execute;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If anything is mapped at the place we're trying to map, unmap it. Then, create our mapping.
|
||||||
|
arena->Unmap(guestVaddr, size, false);
|
||||||
arena->Map(guestVaddr, arenaOffset, size, perms, false);
|
arena->Map(guestVaddr, arenaOffset, size, perms, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ bool Memory::mapCXI(NCSD& ncsd, NCCH& cxi) {
|
||||||
// Total memory to allocate for loading
|
// Total memory to allocate for loading
|
||||||
u32 totalSize = (cxi.text.pageCount + cxi.rodata.pageCount + cxi.data.pageCount) * pageSize + bssSize;
|
u32 totalSize = (cxi.text.pageCount + cxi.rodata.pageCount + cxi.data.pageCount) * pageSize + bssSize;
|
||||||
|
|
||||||
if (code.size() < totalSize) {
|
if (code.size() + bssSize < totalSize) {
|
||||||
Helpers::panic("Total code size as reported by the exheader is larger than the .code file");
|
Helpers::panic("Total code size as reported by the exheader is larger than the .code file");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue