mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-20 12:39:13 +12:00
We can almost load commercial carts now
This commit is contained in:
parent
36b0117ebc
commit
87bf469447
5 changed files with 50 additions and 8 deletions
|
@ -67,11 +67,20 @@ std::optional<NCSD> Memory::loadNCSD(const std::filesystem::path& path) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!ncsd.partitions[0].ncch.hasExtendedHeader()) {
|
||||
printf("NCSD's CXI doesn't have exheader?\n");
|
||||
|
||||
auto& cxi = ncsd.partitions[0].ncch;
|
||||
if (!cxi.hasExtendedHeader() || !cxi.hasCode()) {
|
||||
printf("NCSD with an invalid CXI in partition 0?\n");
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
// Map code file to memory
|
||||
const auto& code = cxi.codeFile;
|
||||
printf("Text address = %08X page count = %08X\n", cxi.text.address, cxi.text.size);
|
||||
printf("Rodata address = %08X page count = %08X\n", cxi.rodata.address, cxi.rodata.size);
|
||||
printf("Data address = %08X page count = %08X\n", cxi.data.address, cxi.data.size);
|
||||
|
||||
ncsd.entrypoint = cxi.text.address;
|
||||
|
||||
return ncsd;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue