summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2020-09-24 14:55:51 +0200
committerMorph <39850852+Morph1984@users.noreply.github.com>2020-09-24 23:23:14 +0200
commit3602df7f1f58e1009af1f100892f8a439da7d1b6 (patch)
tree4fc6a00cf892e3c9c0ab9a87b463ad9325e28e8c /src/core/file_sys
parentMerge pull request #4678 from Morph1984/LoadOpenContext-partial-impl (diff)
downloadyuzu-3602df7f1f58e1009af1f100892f8a439da7d1b6.tar
yuzu-3602df7f1f58e1009af1f100892f8a439da7d1b6.tar.gz
yuzu-3602df7f1f58e1009af1f100892f8a439da7d1b6.tar.bz2
yuzu-3602df7f1f58e1009af1f100892f8a439da7d1b6.tar.lz
yuzu-3602df7f1f58e1009af1f100892f8a439da7d1b6.tar.xz
yuzu-3602df7f1f58e1009af1f100892f8a439da7d1b6.tar.zst
yuzu-3602df7f1f58e1009af1f100892f8a439da7d1b6.zip
Diffstat (limited to 'src/core/file_sys')
-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) {
}
auto next_nca = std::make_shared<NCA>(std::move(next_file), nullptr, 0);
+
if (next_nca->GetType() == NCAContentType::Program) {
program_status[next_nca->GetTitleId()] = next_nca->GetStatus();
}
- if (next_nca->GetStatus() == Loader::ResultStatus::Success ||
- (next_nca->GetStatus() == Loader::ResultStatus::ErrorMissingBKTRBaseRomFS &&
- (next_nca->GetTitleId() & 0x800) != 0)) {
+
+ if (next_nca->GetStatus() != Loader::ResultStatus::Success &&
+ next_nca->GetStatus() != Loader::ResultStatus::ErrorMissingBKTRBaseRomFS) {
+ continue;
+ }
+
+ // If the last 3 hexadecimal digits of the CNMT TitleID is 0x800 or is missing the
+ // BKTRBaseRomFS, this is an update NCA. Otherwise, this is a base NCA.
+ if ((cnmt.GetTitleID() & 0x800) != 0 ||
+ next_nca->GetStatus() == Loader::ResultStatus::ErrorMissingBKTRBaseRomFS) {
+ // If the last 3 hexadecimal digits of the NCA's TitleID is between 0x1 and
+ // 0x7FF, this is a multi-program update NCA. Otherwise, this is a regular
+ // update NCA.
+ if ((next_nca->GetTitleId() & 0x7FF) != 0 &&
+ (next_nca->GetTitleId() & 0x800) == 0) {
+ ncas[next_nca->GetTitleId()][{cnmt.GetType(), rec.type}] =
+ std::move(next_nca);
+ } else {
+ ncas[cnmt.GetTitleID()][{cnmt.GetType(), rec.type}] = std::move(next_nca);
+ }
+ } else {
ncas[next_nca->GetTitleId()][{cnmt.GetType(), rec.type}] = std::move(next_nca);
}
}