summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/romfs_factory.cpp
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-08-26 01:04:48 +0200
committerZach Hilman <zachhilman@gmail.com>2018-09-04 22:23:15 +0200
commit97bf83bc56860be244077e9213468466f894c73d (patch)
treec5b59ded4f150ded530b6f218e2ca52589f2628b /src/core/file_sys/romfs_factory.cpp
parentfile_sys: Add class to manage game patches (diff)
downloadyuzu-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.cpp11
1 files changed, 10 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) {