diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-08-26 01:04:48 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-09-04 22:23:15 +0200 |
commit | 97bf83bc56860be244077e9213468466f894c73d (patch) | |
tree | c5b59ded4f150ded530b6f218e2ca52589f2628b /src/core/file_sys | |
parent | file_sys: Add class to manage game patches (diff) | |
download | yuzu-97bf83bc56860be244077e9213468466f894c73d.tar yuzu-97bf83bc56860be244077e9213468466f894c73d.tar.gz yuzu-97bf83bc56860be244077e9213468466f894c73d.tar.bz2 yuzu-97bf83bc56860be244077e9213468466f894c73d.tar.lz yuzu-97bf83bc56860be244077e9213468466f894c73d.tar.xz yuzu-97bf83bc56860be244077e9213468466f894c73d.tar.zst yuzu-97bf83bc56860be244077e9213468466f894c73d.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/file_sys/romfs_factory.cpp | 11 | ||||
-rw-r--r-- | src/core/file_sys/romfs_factory.h | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/core/file_sys/romfs_factory.cpp b/src/core/file_sys/romfs_factory.cpp index 66f9786e0..fc9cf1eca 100644 --- a/src/core/file_sys/romfs_factory.cpp +++ b/src/core/file_sys/romfs_factory.cpp @@ -6,7 +6,10 @@ #include "common/assert.h" #include "common/common_types.h" #include "common/logging/log.h" +#include "core/core.h" #include "core/file_sys/content_archive.h" +#include "core/file_sys/nca_metadata.h" +#include "core/file_sys/patch_manager.h" #include "core/file_sys/registered_cache.h" #include "core/file_sys/romfs_factory.h" #include "core/hle/service/filesystem/filesystem.h" @@ -19,10 +22,16 @@ RomFSFactory::RomFSFactory(Loader::AppLoader& app_loader) { if (app_loader.ReadRomFS(file) != Loader::ResultStatus::Success) { LOG_ERROR(Service_FS, "Unable to read RomFS!"); } + + updatable = app_loader.IsRomFSUpdatable(); } ResultVal<VirtualFile> RomFSFactory::OpenCurrentProcess() { - return MakeResult<VirtualFile>(file); + if (!updatable) + return MakeResult<VirtualFile>(file); + + const PatchManager patch_manager(Core::CurrentProcess()->process_id); + return MakeResult<VirtualFile>(patch_manager.PatchRomFS(file)); } ResultVal<VirtualFile> RomFSFactory::Open(u64 title_id, StorageId storage, ContentRecordType type) { diff --git a/src/core/file_sys/romfs_factory.h b/src/core/file_sys/romfs_factory.h index f38ddc4f7..168db1c46 100644 --- a/src/core/file_sys/romfs_factory.h +++ b/src/core/file_sys/romfs_factory.h @@ -36,6 +36,7 @@ public: private: VirtualFile file; + bool updatable; }; } // namespace FileSys |