summaryrefslogtreecommitdiff
path: root/src/core/file_sys
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-08-25 19:04:48 -0400
committerGravatar Zach Hilman2018-09-04 16:23:15 -0400
commit97bf83bc56860be244077e9213468466f894c73d (patch)
treec5b59ded4f150ded530b6f218e2ca52589f2628b /src/core/file_sys
parentfile_sys: Add class to manage game patches (diff)
downloadyuzu-97bf83bc56860be244077e9213468466f894c73d.tar.gz
yuzu-97bf83bc56860be244077e9213468466f894c73d.tar.xz
yuzu-97bf83bc56860be244077e9213468466f894c73d.zip
patch_manager: Add usages of patches to ExeFS
Diffstat (limited to 'src/core/file_sys')
-rw-r--r--src/core/file_sys/romfs_factory.cpp11
-rw-r--r--src/core/file_sys/romfs_factory.h1
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 @@
6#include "common/assert.h" 6#include "common/assert.h"
7#include "common/common_types.h" 7#include "common/common_types.h"
8#include "common/logging/log.h" 8#include "common/logging/log.h"
9#include "core/core.h"
9#include "core/file_sys/content_archive.h" 10#include "core/file_sys/content_archive.h"
11#include "core/file_sys/nca_metadata.h"
12#include "core/file_sys/patch_manager.h"
10#include "core/file_sys/registered_cache.h" 13#include "core/file_sys/registered_cache.h"
11#include "core/file_sys/romfs_factory.h" 14#include "core/file_sys/romfs_factory.h"
12#include "core/hle/service/filesystem/filesystem.h" 15#include "core/hle/service/filesystem/filesystem.h"
@@ -19,10 +22,16 @@ RomFSFactory::RomFSFactory(Loader::AppLoader& app_loader) {
19 if (app_loader.ReadRomFS(file) != Loader::ResultStatus::Success) { 22 if (app_loader.ReadRomFS(file) != Loader::ResultStatus::Success) {
20 LOG_ERROR(Service_FS, "Unable to read RomFS!"); 23 LOG_ERROR(Service_FS, "Unable to read RomFS!");
21 } 24 }
25
26 updatable = app_loader.IsRomFSUpdatable();
22} 27}
23 28
24ResultVal<VirtualFile> RomFSFactory::OpenCurrentProcess() { 29ResultVal<VirtualFile> RomFSFactory::OpenCurrentProcess() {
25 return MakeResult<VirtualFile>(file); 30 if (!updatable)
31 return MakeResult<VirtualFile>(file);
32
33 const PatchManager patch_manager(Core::CurrentProcess()->process_id);
34 return MakeResult<VirtualFile>(patch_manager.PatchRomFS(file));
26} 35}
27 36
28ResultVal<VirtualFile> RomFSFactory::Open(u64 title_id, StorageId storage, ContentRecordType type) { 37ResultVal<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:
36 36
37private: 37private:
38 VirtualFile file; 38 VirtualFile file;
39 bool updatable;
39}; 40};
40 41
41} // namespace FileSys 42} // namespace FileSys