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/hle/service/ldr/ldr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/hle/service/ldr/ldr.cpp') diff --git a/src/core/hle/service/ldr/ldr.cpp b/src/core/hle/service/ldr/ldr.cpp index 3164ca26e..499376bfc 100644 --- a/src/core/hle/service/ldr/ldr.cpp +++ b/src/core/hle/service/ldr/ldr.cpp @@ -163,7 +163,7 @@ public: return; } - if (Core::CurrentProcess()->GetTitleID() != header.title_id) { + if (system.CurrentProcess()->GetTitleID() != header.title_id) { LOG_ERROR(Service_LDR, "Attempting to load NRR with title ID other than current process. (actual " "{:016X})!", @@ -327,7 +327,7 @@ public: } // Load NRO as new executable module - auto* process = Core::CurrentProcess(); + auto* process = system.CurrentProcess(); auto& vm_manager = process->VMManager(); auto map_address = vm_manager.FindFreeRegion(nro_size + bss_size); @@ -411,7 +411,7 @@ public: return; } - auto& vm_manager = Core::CurrentProcess()->VMManager(); + auto& vm_manager = system.CurrentProcess()->VMManager(); const auto& nro_info = iter->second; // Unmap the mirrored memory -- cgit v1.2.3