diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-09-01 19:11:30 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-09-04 22:24:02 +0200 |
commit | c91b60a421a3bd0dc85d80e0a5a2d261370df340 (patch) | |
tree | cc4867bcef325b7e7b4d268f29705e38fd3ca180 /src/core/loader/xci.cpp | |
parent | bktr: Add logging on successful patch (diff) | |
download | yuzu-c91b60a421a3bd0dc85d80e0a5a2d261370df340.tar yuzu-c91b60a421a3bd0dc85d80e0a5a2d261370df340.tar.gz yuzu-c91b60a421a3bd0dc85d80e0a5a2d261370df340.tar.bz2 yuzu-c91b60a421a3bd0dc85d80e0a5a2d261370df340.tar.lz yuzu-c91b60a421a3bd0dc85d80e0a5a2d261370df340.tar.xz yuzu-c91b60a421a3bd0dc85d80e0a5a2d261370df340.tar.zst yuzu-c91b60a421a3bd0dc85d80e0a5a2d261370df340.zip |
Diffstat (limited to 'src/core/loader/xci.cpp')
-rw-r--r-- | src/core/loader/xci.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/core/loader/xci.cpp b/src/core/loader/xci.cpp index 75b998faa..b01d51abb 100644 --- a/src/core/loader/xci.cpp +++ b/src/core/loader/xci.cpp @@ -8,6 +8,7 @@ #include "core/file_sys/card_image.h" #include "core/file_sys/content_archive.h" #include "core/file_sys/control_metadata.h" +#include "core/file_sys/patch_manager.h" #include "core/file_sys/romfs.h" #include "core/hle/kernel/process.h" #include "core/loader/nca.h" @@ -20,10 +21,18 @@ AppLoader_XCI::AppLoader_XCI(FileSys::VirtualFile file) nca_loader(std::make_unique<AppLoader_NCA>(xci->GetProgramNCAFile())) { if (xci->GetStatus() != ResultStatus::Success) return; + const auto control_nca = xci->GetNCAByType(FileSys::NCAContentType::Control); + if (control_nca == nullptr || control_nca->GetStatus() != ResultStatus::Success) return; - const auto romfs = FileSys::ExtractRomFS(control_nca->GetRomFS()); + + auto romfs_raw = control_nca->GetRomFS(); + FileSys::PatchManager patch{xci->GetNCAByType(FileSys::NCAContentType::Program)->GetTitleId()}; + romfs_raw = patch.PatchRomFS(romfs_raw, control_nca->GetBaseIVFCOffset(), + FileSys::ContentRecordType::Control); + + const auto romfs = FileSys::ExtractRomFS(romfs_raw); if (romfs == nullptr) return; for (const auto& language : FileSys::LANGUAGE_NAMES) { |