diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-09-25 15:19:42 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-10-05 14:47:24 +0200 |
commit | d79d4fd764c194e6c8c4d57ed0fd308e401c2f6e (patch) | |
tree | 34769a5391acffa540933e6351a44e9961e80f56 /src/core/file_sys/patch_manager.cpp | |
parent | loader: Add getter for packed update (diff) | |
download | yuzu-d79d4fd764c194e6c8c4d57ed0fd308e401c2f6e.tar yuzu-d79d4fd764c194e6c8c4d57ed0fd308e401c2f6e.tar.gz yuzu-d79d4fd764c194e6c8c4d57ed0fd308e401c2f6e.tar.bz2 yuzu-d79d4fd764c194e6c8c4d57ed0fd308e401c2f6e.tar.lz yuzu-d79d4fd764c194e6c8c4d57ed0fd308e401c2f6e.tar.xz yuzu-d79d4fd764c194e6c8c4d57ed0fd308e401c2f6e.tar.zst yuzu-d79d4fd764c194e6c8c4d57ed0fd308e401c2f6e.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/file_sys/patch_manager.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp index 539698f6e..b43880e92 100644 --- a/src/core/file_sys/patch_manager.cpp +++ b/src/core/file_sys/patch_manager.cpp @@ -184,8 +184,8 @@ static void ApplyLayeredFS(VirtualFile& romfs, u64 title_id, ContentRecordType t romfs = std::move(packed); } -VirtualFile PatchManager::PatchRomFS(VirtualFile romfs, u64 ivfc_offset, - ContentRecordType type) const { +VirtualFile PatchManager::PatchRomFS(VirtualFile romfs, u64 ivfc_offset, ContentRecordType type, + VirtualFile update_raw) const { LOG_INFO(Loader, "Patching RomFS for title_id={:016X}, type={:02X}", title_id, static_cast<u8>(type)); @@ -205,6 +205,13 @@ VirtualFile PatchManager::PatchRomFS(VirtualFile romfs, u64 ivfc_offset, FormatTitleVersion(installed->GetEntryVersion(update_tid).get_value_or(0))); romfs = new_nca->GetRomFS(); } + } else if (update_raw != nullptr) { + const auto new_nca = std::make_shared<NCA>(update, romfs, ivfc_offset); + if (new_nca->GetStatus() == Loader::ResultStatus::Success && + new_nca->GetRomFS() != nullptr) { + LOG_INFO(Loader, " RomFS: Update (XCI) applied successfully"); + romfs = new_nca->GetRomFS(); + } } // LayeredFS @@ -224,7 +231,7 @@ static bool IsDirValidAndNonEmpty(const VirtualDir& dir) { return dir != nullptr && (!dir->GetFiles().empty() || !dir->GetSubdirectories().empty()); } -std::map<std::string, std::string, std::less<>> PatchManager::GetPatchVersionNames() const { +std::map<PatchType, std::string> PatchManager::GetPatchVersionNames(VirtualFile update_raw) const { std::map<std::string, std::string, std::less<>> out; const auto installed = Service::FileSystem::GetUnionContents(); @@ -245,6 +252,8 @@ std::map<std::string, std::string, std::less<>> PatchManager::GetPatchVersionNam "Update", FormatTitleVersion(meta_ver.get(), TitleVersionFormat::ThreeElements)); } + } else if (update_raw != nullptr) { + out[PatchType::Update] = "XCI"; } } |