summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/filesystem
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-08-11 03:34:43 +0200
committerLiam <byteslice@airmail.cc>2023-08-15 23:47:25 +0200
commit86f6b6b7b2d930e8203114332b04a5c49a780b06 (patch)
treebf7ff58b0a36051d3c3489a40999d80357c570d0 /src/core/hle/service/filesystem
parentMerge pull request #11287 from liamwhite/replaced-bytes (diff)
downloadyuzu-86f6b6b7b2d930e8203114332b04a5c49a780b06.tar
yuzu-86f6b6b7b2d930e8203114332b04a5c49a780b06.tar.gz
yuzu-86f6b6b7b2d930e8203114332b04a5c49a780b06.tar.bz2
yuzu-86f6b6b7b2d930e8203114332b04a5c49a780b06.tar.lz
yuzu-86f6b6b7b2d930e8203114332b04a5c49a780b06.tar.xz
yuzu-86f6b6b7b2d930e8203114332b04a5c49a780b06.tar.zst
yuzu-86f6b6b7b2d930e8203114332b04a5c49a780b06.zip
Diffstat (limited to 'src/core/hle/service/filesystem')
-rw-r--r--src/core/hle/service/filesystem/filesystem.cpp5
-rw-r--r--src/core/hle/service/filesystem/filesystem.h3
-rw-r--r--src/core/hle/service/filesystem/fsp_srv.cpp7
3 files changed, 12 insertions, 3 deletions
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp
index ac465d5a9..4c1ea1a5b 100644
--- a/src/core/hle/service/filesystem/filesystem.cpp
+++ b/src/core/hle/service/filesystem/filesystem.cpp
@@ -373,6 +373,11 @@ FileSys::VirtualFile FileSystemController::OpenRomFS(u64 title_id, FileSys::Stor
return romfs_factory->Open(title_id, storage_id, type);
}
+std::shared_ptr<FileSys::NCA> FileSystemController::OpenBaseNca(
+ u64 title_id, FileSys::StorageId storage_id, FileSys::ContentRecordType type) const {
+ return romfs_factory->GetEntry(title_id, storage_id, type);
+}
+
Result FileSystemController::CreateSaveData(FileSys::VirtualDir* out_save_data,
FileSys::SaveDataSpaceId space,
const FileSys::SaveDataAttribute& save_struct) const {
diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h
index fd991f976..e7e7c4c28 100644
--- a/src/core/hle/service/filesystem/filesystem.h
+++ b/src/core/hle/service/filesystem/filesystem.h
@@ -15,6 +15,7 @@ class System;
namespace FileSys {
class BISFactory;
+class NCA;
class RegisteredCache;
class RegisteredCacheUnion;
class PlaceholderCache;
@@ -70,6 +71,8 @@ public:
FileSys::ContentRecordType type) const;
FileSys::VirtualFile OpenRomFS(u64 title_id, FileSys::StorageId storage_id,
FileSys::ContentRecordType type) const;
+ std::shared_ptr<FileSys::NCA> OpenBaseNca(u64 title_id, FileSys::StorageId storage_id,
+ FileSys::ContentRecordType type) const;
Result CreateSaveData(FileSys::VirtualDir* out_save_data, FileSys::SaveDataSpaceId space,
const FileSys::SaveDataAttribute& save_struct) const;
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp
index 423a814cb..eaaf8cdd9 100644
--- a/src/core/hle/service/filesystem/fsp_srv.cpp
+++ b/src/core/hle/service/filesystem/fsp_srv.cpp
@@ -310,8 +310,8 @@ private:
class IFileSystem final : public ServiceFramework<IFileSystem> {
public:
explicit IFileSystem(Core::System& system_, FileSys::VirtualDir backend_, SizeGetter size_)
- : ServiceFramework{system_, "IFileSystem"}, backend{std::move(backend_)}, size{std::move(
- size_)} {
+ : ServiceFramework{system_, "IFileSystem"}, backend{std::move(backend_)},
+ size{std::move(size_)} {
static const FunctionInfo functions[] = {
{0, &IFileSystem::CreateFile, "CreateFile"},
{1, &IFileSystem::DeleteFile, "DeleteFile"},
@@ -1029,8 +1029,9 @@ void FSP_SRV::OpenDataStorageByDataId(HLERequestContext& ctx) {
const FileSys::PatchManager pm{title_id, fsc, content_provider};
+ auto base = fsc.OpenBaseNca(title_id, storage_id, FileSys::ContentRecordType::Data);
auto storage = std::make_shared<IStorage>(
- system, pm.PatchRomFS(std::move(data), 0, FileSys::ContentRecordType::Data));
+ system, pm.PatchRomFS(base.get(), std::move(data), FileSys::ContentRecordType::Data));
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);