diff options
| author | 2018-09-05 18:06:11 -0400 | |
|---|---|---|
| committer | 2018-09-05 18:06:11 -0400 | |
| commit | a6ae7654105fe6ec46ff0bcabb714b8447b83899 (patch) | |
| tree | 0ff4d2396cb0730ec5952181e4e67947b64832ec /src/core/loader/xci.cpp | |
| parent | Merge pull request #1245 from degasus/optimizations (diff) | |
| parent | bktr: Fix bucket overlap error (diff) | |
| download | yuzu-a6ae7654105fe6ec46ff0bcabb714b8447b83899.tar.gz yuzu-a6ae7654105fe6ec46ff0bcabb714b8447b83899.tar.xz yuzu-a6ae7654105fe6ec46ff0bcabb714b8447b83899.zip | |
Merge pull request #1179 from DarkLordZach/bktr
file_sys: Add support for BKTR format (Game Updates)
Diffstat (limited to 'src/core/loader/xci.cpp')
| -rw-r--r-- | src/core/loader/xci.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/core/loader/xci.cpp b/src/core/loader/xci.cpp index 75b998faa..16509229f 100644 --- a/src/core/loader/xci.cpp +++ b/src/core/loader/xci.cpp | |||
| @@ -8,7 +8,9 @@ | |||
| 8 | #include "core/file_sys/card_image.h" | 8 | #include "core/file_sys/card_image.h" |
| 9 | #include "core/file_sys/content_archive.h" | 9 | #include "core/file_sys/content_archive.h" |
| 10 | #include "core/file_sys/control_metadata.h" | 10 | #include "core/file_sys/control_metadata.h" |
| 11 | #include "core/file_sys/patch_manager.h" | ||
| 11 | #include "core/file_sys/romfs.h" | 12 | #include "core/file_sys/romfs.h" |
| 13 | #include "core/file_sys/submission_package.h" | ||
| 12 | #include "core/hle/kernel/process.h" | 14 | #include "core/hle/kernel/process.h" |
| 13 | #include "core/loader/nca.h" | 15 | #include "core/loader/nca.h" |
| 14 | #include "core/loader/xci.h" | 16 | #include "core/loader/xci.h" |
| @@ -20,21 +22,13 @@ AppLoader_XCI::AppLoader_XCI(FileSys::VirtualFile file) | |||
| 20 | nca_loader(std::make_unique<AppLoader_NCA>(xci->GetProgramNCAFile())) { | 22 | nca_loader(std::make_unique<AppLoader_NCA>(xci->GetProgramNCAFile())) { |
| 21 | if (xci->GetStatus() != ResultStatus::Success) | 23 | if (xci->GetStatus() != ResultStatus::Success) |
| 22 | return; | 24 | return; |
| 25 | |||
| 23 | const auto control_nca = xci->GetNCAByType(FileSys::NCAContentType::Control); | 26 | const auto control_nca = xci->GetNCAByType(FileSys::NCAContentType::Control); |
| 24 | if (control_nca == nullptr || control_nca->GetStatus() != ResultStatus::Success) | 27 | if (control_nca == nullptr || control_nca->GetStatus() != ResultStatus::Success) |
| 25 | return; | 28 | return; |
| 26 | const auto romfs = FileSys::ExtractRomFS(control_nca->GetRomFS()); | 29 | |
| 27 | if (romfs == nullptr) | 30 | std::tie(nacp_file, icon_file) = |
| 28 | return; | 31 | FileSys::PatchManager(xci->GetProgramTitleID()).ParseControlNCA(control_nca); |
| 29 | for (const auto& language : FileSys::LANGUAGE_NAMES) { | ||
| 30 | icon_file = romfs->GetFile("icon_" + std::string(language) + ".dat"); | ||
| 31 | if (icon_file != nullptr) | ||
| 32 | break; | ||
| 33 | } | ||
| 34 | const auto nacp_raw = romfs->GetFile("control.nacp"); | ||
| 35 | if (nacp_raw == nullptr) | ||
| 36 | return; | ||
| 37 | nacp_file = std::make_shared<FileSys::NACP>(nacp_raw); | ||
| 38 | } | 32 | } |
| 39 | 33 | ||
| 40 | AppLoader_XCI::~AppLoader_XCI() = default; | 34 | AppLoader_XCI::~AppLoader_XCI() = default; |