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.
This commit is contained in:
Lioncash 2019-10-06 13:02:23 -04:00
parent deecd7f074
commit 69f16ba50e
14 changed files with 76 additions and 51 deletions

View file

@ -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