diff options
author | bunnei <bunneidev@gmail.com> | 2023-08-10 06:24:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-10 06:24:31 +0200 |
commit | 9d3a293a4ea17b60146c10e7561c0fd1219fd6c1 (patch) | |
tree | b69936f3e53ee675de0ca21a1dffabd7e71acae0 /src/core/file_sys/romfs_factory.cpp | |
parent | Merge pull request #11247 from german77/pctl (diff) | |
parent | fs: return result on null outputs (diff) | |
download | yuzu-9d3a293a4ea17b60146c10e7561c0fd1219fd6c1.tar yuzu-9d3a293a4ea17b60146c10e7561c0fd1219fd6c1.tar.gz yuzu-9d3a293a4ea17b60146c10e7561c0fd1219fd6c1.tar.bz2 yuzu-9d3a293a4ea17b60146c10e7561c0fd1219fd6c1.tar.lz yuzu-9d3a293a4ea17b60146c10e7561c0fd1219fd6c1.tar.xz yuzu-9d3a293a4ea17b60146c10e7561c0fd1219fd6c1.tar.zst yuzu-9d3a293a4ea17b60146c10e7561c0fd1219fd6c1.zip |
Diffstat (limited to 'src/core/file_sys/romfs_factory.cpp')
-rw-r--r-- | src/core/file_sys/romfs_factory.cpp | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/core/file_sys/romfs_factory.cpp b/src/core/file_sys/romfs_factory.cpp index ae7a3511b..aa4726cfa 100644 --- a/src/core/file_sys/romfs_factory.cpp +++ b/src/core/file_sys/romfs_factory.cpp @@ -35,7 +35,7 @@ void RomFSFactory::SetPackedUpdate(VirtualFile update_raw_file) { update_raw = std::move(update_raw_file); } -ResultVal<VirtualFile> RomFSFactory::OpenCurrentProcess(u64 current_process_title_id) const { +VirtualFile RomFSFactory::OpenCurrentProcess(u64 current_process_title_id) const { if (!updatable) { return file; } @@ -45,12 +45,11 @@ ResultVal<VirtualFile> RomFSFactory::OpenCurrentProcess(u64 current_process_titl return patch_manager.PatchRomFS(file, ivfc_offset, ContentRecordType::Program, update_raw); } -ResultVal<VirtualFile> RomFSFactory::OpenPatchedRomFS(u64 title_id, ContentRecordType type) const { +VirtualFile RomFSFactory::OpenPatchedRomFS(u64 title_id, ContentRecordType type) const { auto nca = content_provider.GetEntry(title_id, type); if (nca == nullptr) { - // TODO: Find the right error code to use here - return ResultUnknown; + return nullptr; } const PatchManager patch_manager{title_id, filesystem_controller, content_provider}; @@ -58,28 +57,20 @@ ResultVal<VirtualFile> RomFSFactory::OpenPatchedRomFS(u64 title_id, ContentRecor return patch_manager.PatchRomFS(nca->GetRomFS(), nca->GetBaseIVFCOffset(), type); } -ResultVal<VirtualFile> RomFSFactory::OpenPatchedRomFSWithProgramIndex( - u64 title_id, u8 program_index, ContentRecordType type) const { +VirtualFile RomFSFactory::OpenPatchedRomFSWithProgramIndex(u64 title_id, u8 program_index, + ContentRecordType type) const { const auto res_title_id = GetBaseTitleIDWithProgramIndex(title_id, program_index); return OpenPatchedRomFS(res_title_id, type); } -ResultVal<VirtualFile> RomFSFactory::Open(u64 title_id, StorageId storage, - ContentRecordType type) const { +VirtualFile RomFSFactory::Open(u64 title_id, StorageId storage, ContentRecordType type) const { const std::shared_ptr<NCA> res = GetEntry(title_id, storage, type); if (res == nullptr) { - // TODO(DarkLordZach): Find the right error code to use here - return ResultUnknown; - } - - const auto romfs = res->GetRomFS(); - if (romfs == nullptr) { - // TODO(DarkLordZach): Find the right error code to use here - return ResultUnknown; + return nullptr; } - return romfs; + return res->GetRomFS(); } std::shared_ptr<NCA> RomFSFactory::GetEntry(u64 title_id, StorageId storage, |