mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-24 14:25:50 +12:00
Sorry Wunk
This commit is contained in:
parent
d96289cc05
commit
00f0af8771
1 changed files with 10 additions and 3 deletions
|
@ -223,7 +223,10 @@ std::string Memory::readString(u32 address, u32 maxSize) {
|
||||||
|
|
||||||
for (std::size_t i = 0; i < maxSize; ++i) {
|
for (std::size_t i = 0; i < maxSize; ++i) {
|
||||||
char c = read8(address++);
|
char c = read8(address++);
|
||||||
if (c == '\0') break;
|
if (c == '\0') {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
string.push_back(c);
|
string.push_back(c);
|
||||||
}
|
}
|
||||||
string.shrink_to_fit();
|
string.shrink_to_fit();
|
||||||
|
@ -256,7 +259,9 @@ std::optional<u32> Memory::allocateMemory(u32 vaddr, u32 paddr, u32 size, bool l
|
||||||
// Non-linear allocation needs special handling
|
// Non-linear allocation needs special handling
|
||||||
if (paddr == 0 && adjustAddrs) {
|
if (paddr == 0 && adjustAddrs) {
|
||||||
std::optional<u32> newPaddr = findPaddr(size);
|
std::optional<u32> newPaddr = findPaddr(size);
|
||||||
if (!newPaddr.has_value()) Helpers::panic("Failed to find paddr");
|
if (!newPaddr.has_value()) {
|
||||||
|
Helpers::panic("Failed to find paddr");
|
||||||
|
}
|
||||||
|
|
||||||
paddr = newPaddr.value();
|
paddr = newPaddr.value();
|
||||||
assert(paddr + size <= FCRAM_APPLICATION_SIZE || isMap);
|
assert(paddr + size <= FCRAM_APPLICATION_SIZE || isMap);
|
||||||
|
@ -277,7 +282,9 @@ std::optional<u32> Memory::allocateMemory(u32 vaddr, u32 paddr, u32 size, bool l
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isMap) usedUserMemory += size;
|
if (!isMap) {
|
||||||
|
usedUserMemory += size;
|
||||||
|
}
|
||||||
|
|
||||||
// Do linear mapping
|
// Do linear mapping
|
||||||
u32 virtualPage = vaddr >> pageShift;
|
u32 virtualPage = vaddr >> pageShift;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue