diff options
Diffstat (limited to 'src')
| -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 { | |||
| 79 | exefs = update->GetExeFS(); | 79 | exefs = update->GetExeFS(); |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | // LayeredExeFS | ||
| 83 | const auto load_dir = Service::FileSystem::GetModificationLoadRoot(title_id); | ||
| 84 | if (load_dir != nullptr && load_dir->GetSize() > 0) { | ||
| 85 | |||
| 86 | auto patch_dirs = load_dir->GetSubdirectories(); | ||
| 87 | std::sort( | ||
| 88 | patch_dirs.begin(), patch_dirs.end(), | ||
| 89 | [](const VirtualDir& l, const VirtualDir& r) { return l->GetName() < r->GetName(); }); | ||
| 90 | |||
| 91 | std::vector<VirtualDir> layers; | ||
| 92 | layers.reserve(patch_dirs.size() + 1); | ||
| 93 | for (const auto& subdir : patch_dirs) { | ||
| 94 | auto exefs_dir = subdir->GetSubdirectory("exefs"); | ||
| 95 | if (exefs_dir != nullptr) | ||
| 96 | layers.push_back(std::move(exefs_dir)); | ||
| 97 | } | ||
| 98 | layers.push_back(exefs); | ||
| 99 | |||
| 100 | auto layered = LayeredVfsDirectory::MakeLayeredDirectory(std::move(layers)); | ||
| 101 | if (layered != nullptr) { | ||
| 102 | LOG_INFO(Loader, " ExeFS: LayeredExeFS patches applied successfully"); | ||
| 103 | exefs = std::move(layered); | ||
| 104 | } | ||
| 105 | } | ||
| 106 | |||
| 82 | return exefs; | 107 | return exefs; |
| 83 | } | 108 | } |
| 84 | 109 | ||