summaryrefslogtreecommitdiffstats
path: root/src/core/loader/xci.cpp
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-09-04 00:57:52 +0200
committerZach Hilman <zachhilman@gmail.com>2018-09-04 22:25:10 +0200
commit23a16c1720ee522f6ac7d1f426a2d4a918ce41c9 (patch)
tree43a69cb7046a768760e5ae20eddfe3b53d3ca7f8 /src/core/loader/xci.cpp
parentnsp: Fix error masking issue with XCI files (diff)
downloadyuzu-23a16c1720ee522f6ac7d1f426a2d4a918ce41c9.tar
yuzu-23a16c1720ee522f6ac7d1f426a2d4a918ce41c9.tar.gz
yuzu-23a16c1720ee522f6ac7d1f426a2d4a918ce41c9.tar.bz2
yuzu-23a16c1720ee522f6ac7d1f426a2d4a918ce41c9.tar.lz
yuzu-23a16c1720ee522f6ac7d1f426a2d4a918ce41c9.tar.xz
yuzu-23a16c1720ee522f6ac7d1f426a2d4a918ce41c9.tar.zst
yuzu-23a16c1720ee522f6ac7d1f426a2d4a918ce41c9.zip
Diffstat (limited to '')
-rw-r--r--src/core/loader/xci.cpp21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/core/loader/xci.cpp b/src/core/loader/xci.cpp
index b01d51abb..16509229f 100644
--- a/src/core/loader/xci.cpp
+++ b/src/core/loader/xci.cpp
@@ -10,6 +10,7 @@
#include "core/file_sys/control_metadata.h"
#include "core/file_sys/patch_manager.h"
#include "core/file_sys/romfs.h"
+#include "core/file_sys/submission_package.h"
#include "core/hle/kernel/process.h"
#include "core/loader/nca.h"
#include "core/loader/xci.h"
@@ -23,27 +24,11 @@ AppLoader_XCI::AppLoader_XCI(FileSys::VirtualFile file)
return;
const auto control_nca = xci->GetNCAByType(FileSys::NCAContentType::Control);
-
if (control_nca == nullptr || control_nca->GetStatus() != ResultStatus::Success)
return;
- 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) {
- icon_file = romfs->GetFile("icon_" + std::string(language) + ".dat");
- if (icon_file != nullptr)
- break;
- }
- const auto nacp_raw = romfs->GetFile("control.nacp");
- if (nacp_raw == nullptr)
- return;
- nacp_file = std::make_shared<FileSys::NACP>(nacp_raw);
+ std::tie(nacp_file, icon_file) =
+ FileSys::PatchManager(xci->GetProgramTitleID()).ParseControlNCA(control_nca);
}
AppLoader_XCI::~AppLoader_XCI() = default;