summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Morph2020-09-17 20:44:51 -0400
committerGravatar Morph2020-09-17 20:44:51 -0400
commit41c2f5200c9b1613e0843df0a54814ffaddddff5 (patch)
treea293dde31a25716a5a94bd565dede8581bd84532 /src
parentMerge pull request #4323 from ReinUsesLisp/no-spin (diff)
downloadyuzu-41c2f5200c9b1613e0843df0a54814ffaddddff5.tar.gz
yuzu-41c2f5200c9b1613e0843df0a54814ffaddddff5.tar.xz
yuzu-41c2f5200c9b1613e0843df0a54814ffaddddff5.zip
submission_package: Account for multi-content NSPs
Previously we assumed a submission package can only contain one Program NCA with a single TitleID. However, Super Mario 3D All-Stars contains four Program NCAs, each with their unique TitleIDs. This accounts for the existence of multi-content games such as this one. - Fixes booting Super Mario 3D All-Stars from the games list.
Diffstat (limited to 'src')
-rw-r--r--src/core/file_sys/submission_package.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/file_sys/submission_package.cpp b/src/core/file_sys/submission_package.cpp
index b9ce93b7c..aab957bf2 100644
--- a/src/core/file_sys/submission_package.cpp
+++ b/src/core/file_sys/submission_package.cpp
@@ -267,9 +267,9 @@ void NSP::ReadNCAs(const std::vector<VirtualFile>& files) {
267 } 267 }
268 268
269 const CNMT cnmt(inner_file); 269 const CNMT cnmt(inner_file);
270 auto& ncas_title = ncas[cnmt.GetTitleID()];
271 270
272 ncas_title[{cnmt.GetType(), ContentRecordType::Meta}] = nca; 271 ncas[cnmt.GetTitleID()][{cnmt.GetType(), ContentRecordType::Meta}] = nca;
272
273 for (const auto& rec : cnmt.GetContentRecords()) { 273 for (const auto& rec : cnmt.GetContentRecords()) {
274 const auto id_string = Common::HexToString(rec.nca_id, false); 274 const auto id_string = Common::HexToString(rec.nca_id, false);
275 auto next_file = pfs->GetFile(fmt::format("{}.nca", id_string)); 275 auto next_file = pfs->GetFile(fmt::format("{}.nca", id_string));
@@ -287,12 +287,12 @@ void NSP::ReadNCAs(const std::vector<VirtualFile>& files) {
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 if (next_nca->GetType() == NCAContentType::Program) { 289 if (next_nca->GetType() == NCAContentType::Program) {
290 program_status[cnmt.GetTitleID()] = next_nca->GetStatus(); 290 program_status[next_nca->GetTitleId()] = next_nca->GetStatus();
291 } 291 }
292 if (next_nca->GetStatus() == Loader::ResultStatus::Success || 292 if (next_nca->GetStatus() == Loader::ResultStatus::Success ||
293 (next_nca->GetStatus() == Loader::ResultStatus::ErrorMissingBKTRBaseRomFS && 293 (next_nca->GetStatus() == Loader::ResultStatus::ErrorMissingBKTRBaseRomFS &&
294 (cnmt.GetTitleID() & 0x800) != 0)) { 294 (next_nca->GetTitleId() & 0x800) != 0)) {
295 ncas_title[{cnmt.GetType(), rec.type}] = std::move(next_nca); 295 ncas[next_nca->GetTitleId()][{cnmt.GetType(), rec.type}] = std::move(next_nca);
296 } 296 }
297 } 297 }
298 298