summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/patch_manager.cpp
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-08-29 04:38:35 +0200
committerZach Hilman <zachhilman@gmail.com>2018-09-04 22:24:02 +0200
commitcbd517d8cc1ba70d149adb57299a62c7a4e5fd72 (patch)
tree39f994f49b20fad537bcc74e0bb7fdb8ef209803 /src/core/file_sys/patch_manager.cpp
parentgame_list: Use friendly game versions (diff)
downloadyuzu-cbd517d8cc1ba70d149adb57299a62c7a4e5fd72.tar
yuzu-cbd517d8cc1ba70d149adb57299a62c7a4e5fd72.tar.gz
yuzu-cbd517d8cc1ba70d149adb57299a62c7a4e5fd72.tar.bz2
yuzu-cbd517d8cc1ba70d149adb57299a62c7a4e5fd72.tar.lz
yuzu-cbd517d8cc1ba70d149adb57299a62c7a4e5fd72.tar.xz
yuzu-cbd517d8cc1ba70d149adb57299a62c7a4e5fd72.tar.zst
yuzu-cbd517d8cc1ba70d149adb57299a62c7a4e5fd72.zip
Diffstat (limited to 'src/core/file_sys/patch_manager.cpp')
-rw-r--r--src/core/file_sys/patch_manager.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp
index 5e853c2c0..8b7d79773 100644
--- a/src/core/file_sys/patch_manager.cpp
+++ b/src/core/file_sys/patch_manager.cpp
@@ -34,6 +34,8 @@ std::string FormatPatchTypeName(PatchType type) {
PatchManager::PatchManager(u64 title_id) : title_id(title_id) {}
VirtualDir PatchManager::PatchExeFS(VirtualDir exefs) const {
+ LOG_INFO(Loader, "Patching ExeFS for title_id={:016X}", title_id);
+
if (exefs == nullptr)
return exefs;
@@ -45,6 +47,8 @@ VirtualDir PatchManager::PatchExeFS(VirtualDir exefs) const {
if (update != nullptr) {
if (update->GetStatus() == Loader::ResultStatus::ErrorMissingBKTRBaseRomFS &&
update->GetExeFS() != nullptr) {
+ LOG_INFO(Loader, " ExeFS: Update ({}) applied successfully",
+ FormatTitleVersion(installed->GetEntryVersion(update_tid).get_value_or(0)));
exefs = update->GetExeFS();
}
}
@@ -52,7 +56,11 @@ VirtualDir PatchManager::PatchExeFS(VirtualDir exefs) const {
return exefs;
}
-VirtualFile PatchManager::PatchRomFS(VirtualFile romfs) const {
+VirtualFile PatchManager::PatchRomFS(VirtualFile romfs, u64 ivfc_offset,
+ ContentRecordType type) const {
+ LOG_INFO(Loader, "Patching RomFS for title_id={:016X}, type={:02X}", title_id,
+ static_cast<u8>(type));
+
if (romfs == nullptr)
return romfs;
@@ -60,11 +68,15 @@ VirtualFile PatchManager::PatchRomFS(VirtualFile romfs) const {
// Game Updates
const auto update_tid = GetUpdateTitleID(title_id);
- const auto update = installed->GetEntryRaw(update_tid, ContentRecordType::Program);
+ const auto update = installed->GetEntryRaw(update_tid, type);
if (update != nullptr) {
- const auto nca = std::make_shared<NCA>(update, romfs);
- if (nca->GetStatus() == Loader::ResultStatus::Success && nca->GetRomFS() != nullptr)
- romfs = nca->GetRomFS();
+ 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 ({}) applied successfully",
+ FormatTitleVersion(installed->GetEntryVersion(update_tid).get_value_or(0)));
+ romfs = new_nca->GetRomFS();
+ }
}
return romfs;