diff options
author | Fernando S <fsahmkow27@gmail.com> | 2023-08-21 16:29:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-21 16:29:04 +0200 |
commit | 861597eb2e32663dba37813273ff91434566523a (patch) | |
tree | a05b7c596209f754a822c03cca162c6f32b6a565 /src/yuzu/main.cpp | |
parent | 6a5db5679b61d3d73244e42682f1b34d401e7736 (diff) | |
parent | 775bf8e215c8c771b45f383b0b2ce46fa37ebe95 (diff) |
Merge pull request #11284 from liamwhite/nca-release
vfs: expand support for NCA reading
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r-- | src/yuzu/main.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 97ae9e49a..a9d035f3d 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -2535,8 +2535,8 @@ void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_pa return; } - FileSys::VirtualFile file; - if (loader->ReadRomFS(file) != Loader::ResultStatus::Success) { + FileSys::VirtualFile base_romfs; + if (loader->ReadRomFS(base_romfs) != Loader::ResultStatus::Success) { failed(); return; } @@ -2549,6 +2549,14 @@ void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_pa return; } + const auto type = *romfs_title_id == program_id ? FileSys::ContentRecordType::Program + : FileSys::ContentRecordType::Data; + const auto base_nca = installed.GetEntry(*romfs_title_id, type); + if (!base_nca) { + failed(); + return; + } + const auto dump_dir = target == DumpRomFSTarget::Normal ? Common::FS::GetYuzuPath(Common::FS::YuzuPath::DumpDir) @@ -2560,12 +2568,10 @@ void GMainWindow::OnGameListDumpRomFS(u64 program_id, const std::string& game_pa FileSys::VirtualFile romfs; if (*romfs_title_id == program_id) { - const u64 ivfc_offset = loader->ReadRomFSIVFCOffset(); const FileSys::PatchManager pm{program_id, system->GetFileSystemController(), installed}; - romfs = - pm.PatchRomFS(file, ivfc_offset, FileSys::ContentRecordType::Program, nullptr, false); + romfs = pm.PatchRomFS(base_nca.get(), base_romfs, type, nullptr, false); } else { - romfs = installed.GetEntry(*romfs_title_id, FileSys::ContentRecordType::Data)->GetRomFS(); + romfs = installed.GetEntry(*romfs_title_id, type)->GetRomFS(); } const auto extracted = FileSys::ExtractRomFS(romfs, FileSys::RomFSExtractionType::Full); |