diff options
Diffstat (limited to 'src/core/core.cpp')
| -rw-r--r-- | src/core/core.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 613a98b4c..4fb035556 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -133,22 +133,24 @@ void System::Reschedule() { } reschedule_pending = false; - Kernel::Reschedule(); + Core::System::GetInstance().Scheduler().Reschedule(); } System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) { LOG_DEBUG(HW_Memory, "initialized OK"); + CoreTiming::Init(); + switch (Settings::values.cpu_core) { case Settings::CpuCore::Unicorn: - cpu_core = std::make_unique<ARM_Unicorn>(); + cpu_core = std::make_shared<ARM_Unicorn>(); break; case Settings::CpuCore::Dynarmic: default: #ifdef ARCHITECTURE_x86_64 - cpu_core = std::make_unique<ARM_Dynarmic>(); + cpu_core = std::make_shared<ARM_Dynarmic>(); #else - cpu_core = std::make_unique<ARM_Unicorn>(); + cpu_core = std::make_shared<ARM_Unicorn>(); LOG_WARNING(Core, "CPU JIT requested, but Dynarmic not available"); #endif break; @@ -158,9 +160,9 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) { telemetry_session = std::make_unique<Core::TelemetrySession>(); - CoreTiming::Init(); HW::Init(); Kernel::Init(system_mode); + scheduler = std::make_unique<Kernel::Scheduler>(cpu_core.get()); Service::Init(); GDBStub::Init(); @@ -188,15 +190,18 @@ void System::Shutdown() { perf_results.frametime * 1000.0); // Shutdown emulation session - GDBStub::Shutdown(); VideoCore::Shutdown(); + GDBStub::Shutdown(); Service::Shutdown(); + scheduler = nullptr; Kernel::Shutdown(); HW::Shutdown(); - CoreTiming::Shutdown(); + telemetry_session = nullptr; + gpu_core = nullptr; cpu_core = nullptr; + CoreTiming::Shutdown(); + app_loader = nullptr; - telemetry_session = nullptr; LOG_DEBUG(Core, "Shutdown OK"); } |
