summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/file_sys/submission_package.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/core/file_sys/submission_package.cpp b/src/core/file_sys/submission_package.cpp
index aab957bf2..07ae90819 100644
--- a/src/core/file_sys/submission_package.cpp
+++ b/src/core/file_sys/submission_package.cpp
@@ -286,12 +286,31 @@ void NSP::ReadNCAs(const std::vector<VirtualFile>& files) {
286 } 286 }
287 287
288 auto next_nca = std::make_shared<NCA>(std::move(next_file), nullptr, 0); 288 auto next_nca = std::make_shared<NCA>(std::move(next_file), nullptr, 0);
289
289 if (next_nca->GetType() == NCAContentType::Program) { 290 if (next_nca->GetType() == NCAContentType::Program) {
290 program_status[next_nca->GetTitleId()] = next_nca->GetStatus(); 291 program_status[next_nca->GetTitleId()] = next_nca->GetStatus();
291 } 292 }
292 if (next_nca->GetStatus() == Loader::ResultStatus::Success || 293
293 (next_nca->GetStatus() == Loader::ResultStatus::ErrorMissingBKTRBaseRomFS && 294 if (next_nca->GetStatus() != Loader::ResultStatus::Success &&
294 (next_nca->GetTitleId() & 0x800) != 0)) { 295 next_nca->GetStatus() != Loader::ResultStatus::ErrorMissingBKTRBaseRomFS) {
296 continue;
297 }
298
299 // If the last 3 hexadecimal digits of the CNMT TitleID is 0x800 or is missing the
300 // BKTRBaseRomFS, this is an update NCA. Otherwise, this is a base NCA.
301 if ((cnmt.GetTitleID() & 0x800) != 0 ||
302 next_nca->GetStatus() == Loader::ResultStatus::ErrorMissingBKTRBaseRomFS) {
303 // If the last 3 hexadecimal digits of the NCA's TitleID is between 0x1 and
304 // 0x7FF, this is a multi-program update NCA. Otherwise, this is a regular
305 // update NCA.
306 if ((next_nca->GetTitleId() & 0x7FF) != 0 &&
307 (next_nca->GetTitleId() & 0x800) == 0) {
308 ncas[next_nca->GetTitleId()][{cnmt.GetType(), rec.type}] =
309 std::move(next_nca);
310 } else {
311 ncas[cnmt.GetTitleID()][{cnmt.GetType(), rec.type}] = std::move(next_nca);
312 }
313 } else {
295 ncas[next_nca->GetTitleId()][{cnmt.GetType(), rec.type}] = std::move(next_nca); 314 ncas[next_nca->GetTitleId()][{cnmt.GetType(), rec.type}] = std::move(next_nca);
296 } 315 }
297 } 316 }