Replace g_kernel with Core::Global etc.

This commit is contained in:
Hamish Milne 2019-12-25 18:51:56 +00:00 committed by zhupengfei
parent e707685c2a
commit 3e752002c4
15 changed files with 43 additions and 17 deletions

View file

@ -25,6 +25,7 @@
#endif
#include "core/custom_tex_cache.h"
#include "core/gdbstub/gdbstub.h"
#include "core/global.h"
#include "core/hle/kernel/client_port.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/process.h"
@ -46,6 +47,12 @@ namespace Core {
/*static*/ System System::s_instance;
template <>
Core::System& Global() { return System::GetInstance(); }
template <>
Kernel::KernelSystem& Global() { return System::GetInstance().Kernel(); }
System::ResultStatus System::RunLoop(bool tight_loop) {
status = ResultStatus::Success;
if (!cpu_core) {
@ -204,7 +211,6 @@ System::ResultStatus System::Init(Frontend::EmuWindow& emu_window, u32 system_mo
kernel = std::make_unique<Kernel::KernelSystem>(*memory, *timing,
[this] { PrepareReschedule(); }, system_mode);
Kernel::g_kernel = kernel.get();
if (Settings::values.use_cpu_jit) {
#ifdef ARCHITECTURE_x86_64
@ -368,7 +374,6 @@ void System::Shutdown() {
service_manager.reset();
dsp_core.reset();
cpu_core.reset();
Kernel::g_kernel = nullptr;
kernel.reset();
timing.reset();
app_loader.reset();