diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-11-20 23:51:00 +0100 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-11-20 23:51:00 +0100 |
commit | da6d4cde567695d22fefc152d2d913f54e5ece68 (patch) | |
tree | e57ea6b05aeac098a2fc63d35ceedec4d77b521a | |
parent | settings: Add option to dump ExeFS of games upon launch (diff) | |
download | yuzu-da6d4cde567695d22fefc152d2d913f54e5ece68.tar yuzu-da6d4cde567695d22fefc152d2d913f54e5ece68.tar.gz yuzu-da6d4cde567695d22fefc152d2d913f54e5ece68.tar.bz2 yuzu-da6d4cde567695d22fefc152d2d913f54e5ece68.tar.lz yuzu-da6d4cde567695d22fefc152d2d913f54e5ece68.tar.xz yuzu-da6d4cde567695d22fefc152d2d913f54e5ece68.tar.zst yuzu-da6d4cde567695d22fefc152d2d913f54e5ece68.zip |
-rw-r--r-- | src/core/file_sys/patch_manager.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp index f56b1c773..ccc4f3061 100644 --- a/src/core/file_sys/patch_manager.cpp +++ b/src/core/file_sys/patch_manager.cpp @@ -79,6 +79,31 @@ VirtualDir PatchManager::PatchExeFS(VirtualDir exefs) const { exefs = update->GetExeFS(); } + // LayeredExeFS + const auto load_dir = Service::FileSystem::GetModificationLoadRoot(title_id); + if (load_dir != nullptr && load_dir->GetSize() > 0) { + + auto patch_dirs = load_dir->GetSubdirectories(); + std::sort( + patch_dirs.begin(), patch_dirs.end(), + [](const VirtualDir& l, const VirtualDir& r) { return l->GetName() < r->GetName(); }); + + std::vector<VirtualDir> layers; + layers.reserve(patch_dirs.size() + 1); + for (const auto& subdir : patch_dirs) { + auto exefs_dir = subdir->GetSubdirectory("exefs"); + if (exefs_dir != nullptr) + layers.push_back(std::move(exefs_dir)); + } + layers.push_back(exefs); + + auto layered = LayeredVfsDirectory::MakeLayeredDirectory(std::move(layers)); + if (layered != nullptr) { + LOG_INFO(Loader, " ExeFS: LayeredExeFS patches applied successfully"); + exefs = std::move(layered); + } + } + return exefs; } |