diff options
| author | 2020-11-21 22:12:34 -0800 | |
|---|---|---|
| committer | 2020-11-21 22:12:34 -0800 | |
| commit | 3a85bc1e771b8c11728b6535710e21dc092b6732 (patch) | |
| tree | be80bf80153857db46a24de4b34a7d8bbac7a0ae /src/core/file_sys | |
| parent | Merge pull request #4954 from lioncash/compare (diff) | |
| parent | patch_manager: Remove usages of the global system instance (diff) | |
| download | yuzu-3a85bc1e771b8c11728b6535710e21dc092b6732.tar.gz yuzu-3a85bc1e771b8c11728b6535710e21dc092b6732.tar.xz yuzu-3a85bc1e771b8c11728b6535710e21dc092b6732.zip | |
Merge pull request #4944 from lioncash/system-rem
patch_manager: Remove usages of the global system instance
Diffstat (limited to 'src/core/file_sys')
| -rw-r--r-- | src/core/file_sys/patch_manager.cpp | 81 | ||||
| -rw-r--r-- | src/core/file_sys/patch_manager.h | 13 | ||||
| -rw-r--r-- | src/core/file_sys/romfs_factory.cpp | 6 |
3 files changed, 52 insertions, 48 deletions
diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp index 807b05821..e9d1607d0 100644 --- a/src/core/file_sys/patch_manager.cpp +++ b/src/core/file_sys/patch_manager.cpp | |||
| @@ -112,7 +112,10 @@ bool IsDirValidAndNonEmpty(const VirtualDir& dir) { | |||
| 112 | } | 112 | } |
| 113 | } // Anonymous namespace | 113 | } // Anonymous namespace |
| 114 | 114 | ||
| 115 | PatchManager::PatchManager(u64 title_id) : title_id(title_id) {} | 115 | PatchManager::PatchManager(u64 title_id_, |
| 116 | const Service::FileSystem::FileSystemController& fs_controller_, | ||
| 117 | const ContentProvider& content_provider_) | ||
| 118 | : title_id{title_id_}, fs_controller{fs_controller_}, content_provider{content_provider_} {} | ||
| 116 | 119 | ||
| 117 | PatchManager::~PatchManager() = default; | 120 | PatchManager::~PatchManager() = default; |
| 118 | 121 | ||
| @@ -128,34 +131,30 @@ VirtualDir PatchManager::PatchExeFS(VirtualDir exefs) const { | |||
| 128 | 131 | ||
| 129 | if (Settings::values.dump_exefs) { | 132 | if (Settings::values.dump_exefs) { |
| 130 | LOG_INFO(Loader, "Dumping ExeFS for title_id={:016X}", title_id); | 133 | LOG_INFO(Loader, "Dumping ExeFS for title_id={:016X}", title_id); |
| 131 | const auto dump_dir = | 134 | const auto dump_dir = fs_controller.GetModificationDumpRoot(title_id); |
| 132 | Core::System::GetInstance().GetFileSystemController().GetModificationDumpRoot(title_id); | ||
| 133 | if (dump_dir != nullptr) { | 135 | if (dump_dir != nullptr) { |
| 134 | const auto exefs_dir = GetOrCreateDirectoryRelative(dump_dir, "/exefs"); | 136 | const auto exefs_dir = GetOrCreateDirectoryRelative(dump_dir, "/exefs"); |
| 135 | VfsRawCopyD(exefs, exefs_dir); | 137 | VfsRawCopyD(exefs, exefs_dir); |
| 136 | } | 138 | } |
| 137 | } | 139 | } |
| 138 | 140 | ||
| 139 | const auto& installed = Core::System::GetInstance().GetContentProvider(); | ||
| 140 | |||
| 141 | const auto& disabled = Settings::values.disabled_addons[title_id]; | 141 | const auto& disabled = Settings::values.disabled_addons[title_id]; |
| 142 | const auto update_disabled = | 142 | const auto update_disabled = |
| 143 | std::find(disabled.cbegin(), disabled.cend(), "Update") != disabled.cend(); | 143 | std::find(disabled.cbegin(), disabled.cend(), "Update") != disabled.cend(); |
| 144 | 144 | ||
| 145 | // Game Updates | 145 | // Game Updates |
| 146 | const auto update_tid = GetUpdateTitleID(title_id); | 146 | const auto update_tid = GetUpdateTitleID(title_id); |
| 147 | const auto update = installed.GetEntry(update_tid, ContentRecordType::Program); | 147 | const auto update = content_provider.GetEntry(update_tid, ContentRecordType::Program); |
| 148 | 148 | ||
| 149 | if (!update_disabled && update != nullptr && update->GetExeFS() != nullptr && | 149 | if (!update_disabled && update != nullptr && update->GetExeFS() != nullptr && |
| 150 | update->GetStatus() == Loader::ResultStatus::ErrorMissingBKTRBaseRomFS) { | 150 | update->GetStatus() == Loader::ResultStatus::ErrorMissingBKTRBaseRomFS) { |
| 151 | LOG_INFO(Loader, " ExeFS: Update ({}) applied successfully", | 151 | LOG_INFO(Loader, " ExeFS: Update ({}) applied successfully", |
| 152 | FormatTitleVersion(installed.GetEntryVersion(update_tid).value_or(0))); | 152 | FormatTitleVersion(content_provider.GetEntryVersion(update_tid).value_or(0))); |
| 153 | exefs = update->GetExeFS(); | 153 | exefs = update->GetExeFS(); |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | // LayeredExeFS | 156 | // LayeredExeFS |
| 157 | const auto load_dir = | 157 | const auto load_dir = fs_controller.GetModificationLoadRoot(title_id); |
| 158 | Core::System::GetInstance().GetFileSystemController().GetModificationLoadRoot(title_id); | ||
| 159 | if (load_dir != nullptr && load_dir->GetSize() > 0) { | 158 | if (load_dir != nullptr && load_dir->GetSize() > 0) { |
| 160 | auto patch_dirs = load_dir->GetSubdirectories(); | 159 | auto patch_dirs = load_dir->GetSubdirectories(); |
| 161 | std::sort( | 160 | std::sort( |
| @@ -241,8 +240,7 @@ std::vector<u8> PatchManager::PatchNSO(const std::vector<u8>& nso, const std::st | |||
| 241 | if (Settings::values.dump_nso) { | 240 | if (Settings::values.dump_nso) { |
| 242 | LOG_INFO(Loader, "Dumping NSO for name={}, build_id={}, title_id={:016X}", name, build_id, | 241 | LOG_INFO(Loader, "Dumping NSO for name={}, build_id={}, title_id={:016X}", name, build_id, |
| 243 | title_id); | 242 | title_id); |
| 244 | const auto dump_dir = | 243 | const auto dump_dir = fs_controller.GetModificationDumpRoot(title_id); |
| 245 | Core::System::GetInstance().GetFileSystemController().GetModificationDumpRoot(title_id); | ||
| 246 | if (dump_dir != nullptr) { | 244 | if (dump_dir != nullptr) { |
| 247 | const auto nso_dir = GetOrCreateDirectoryRelative(dump_dir, "/nso"); | 245 | const auto nso_dir = GetOrCreateDirectoryRelative(dump_dir, "/nso"); |
| 248 | const auto file = nso_dir->CreateFile(fmt::format("{}-{}.nso", name, build_id)); | 246 | const auto file = nso_dir->CreateFile(fmt::format("{}-{}.nso", name, build_id)); |
| @@ -254,8 +252,7 @@ std::vector<u8> PatchManager::PatchNSO(const std::vector<u8>& nso, const std::st | |||
| 254 | 252 | ||
| 255 | LOG_INFO(Loader, "Patching NSO for name={}, build_id={}", name, build_id); | 253 | LOG_INFO(Loader, "Patching NSO for name={}, build_id={}", name, build_id); |
| 256 | 254 | ||
| 257 | const auto load_dir = | 255 | const auto load_dir = fs_controller.GetModificationLoadRoot(title_id); |
| 258 | Core::System::GetInstance().GetFileSystemController().GetModificationLoadRoot(title_id); | ||
| 259 | if (load_dir == nullptr) { | 256 | if (load_dir == nullptr) { |
| 260 | LOG_ERROR(Loader, "Cannot load mods for invalid title_id={:016X}", title_id); | 257 | LOG_ERROR(Loader, "Cannot load mods for invalid title_id={:016X}", title_id); |
| 261 | return nso; | 258 | return nso; |
| @@ -298,8 +295,7 @@ bool PatchManager::HasNSOPatch(const BuildID& build_id_) const { | |||
| 298 | 295 | ||
| 299 | LOG_INFO(Loader, "Querying NSO patch existence for build_id={}", build_id); | 296 | LOG_INFO(Loader, "Querying NSO patch existence for build_id={}", build_id); |
| 300 | 297 | ||
| 301 | const auto load_dir = | 298 | const auto load_dir = fs_controller.GetModificationLoadRoot(title_id); |
| 302 | Core::System::GetInstance().GetFileSystemController().GetModificationLoadRoot(title_id); | ||
| 303 | if (load_dir == nullptr) { | 299 | if (load_dir == nullptr) { |
| 304 | LOG_ERROR(Loader, "Cannot load mods for invalid title_id={:016X}", title_id); | 300 | LOG_ERROR(Loader, "Cannot load mods for invalid title_id={:016X}", title_id); |
| 305 | return false; | 301 | return false; |
| @@ -313,8 +309,8 @@ bool PatchManager::HasNSOPatch(const BuildID& build_id_) const { | |||
| 313 | } | 309 | } |
| 314 | 310 | ||
| 315 | std::vector<Core::Memory::CheatEntry> PatchManager::CreateCheatList( | 311 | std::vector<Core::Memory::CheatEntry> PatchManager::CreateCheatList( |
| 316 | const Core::System& system, const BuildID& build_id_) const { | 312 | const BuildID& build_id_) const { |
| 317 | const auto load_dir = system.GetFileSystemController().GetModificationLoadRoot(title_id); | 313 | const auto load_dir = fs_controller.GetModificationLoadRoot(title_id); |
| 318 | if (load_dir == nullptr) { | 314 | if (load_dir == nullptr) { |
| 319 | LOG_ERROR(Loader, "Cannot load mods for invalid title_id={:016X}", title_id); | 315 | LOG_ERROR(Loader, "Cannot load mods for invalid title_id={:016X}", title_id); |
| 320 | return {}; | 316 | return {}; |
| @@ -347,9 +343,9 @@ std::vector<Core::Memory::CheatEntry> PatchManager::CreateCheatList( | |||
| 347 | return out; | 343 | return out; |
| 348 | } | 344 | } |
| 349 | 345 | ||
| 350 | static void ApplyLayeredFS(VirtualFile& romfs, u64 title_id, ContentRecordType type) { | 346 | static void ApplyLayeredFS(VirtualFile& romfs, u64 title_id, ContentRecordType type, |
| 351 | const auto load_dir = | 347 | const Service::FileSystem::FileSystemController& fs_controller) { |
| 352 | Core::System::GetInstance().GetFileSystemController().GetModificationLoadRoot(title_id); | 348 | const auto load_dir = fs_controller.GetModificationLoadRoot(title_id); |
| 353 | if ((type != ContentRecordType::Program && type != ContentRecordType::Data) || | 349 | if ((type != ContentRecordType::Program && type != ContentRecordType::Data) || |
| 354 | load_dir == nullptr || load_dir->GetSize() <= 0) { | 350 | load_dir == nullptr || load_dir->GetSize() <= 0) { |
| 355 | return; | 351 | return; |
| @@ -411,19 +407,19 @@ VirtualFile PatchManager::PatchRomFS(VirtualFile romfs, u64 ivfc_offset, Content | |||
| 411 | const auto log_string = fmt::format("Patching RomFS for title_id={:016X}, type={:02X}", | 407 | const auto log_string = fmt::format("Patching RomFS for title_id={:016X}, type={:02X}", |
| 412 | title_id, static_cast<u8>(type)); | 408 | title_id, static_cast<u8>(type)); |
| 413 | 409 | ||
| 414 | if (type == ContentRecordType::Program || type == ContentRecordType::Data) | 410 | if (type == ContentRecordType::Program || type == ContentRecordType::Data) { |
| 415 | LOG_INFO(Loader, "{}", log_string); | 411 | LOG_INFO(Loader, "{}", log_string); |
| 416 | else | 412 | } else { |
| 417 | LOG_DEBUG(Loader, "{}", log_string); | 413 | LOG_DEBUG(Loader, "{}", log_string); |
| 414 | } | ||
| 418 | 415 | ||
| 419 | if (romfs == nullptr) | 416 | if (romfs == nullptr) { |
| 420 | return romfs; | 417 | return romfs; |
| 421 | 418 | } | |
| 422 | const auto& installed = Core::System::GetInstance().GetContentProvider(); | ||
| 423 | 419 | ||
| 424 | // Game Updates | 420 | // Game Updates |
| 425 | const auto update_tid = GetUpdateTitleID(title_id); | 421 | const auto update_tid = GetUpdateTitleID(title_id); |
| 426 | const auto update = installed.GetEntryRaw(update_tid, type); | 422 | const auto update = content_provider.GetEntryRaw(update_tid, type); |
| 427 | 423 | ||
| 428 | const auto& disabled = Settings::values.disabled_addons[title_id]; | 424 | const auto& disabled = Settings::values.disabled_addons[title_id]; |
| 429 | const auto update_disabled = | 425 | const auto update_disabled = |
| @@ -434,7 +430,7 @@ VirtualFile PatchManager::PatchRomFS(VirtualFile romfs, u64 ivfc_offset, Content | |||
| 434 | if (new_nca->GetStatus() == Loader::ResultStatus::Success && | 430 | if (new_nca->GetStatus() == Loader::ResultStatus::Success && |
| 435 | new_nca->GetRomFS() != nullptr) { | 431 | new_nca->GetRomFS() != nullptr) { |
| 436 | LOG_INFO(Loader, " RomFS: Update ({}) applied successfully", | 432 | LOG_INFO(Loader, " RomFS: Update ({}) applied successfully", |
| 437 | FormatTitleVersion(installed.GetEntryVersion(update_tid).value_or(0))); | 433 | FormatTitleVersion(content_provider.GetEntryVersion(update_tid).value_or(0))); |
| 438 | romfs = new_nca->GetRomFS(); | 434 | romfs = new_nca->GetRomFS(); |
| 439 | } | 435 | } |
| 440 | } else if (!update_disabled && update_raw != nullptr) { | 436 | } else if (!update_disabled && update_raw != nullptr) { |
| @@ -447,7 +443,7 @@ VirtualFile PatchManager::PatchRomFS(VirtualFile romfs, u64 ivfc_offset, Content | |||
| 447 | } | 443 | } |
| 448 | 444 | ||
| 449 | // LayeredFS | 445 | // LayeredFS |
| 450 | ApplyLayeredFS(romfs, title_id, type); | 446 | ApplyLayeredFS(romfs, title_id, type, fs_controller); |
| 451 | 447 | ||
| 452 | return romfs; | 448 | return romfs; |
| 453 | } | 449 | } |
| @@ -458,12 +454,11 @@ PatchManager::PatchVersionNames PatchManager::GetPatchVersionNames(VirtualFile u | |||
| 458 | } | 454 | } |
| 459 | 455 | ||
| 460 | std::map<std::string, std::string, std::less<>> out; | 456 | std::map<std::string, std::string, std::less<>> out; |
| 461 | const auto& installed = Core::System::GetInstance().GetContentProvider(); | ||
| 462 | const auto& disabled = Settings::values.disabled_addons[title_id]; | 457 | const auto& disabled = Settings::values.disabled_addons[title_id]; |
| 463 | 458 | ||
| 464 | // Game Updates | 459 | // Game Updates |
| 465 | const auto update_tid = GetUpdateTitleID(title_id); | 460 | const auto update_tid = GetUpdateTitleID(title_id); |
| 466 | PatchManager update{update_tid}; | 461 | PatchManager update{update_tid, fs_controller, content_provider}; |
| 467 | const auto metadata = update.GetControlMetadata(); | 462 | const auto metadata = update.GetControlMetadata(); |
| 468 | const auto& nacp = metadata.first; | 463 | const auto& nacp = metadata.first; |
| 469 | 464 | ||
| @@ -474,8 +469,8 @@ PatchManager::PatchVersionNames PatchManager::GetPatchVersionNames(VirtualFile u | |||
| 474 | if (nacp != nullptr) { | 469 | if (nacp != nullptr) { |
| 475 | out.insert_or_assign(update_label, nacp->GetVersionString()); | 470 | out.insert_or_assign(update_label, nacp->GetVersionString()); |
| 476 | } else { | 471 | } else { |
| 477 | if (installed.HasEntry(update_tid, ContentRecordType::Program)) { | 472 | if (content_provider.HasEntry(update_tid, ContentRecordType::Program)) { |
| 478 | const auto meta_ver = installed.GetEntryVersion(update_tid); | 473 | const auto meta_ver = content_provider.GetEntryVersion(update_tid); |
| 479 | if (meta_ver.value_or(0) == 0) { | 474 | if (meta_ver.value_or(0) == 0) { |
| 480 | out.insert_or_assign(update_label, ""); | 475 | out.insert_or_assign(update_label, ""); |
| 481 | } else { | 476 | } else { |
| @@ -487,8 +482,7 @@ PatchManager::PatchVersionNames PatchManager::GetPatchVersionNames(VirtualFile u | |||
| 487 | } | 482 | } |
| 488 | 483 | ||
| 489 | // General Mods (LayeredFS and IPS) | 484 | // General Mods (LayeredFS and IPS) |
| 490 | const auto mod_dir = | 485 | const auto mod_dir = fs_controller.GetModificationLoadRoot(title_id); |
| 491 | Core::System::GetInstance().GetFileSystemController().GetModificationLoadRoot(title_id); | ||
| 492 | if (mod_dir != nullptr && mod_dir->GetSize() > 0) { | 486 | if (mod_dir != nullptr && mod_dir->GetSize() > 0) { |
| 493 | for (const auto& mod : mod_dir->GetSubdirectories()) { | 487 | for (const auto& mod : mod_dir->GetSubdirectories()) { |
| 494 | std::string types; | 488 | std::string types; |
| @@ -532,13 +526,15 @@ PatchManager::PatchVersionNames PatchManager::GetPatchVersionNames(VirtualFile u | |||
| 532 | } | 526 | } |
| 533 | 527 | ||
| 534 | // DLC | 528 | // DLC |
| 535 | const auto dlc_entries = installed.ListEntriesFilter(TitleType::AOC, ContentRecordType::Data); | 529 | const auto dlc_entries = |
| 530 | content_provider.ListEntriesFilter(TitleType::AOC, ContentRecordType::Data); | ||
| 536 | std::vector<ContentProviderEntry> dlc_match; | 531 | std::vector<ContentProviderEntry> dlc_match; |
| 537 | dlc_match.reserve(dlc_entries.size()); | 532 | dlc_match.reserve(dlc_entries.size()); |
| 538 | std::copy_if(dlc_entries.begin(), dlc_entries.end(), std::back_inserter(dlc_match), | 533 | std::copy_if(dlc_entries.begin(), dlc_entries.end(), std::back_inserter(dlc_match), |
| 539 | [this, &installed](const ContentProviderEntry& entry) { | 534 | [this](const ContentProviderEntry& entry) { |
| 540 | return (entry.title_id & DLC_BASE_TITLE_ID_MASK) == title_id && | 535 | return (entry.title_id & DLC_BASE_TITLE_ID_MASK) == title_id && |
| 541 | installed.GetEntry(entry)->GetStatus() == Loader::ResultStatus::Success; | 536 | content_provider.GetEntry(entry)->GetStatus() == |
| 537 | Loader::ResultStatus::Success; | ||
| 542 | }); | 538 | }); |
| 543 | if (!dlc_match.empty()) { | 539 | if (!dlc_match.empty()) { |
| 544 | // Ensure sorted so DLC IDs show in order. | 540 | // Ensure sorted so DLC IDs show in order. |
| @@ -559,19 +555,16 @@ PatchManager::PatchVersionNames PatchManager::GetPatchVersionNames(VirtualFile u | |||
| 559 | } | 555 | } |
| 560 | 556 | ||
| 561 | std::optional<u32> PatchManager::GetGameVersion() const { | 557 | std::optional<u32> PatchManager::GetGameVersion() const { |
| 562 | const auto& installed = Core::System::GetInstance().GetContentProvider(); | ||
| 563 | const auto update_tid = GetUpdateTitleID(title_id); | 558 | const auto update_tid = GetUpdateTitleID(title_id); |
| 564 | if (installed.HasEntry(update_tid, ContentRecordType::Program)) { | 559 | if (content_provider.HasEntry(update_tid, ContentRecordType::Program)) { |
| 565 | return installed.GetEntryVersion(update_tid); | 560 | return content_provider.GetEntryVersion(update_tid); |
| 566 | } | 561 | } |
| 567 | 562 | ||
| 568 | return installed.GetEntryVersion(title_id); | 563 | return content_provider.GetEntryVersion(title_id); |
| 569 | } | 564 | } |
| 570 | 565 | ||
| 571 | PatchManager::Metadata PatchManager::GetControlMetadata() const { | 566 | PatchManager::Metadata PatchManager::GetControlMetadata() const { |
| 572 | const auto& installed = Core::System::GetInstance().GetContentProvider(); | 567 | const auto base_control_nca = content_provider.GetEntry(title_id, ContentRecordType::Control); |
| 573 | |||
| 574 | const auto base_control_nca = installed.GetEntry(title_id, ContentRecordType::Control); | ||
| 575 | if (base_control_nca == nullptr) { | 568 | if (base_control_nca == nullptr) { |
| 576 | return {}; | 569 | return {}; |
| 577 | } | 570 | } |
diff --git a/src/core/file_sys/patch_manager.h b/src/core/file_sys/patch_manager.h index 1f28c6241..fb1853035 100644 --- a/src/core/file_sys/patch_manager.h +++ b/src/core/file_sys/patch_manager.h | |||
| @@ -17,8 +17,13 @@ namespace Core { | |||
| 17 | class System; | 17 | class System; |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | namespace Service::FileSystem { | ||
| 21 | class FileSystemController; | ||
| 22 | } | ||
| 23 | |||
| 20 | namespace FileSys { | 24 | namespace FileSys { |
| 21 | 25 | ||
| 26 | class ContentProvider; | ||
| 22 | class NCA; | 27 | class NCA; |
| 23 | class NACP; | 28 | class NACP; |
| 24 | 29 | ||
| @@ -29,7 +34,9 @@ public: | |||
| 29 | using Metadata = std::pair<std::unique_ptr<NACP>, VirtualFile>; | 34 | using Metadata = std::pair<std::unique_ptr<NACP>, VirtualFile>; |
| 30 | using PatchVersionNames = std::map<std::string, std::string, std::less<>>; | 35 | using PatchVersionNames = std::map<std::string, std::string, std::less<>>; |
| 31 | 36 | ||
| 32 | explicit PatchManager(u64 title_id); | 37 | explicit PatchManager(u64 title_id_, |
| 38 | const Service::FileSystem::FileSystemController& fs_controller_, | ||
| 39 | const ContentProvider& content_provider_); | ||
| 33 | ~PatchManager(); | 40 | ~PatchManager(); |
| 34 | 41 | ||
| 35 | [[nodiscard]] u64 GetTitleID() const; | 42 | [[nodiscard]] u64 GetTitleID() const; |
| @@ -50,7 +57,7 @@ public: | |||
| 50 | 57 | ||
| 51 | // Creates a CheatList object with all | 58 | // Creates a CheatList object with all |
| 52 | [[nodiscard]] std::vector<Core::Memory::CheatEntry> CreateCheatList( | 59 | [[nodiscard]] std::vector<Core::Memory::CheatEntry> CreateCheatList( |
| 53 | const Core::System& system, const BuildID& build_id) const; | 60 | const BuildID& build_id) const; |
| 54 | 61 | ||
| 55 | // Currently tracked RomFS patches: | 62 | // Currently tracked RomFS patches: |
| 56 | // - Game Updates | 63 | // - Game Updates |
| @@ -80,6 +87,8 @@ private: | |||
| 80 | const std::string& build_id) const; | 87 | const std::string& build_id) const; |
| 81 | 88 | ||
| 82 | u64 title_id; | 89 | u64 title_id; |
| 90 | const Service::FileSystem::FileSystemController& fs_controller; | ||
| 91 | const ContentProvider& content_provider; | ||
| 83 | }; | 92 | }; |
| 84 | 93 | ||
| 85 | } // namespace FileSys | 94 | } // namespace FileSys |
diff --git a/src/core/file_sys/romfs_factory.cpp b/src/core/file_sys/romfs_factory.cpp index e967a254e..987199747 100644 --- a/src/core/file_sys/romfs_factory.cpp +++ b/src/core/file_sys/romfs_factory.cpp | |||
| @@ -37,10 +37,12 @@ void RomFSFactory::SetPackedUpdate(VirtualFile update_raw) { | |||
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | ResultVal<VirtualFile> RomFSFactory::OpenCurrentProcess(u64 current_process_title_id) const { | 39 | ResultVal<VirtualFile> RomFSFactory::OpenCurrentProcess(u64 current_process_title_id) const { |
| 40 | if (!updatable) | 40 | if (!updatable) { |
| 41 | return MakeResult<VirtualFile>(file); | 41 | return MakeResult<VirtualFile>(file); |
| 42 | } | ||
| 42 | 43 | ||
| 43 | const PatchManager patch_manager(current_process_title_id); | 44 | const PatchManager patch_manager{current_process_title_id, filesystem_controller, |
| 45 | content_provider}; | ||
| 44 | return MakeResult<VirtualFile>( | 46 | return MakeResult<VirtualFile>( |
| 45 | patch_manager.PatchRomFS(file, ivfc_offset, ContentRecordType::Program, update_raw)); | 47 | patch_manager.PatchRomFS(file, ivfc_offset, ContentRecordType::Program, update_raw)); |
| 46 | } | 48 | } |