VERY experimental Nintendo Switch 2 emulator
C++
Deglobalize System: Btm
David Marcec7b7e57693c2e
diff --git a/src/core/hle/service/btm/btm.cpp b/src/core/hle/service/btm/btm.cppindex b439ee7ec2..920fc6ff7f 100644--- a/src/core/hle/service/btm/btm.cpp+++ b/src/core/hle/service/btm/btm.cpp@@ -17,7 +17,7 @@ namespace Service::BTM {class IBtmUserCore final : public ServiceFramework<IBtmUserCore> {public:- explicit IBtmUserCore() : ServiceFramework{"IBtmUserCore"} {+ explicit IBtmUserCore(Core::System& system) : ServiceFramework{"IBtmUserCore"} {// clang-format offstatic const FunctionInfo functions[] = {{0, &IBtmUserCore::AcquireBleScanEvent, "AcquireBleScanEvent"},@@ -56,7 +56,7 @@ public:// clang-format onRegisterHandlers(functions);- auto& kernel = Core::System::GetInstance().Kernel();+ auto& kernel = system.Kernel();scan_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Automatic,"IBtmUserCore:ScanEvent");connection_event = Kernel::WritableEvent::CreateEventPair(@@ -108,7 +108,7 @@ private:class BTM_USR final : public ServiceFramework<BTM_USR> {public:- explicit BTM_USR() : ServiceFramework{"btm:u"} {+ explicit BTM_USR(Core::System& system) : ServiceFramework{"btm:u"}, system(system) {// clang-format offstatic const FunctionInfo functions[] = {{0, &BTM_USR::GetCore, "GetCore"},@@ -123,8 +123,10 @@ private:IPC::ResponseBuilder rb{ctx, 2, 0, 1};rb.Push(RESULT_SUCCESS);- rb.PushIpcInterface<IBtmUserCore>();+ rb.PushIpcInterface<IBtmUserCore>(system);}++ Core::System& system;};class BTM final : public ServiceFramework<BTM> {@@ -268,11 +270,11 @@ private:}};-void InstallInterfaces(SM::ServiceManager& sm) {+void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) {std::make_shared<BTM>()->InstallAsService(sm);std::make_shared<BTM_DBG>()->InstallAsService(sm);std::make_shared<BTM_SYS>()->InstallAsService(sm);- std::make_shared<BTM_USR>()->InstallAsService(sm);+ std::make_shared<BTM_USR>(system)->InstallAsService(sm);}} // namespace Service::BTMdiff --git a/src/core/hle/service/btm/btm.h b/src/core/hle/service/btm/btm.hindex e6425a7e3d..c6b878043c 100644--- a/src/core/hle/service/btm/btm.h+++ b/src/core/hle/service/btm/btm.h@@ -8,8 +8,12 @@ namespace Service::SM {class ServiceManager;}+namespace Core {+class System;+};+namespace Service::BTM {-void InstallInterfaces(SM::ServiceManager& sm);+void InstallInterfaces(SM::ServiceManager& sm, Core::System& system);} // namespace Service::BTM