patch_manager: Add usages of patches to ExeFS
This commit is contained in:
parent
8e900a301a
commit
97bf83bc56
5 changed files with 41 additions and 9 deletions
|
@ -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) {
|
||||
|
|
|
@ -36,6 +36,7 @@ public:
|
|||
|
||||
private:
|
||||
VirtualFile file;
|
||||
bool updatable;
|
||||
};
|
||||
|
||||
} // namespace FileSys
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue