diff options
author | Feng Chen <VonChenPlus@gmail.com> | 2021-07-20 13:10:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-20 01:10:05 -0400 |
commit | 07073734ed3785d1dee487f0c898a645fbd5f03c (patch) | |
tree | e7c72b615b7a551cc1fb8a6a336bce60e5a0d314 /src/core/loader/xci.cpp | |
parent | 16f983d33ae05722a7656ca5a15171ccaa4c602f (diff) |
file_sys: Support load game collection (#6582)
Adds support for loading games with multiple programs embedded within such as the Dragon Quest 1+2+3 Collection
Diffstat (limited to 'src/core/loader/xci.cpp')
-rw-r--r-- | src/core/loader/xci.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/core/loader/xci.cpp b/src/core/loader/xci.cpp index 635d6ae15e..269603eef9 100644 --- a/src/core/loader/xci.cpp +++ b/src/core/loader/xci.cpp @@ -22,9 +22,9 @@ namespace Loader { AppLoader_XCI::AppLoader_XCI(FileSys::VirtualFile file_, const Service::FileSystem::FileSystemController& fsc, - const FileSys::ContentProvider& content_provider, + const FileSys::ContentProvider& content_provider, u64 program_id, std::size_t program_index) - : AppLoader(file_), xci(std::make_unique<FileSys::XCI>(file_, program_index)), + : AppLoader(file_), xci(std::make_unique<FileSys::XCI>(file_, program_id, program_index)), nca_loader(std::make_unique<AppLoader_NCA>(xci->GetProgramNCAFile())) { if (xci->GetStatus() != ResultStatus::Success) { return; @@ -121,6 +121,11 @@ ResultStatus AppLoader_XCI::ReadProgramId(u64& out_program_id) { return nca_loader->ReadProgramId(out_program_id); } +ResultStatus AppLoader_XCI::ReadProgramIds(std::vector<u64>& out_program_ids) { + out_program_ids = xci->GetProgramTitleIDs(); + return ResultStatus::Success; +} + ResultStatus AppLoader_XCI::ReadIcon(std::vector<u8>& buffer) { if (icon_file == nullptr) { return ResultStatus::ErrorNoControl; @@ -149,8 +154,9 @@ ResultStatus AppLoader_XCI::ReadControlData(FileSys::NACP& control) { } ResultStatus AppLoader_XCI::ReadManualRomFS(FileSys::VirtualFile& out_file) { - const auto nca = xci->GetSecurePartitionNSP()->GetNCA(xci->GetProgramTitleID(), - FileSys::ContentRecordType::HtmlDocument); + const auto nca = + xci->GetSecurePartitionNSP()->GetNCA(xci->GetSecurePartitionNSP()->GetProgramTitleID(), + FileSys::ContentRecordType::HtmlDocument); if (xci->GetStatus() != ResultStatus::Success || nca == nullptr) { return ResultStatus::ErrorXCIMissingPartition; } |