mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-20 12:39:13 +12:00
[NCSD/NCCH] More NCSD parsing
This commit is contained in:
parent
6b6cc7ca2f
commit
71cc187f93
3 changed files with 75 additions and 10 deletions
|
@ -42,9 +42,13 @@ std::optional<NCSD> Memory::loadNCSD(const std::filesystem::path& path) {
|
|||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
auto& partition = ncsd.partitions[i];
|
||||
NCCH& ncch = partition.ncch;
|
||||
partition.offset = u64(partitionData[i * 2]) * NCSD::mediaUnit;
|
||||
partition.length = u64(partitionData[i * 2 + 1]) * NCSD::mediaUnit;
|
||||
|
||||
ncch.partitionIndex = i;
|
||||
ncch.fileOffset = partition.offset;
|
||||
|
||||
if (partition.length != 0) { // Initialize the NCCH of each partition
|
||||
ncsd.file.seek(partition.offset);
|
||||
|
||||
|
@ -57,7 +61,7 @@ std::optional<NCSD> Memory::loadNCSD(const std::filesystem::path& path) {
|
|||
return std::nullopt;
|
||||
}
|
||||
|
||||
if (!partition.ncch.loadFromHeader(ncchHeader)) {
|
||||
if (!ncch.loadFromHeader(ncchHeader, ncsd.file)) {
|
||||
printf("Invalid NCCH partition\n");
|
||||
return std::nullopt;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue