diff options
author | bunnei <bunneidev@gmail.com> | 2018-04-21 03:26:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-21 03:26:27 +0200 |
commit | 2e7ce96b1d55df535ab7e16efb711d9bdf82cfd1 (patch) | |
tree | eb3a8d9007462f1864174ea4ffe9e5a80d56c9d5 /src/core/core.cpp | |
parent | Merge pull request #340 from mailwl/vi-update (diff) | |
parent | core: Relocate g_service_manager to the System class (diff) | |
download | yuzu-2e7ce96b1d55df535ab7e16efb711d9bdf82cfd1.tar yuzu-2e7ce96b1d55df535ab7e16efb711d9bdf82cfd1.tar.gz yuzu-2e7ce96b1d55df535ab7e16efb711d9bdf82cfd1.tar.bz2 yuzu-2e7ce96b1d55df535ab7e16efb711d9bdf82cfd1.tar.lz yuzu-2e7ce96b1d55df535ab7e16efb711d9bdf82cfd1.tar.xz yuzu-2e7ce96b1d55df535ab7e16efb711d9bdf82cfd1.tar.zst yuzu-2e7ce96b1d55df535ab7e16efb711d9bdf82cfd1.zip |
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r-- | src/core/core.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 9f5507a65..ee4af4dcc 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -12,10 +12,13 @@ #include "core/core.h" #include "core/core_timing.h" #include "core/gdbstub/gdbstub.h" +#include "core/hle/kernel/client_port.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/process.h" #include "core/hle/kernel/thread.h" #include "core/hle/service/service.h" +#include "core/hle/service/sm/controller.h" +#include "core/hle/service/sm/sm.h" #include "core/hw/hw.h" #include "core/loader/loader.h" #include "core/memory_setup.h" @@ -26,6 +29,8 @@ namespace Core { /*static*/ System System::s_instance; +System::~System() = default; + System::ResultStatus System::RunLoop(bool tight_loop) { status = ResultStatus::Success; if (!cpu_core) { @@ -167,10 +172,12 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) { telemetry_session = std::make_unique<Core::TelemetrySession>(); + service_manager = std::make_shared<Service::SM::ServiceManager>(); + HW::Init(); Kernel::Init(system_mode); scheduler = std::make_unique<Kernel::Scheduler>(cpu_core.get()); - Service::Init(); + Service::Init(service_manager); GDBStub::Init(); if (!VideoCore::Init(emu_window)) { @@ -200,17 +207,26 @@ void System::Shutdown() { VideoCore::Shutdown(); GDBStub::Shutdown(); Service::Shutdown(); - scheduler = nullptr; + scheduler.reset(); Kernel::Shutdown(); HW::Shutdown(); - telemetry_session = nullptr; - gpu_core = nullptr; - cpu_core = nullptr; + service_manager.reset(); + telemetry_session.reset(); + gpu_core.reset(); + cpu_core.reset(); CoreTiming::Shutdown(); - app_loader = nullptr; + app_loader.reset(); LOG_DEBUG(Core, "Shutdown OK"); } +Service::SM::ServiceManager& System::ServiceManager() { + return *service_manager; +} + +const Service::SM::ServiceManager& System::ServiceManager() const { + return *service_manager; +} + } // namespace Core |