mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-06 22:25:41 +12:00
Fix printing
This commit is contained in:
parent
c33d7e5dfb
commit
cd168bca56
2 changed files with 1 additions and 3 deletions
|
@ -14,6 +14,7 @@ std::optional<u32> Memory::loadELF(std::filesystem::path& path) {
|
||||||
|
|
||||||
auto segNum = reader.segments.size();
|
auto segNum = reader.segments.size();
|
||||||
printf("Number of segments: %d\n", segNum);
|
printf("Number of segments: %d\n", segNum);
|
||||||
|
printf(" # Perms Vaddr File Size Mem Size\n");
|
||||||
for (int i = 0; i < segNum; ++i) {
|
for (int i = 0; i < segNum; ++i) {
|
||||||
const auto seg = reader.segments[i];
|
const auto seg = reader.segments[i];
|
||||||
const auto flags = seg->get_flags();
|
const auto flags = seg->get_flags();
|
||||||
|
@ -27,7 +28,6 @@ std::optional<u32> Memory::loadELF(std::filesystem::path& path) {
|
||||||
const bool w = (flags & 0b010) != 0;
|
const bool w = (flags & 0b010) != 0;
|
||||||
const bool x = (flags & 0b001) != 0;
|
const bool x = (flags & 0b001) != 0;
|
||||||
|
|
||||||
printf(" # Perms Vaddr File Size Mem Size\n");
|
|
||||||
printf("[%d] (%c%c%c)\t%08X\t%08X\t%08X\n", i, r ? 'r' : '-', w ? 'w' : '-', x ? 'x' : '-', vaddr, fileSize, memorySize);
|
printf("[%d] (%c%c%c)\t%08X\t%08X\t%08X\n", i, r ? 'r' : '-', w ? 'w' : '-', x ? 'x' : '-', vaddr, fileSize, memorySize);
|
||||||
|
|
||||||
// Assert that the segment will be loaded in the executable region. If it isn't then panic.
|
// Assert that the segment will be loaded in the executable region. If it isn't then panic.
|
||||||
|
|
|
@ -46,7 +46,6 @@ u32 Memory::read32(u32 vaddr) {
|
||||||
|
|
||||||
uintptr_t pointer = readTable[page];
|
uintptr_t pointer = readTable[page];
|
||||||
if (pointer != 0) [[likely]] {
|
if (pointer != 0) [[likely]] {
|
||||||
printf("Read %08X from %08X\n", *(u32*)(pointer + offset), vaddr);
|
|
||||||
return *(u32*)(pointer + offset);
|
return *(u32*)(pointer + offset);
|
||||||
} else {
|
} else {
|
||||||
Helpers::panic("Unimplemented 32-bit read, addr: %08X", vaddr);
|
Helpers::panic("Unimplemented 32-bit read, addr: %08X", vaddr);
|
||||||
|
@ -67,7 +66,6 @@ void Memory::write32(u32 vaddr, u32 value) {
|
||||||
|
|
||||||
uintptr_t pointer = writeTable[page];
|
uintptr_t pointer = writeTable[page];
|
||||||
if (pointer != 0) [[likely]] {
|
if (pointer != 0) [[likely]] {
|
||||||
printf("Wrote %08X to %08X\n", value, vaddr);
|
|
||||||
*(u32*)(pointer + offset) = value;
|
*(u32*)(pointer + offset) = value;
|
||||||
} else {
|
} else {
|
||||||
Helpers::panic("Unimplemented 32-bit write, addr: %08X, val: %08X", vaddr, value);
|
Helpers::panic("Unimplemented 32-bit write, addr: %08X, val: %08X", vaddr, value);
|
||||||
|
|
Loading…
Add table
Reference in a new issue