From 69f16ba50e3c52a17405670b976ac4ba63f58021 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 6 Oct 2019 13:02:23 -0400 Subject: hle/service: Replace global system instance calls with instance-based ones Migrates the HLE service code off the use of directly accessing the global system instance where trivially able to do so. This removes all usages of Core::CurrentProcess from the service code, only 8 occurrences of this function exist elsewhere. There's still quite a bit of "System::GetInstance()" being used, however this was able to replace a few instances. --- src/core/file_sys/romfs_factory.cpp | 4 ++-- src/core/file_sys/romfs_factory.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/file_sys') diff --git a/src/core/file_sys/romfs_factory.cpp b/src/core/file_sys/romfs_factory.cpp index 84cd4684c..4bd2e6183 100644 --- a/src/core/file_sys/romfs_factory.cpp +++ b/src/core/file_sys/romfs_factory.cpp @@ -35,11 +35,11 @@ void RomFSFactory::SetPackedUpdate(VirtualFile update_raw) { this->update_raw = std::move(update_raw); } -ResultVal RomFSFactory::OpenCurrentProcess() const { +ResultVal RomFSFactory::OpenCurrentProcess(u64 current_process_title_id) const { if (!updatable) return MakeResult(file); - const PatchManager patch_manager(Core::CurrentProcess()->GetTitleID()); + const PatchManager patch_manager(current_process_title_id); return MakeResult( patch_manager.PatchRomFS(file, ivfc_offset, ContentRecordType::Program, update_raw)); } diff --git a/src/core/file_sys/romfs_factory.h b/src/core/file_sys/romfs_factory.h index da63a313a..c5d40285c 100644 --- a/src/core/file_sys/romfs_factory.h +++ b/src/core/file_sys/romfs_factory.h @@ -33,7 +33,7 @@ public: ~RomFSFactory(); void SetPackedUpdate(VirtualFile update_raw); - ResultVal OpenCurrentProcess() const; + ResultVal OpenCurrentProcess(u64 current_process_title_id) const; ResultVal Open(u64 title_id, StorageId storage, ContentRecordType type) const; private: -- cgit v1.2.3