diff options
| author | Lioncache <mai.iam2048@gmail.com> | 2023-12-18 13:39:31 -0500 |
|---|---|---|
| committer | Lioncache <mai.iam2048@gmail.com> | 2023-12-18 13:39:53 -0500 |
| commit | c4df659e21fdfb3e3fadb66a73deaebd7d26507a (patch) | |
| tree | 74555b574a83244ae5184cee0b6e95280acf55f4 /Source/Core | |
| parent | c3c39de2128e582121415d3cf232ed4a7c0f306f (diff) | |
HLE_OS: Get rid of global system accessors
Thread guards provide access to the current active system instance.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/HLE/HLE_OS.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Source/Core/Core/HLE/HLE_OS.cpp b/Source/Core/Core/HLE/HLE_OS.cpp index 52f3b43deb..7565e11936 100644 --- a/Source/Core/Core/HLE/HLE_OS.cpp +++ b/Source/Core/Core/HLE/HLE_OS.cpp @@ -38,7 +38,7 @@ void HLE_LogFPrint(const Core::CPUThreadGuard& guard, ParameterType parameter_ty void HLE_OSPanic(const Core::CPUThreadGuard& guard) { - auto& system = Core::System::GetInstance(); + auto& system = guard.GetSystem(); auto& ppc_state = system.GetPPCState(); std::string error = GetStringVA(system, guard); @@ -57,8 +57,8 @@ void HLE_OSPanic(const Core::CPUThreadGuard& guard) // Generalized function for printing formatted string. void HLE_GeneralDebugPrint(const Core::CPUThreadGuard& guard, ParameterType parameter_type) { - auto& system = Core::System::GetInstance(); - auto& ppc_state = system.GetPPCState(); + auto& system = guard.GetSystem(); + const auto& ppc_state = system.GetPPCState(); std::string report_message; @@ -114,7 +114,7 @@ void HLE_GeneralDebugVPrint(const Core::CPUThreadGuard& guard) void HLE_write_console(const Core::CPUThreadGuard& guard) { auto& system = guard.GetSystem(); - auto& ppc_state = system.GetPPCState(); + const auto& ppc_state = system.GetPPCState(); std::string report_message = GetStringVA(system, guard, 4); if (PowerPC::MMU::HostIsRAMAddress(guard, ppc_state.gpr[5])) @@ -141,8 +141,8 @@ void HLE_write_console(const Core::CPUThreadGuard& guard) // Log (v)dprintf message if fd is 1 (stdout) or 2 (stderr) void HLE_LogDPrint(const Core::CPUThreadGuard& guard, ParameterType parameter_type) { - auto& system = Core::System::GetInstance(); - auto& ppc_state = system.GetPPCState(); + auto& system = guard.GetSystem(); + const auto& ppc_state = system.GetPPCState(); if (ppc_state.gpr[3] != 1 && ppc_state.gpr[3] != 2) return; @@ -170,8 +170,8 @@ void HLE_LogVDPrint(const Core::CPUThreadGuard& guard) // Log (v)fprintf message if FILE is stdout or stderr void HLE_LogFPrint(const Core::CPUThreadGuard& guard, ParameterType parameter_type) { - auto& system = Core::System::GetInstance(); - auto& ppc_state = system.GetPPCState(); + auto& system = guard.GetSystem(); + const auto& ppc_state = system.GetPPCState(); // The structure FILE is implementation defined. // Both libogc and Dolphin SDK seem to store the fd at the same address. |
