diff options
| author | Liam <byteslice@airmail.cc> | 2023-08-10 21:34:43 -0400 |
|---|---|---|
| committer | Liam <byteslice@airmail.cc> | 2023-08-15 17:47:25 -0400 |
| commit | 86f6b6b7b2d930e8203114332b04a5c49a780b06 (patch) | |
| tree | bf7ff58b0a36051d3c3489a40999d80357c570d0 /src/core/file_sys/romfs_factory.cpp | |
| parent | a8c4f01f6ca040672e85faaf42a8ef12d373dd65 (diff) | |
vfs: expand support for NCA reading
Diffstat (limited to 'src/core/file_sys/romfs_factory.cpp')
| -rw-r--r-- | src/core/file_sys/romfs_factory.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/file_sys/romfs_factory.cpp b/src/core/file_sys/romfs_factory.cpp index aa4726cfa..1bc07dae5 100644 --- a/src/core/file_sys/romfs_factory.cpp +++ b/src/core/file_sys/romfs_factory.cpp @@ -26,13 +26,12 @@ RomFSFactory::RomFSFactory(Loader::AppLoader& app_loader, ContentProvider& provi } updatable = app_loader.IsRomFSUpdatable(); - ivfc_offset = app_loader.ReadRomFSIVFCOffset(); } RomFSFactory::~RomFSFactory() = default; void RomFSFactory::SetPackedUpdate(VirtualFile update_raw_file) { - update_raw = std::move(update_raw_file); + packed_update_raw = std::move(update_raw_file); } VirtualFile RomFSFactory::OpenCurrentProcess(u64 current_process_title_id) const { @@ -40,9 +39,11 @@ VirtualFile RomFSFactory::OpenCurrentProcess(u64 current_process_title_id) const return file; } + const auto type = ContentRecordType::Program; + const auto nca = content_provider.GetEntry(current_process_title_id, type); const PatchManager patch_manager{current_process_title_id, filesystem_controller, content_provider}; - return patch_manager.PatchRomFS(file, ivfc_offset, ContentRecordType::Program, update_raw); + return patch_manager.PatchRomFS(nca.get(), file, ContentRecordType::Program, packed_update_raw); } VirtualFile RomFSFactory::OpenPatchedRomFS(u64 title_id, ContentRecordType type) const { @@ -54,7 +55,7 @@ VirtualFile RomFSFactory::OpenPatchedRomFS(u64 title_id, ContentRecordType type) const PatchManager patch_manager{title_id, filesystem_controller, content_provider}; - return patch_manager.PatchRomFS(nca->GetRomFS(), nca->GetBaseIVFCOffset(), type); + return patch_manager.PatchRomFS(nca.get(), nca->GetRomFS(), type); } VirtualFile RomFSFactory::OpenPatchedRomFSWithProgramIndex(u64 title_id, u8 program_index, |
