VERY experimental Nintendo Switch 2 emulator
C++
am: IHomeMenuFunctions:GetPopFromGeneralChannelEvent
David Marcece433e24ed426
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cppindex 9450de6e90..30cd732525 100644--- a/src/core/hle/service/am/am.cpp+++ b/src/core/hle/service/am/am.cpp@@ -1514,14 +1514,15 @@ void InstallInterfaces(SM::ServiceManager& service_manager,std::make_shared<TCAP>()->InstallAsService(service_manager);}-IHomeMenuFunctions::IHomeMenuFunctions() : ServiceFramework("IHomeMenuFunctions") {+IHomeMenuFunctions::IHomeMenuFunctions(Kernel::KernelCore& kernel)+ : ServiceFramework("IHomeMenuFunctions"), kernel(kernel) {// clang-format offstatic const FunctionInfo functions[] = {{10, &IHomeMenuFunctions::RequestToGetForeground, "RequestToGetForeground"},{11, nullptr, "LockForeground"},{12, nullptr, "UnlockForeground"},{20, nullptr, "PopFromGeneralChannel"},- {21, nullptr, "GetPopFromGeneralChannelEvent"},+ {21, &IHomeMenuFunctions::GetPopFromGeneralChannelEvent, "GetPopFromGeneralChannelEvent"},{30, nullptr, "GetHomeButtonWriterLockAccessor"},{31, nullptr, "GetWriterLockAccessorEx"},{100, nullptr, "PopRequestLaunchApplicationForDebug"},@@ -1531,6 +1532,9 @@ IHomeMenuFunctions::IHomeMenuFunctions() : ServiceFramework("IHomeMenuFunctions"// clang-format onRegisterHandlers(functions);++ pop_from_general_channel_event = Kernel::WritableEvent::CreateEventPair(+ kernel, "IHomeMenuFunctions:PopFromGeneralChannelEvent");}IHomeMenuFunctions::~IHomeMenuFunctions() = default;@@ -1542,6 +1546,14 @@ void IHomeMenuFunctions::RequestToGetForeground(Kernel::HLERequestContext& ctx)rb.Push(RESULT_SUCCESS);}+void IHomeMenuFunctions::GetPopFromGeneralChannelEvent(Kernel::HLERequestContext& ctx) {+ LOG_WARNING(Service_AM, "(STUBBED) called");++ IPC::ResponseBuilder rb{ctx, 2, 1};+ rb.Push(RESULT_SUCCESS);+ rb.PushCopyObjects(pop_from_general_channel_event.readable);+}+IGlobalStateController::IGlobalStateController() : ServiceFramework("IGlobalStateController") {// clang-format offstatic const FunctionInfo functions[] = {diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.hindex dfa701d734..469f7f814a 100644--- a/src/core/hle/service/am/am.h+++ b/src/core/hle/service/am/am.h@@ -292,11 +292,15 @@ private:class IHomeMenuFunctions final : public ServiceFramework<IHomeMenuFunctions> {public:- IHomeMenuFunctions();+ explicit IHomeMenuFunctions(Kernel::KernelCore& kernel);~IHomeMenuFunctions() override;private:void RequestToGetForeground(Kernel::HLERequestContext& ctx);+ void GetPopFromGeneralChannelEvent(Kernel::HLERequestContext& ctx);++ Kernel::EventPair pop_from_general_channel_event;+ Kernel::KernelCore& kernel;};class IGlobalStateController final : public ServiceFramework<IGlobalStateController> {diff --git a/src/core/hle/service/am/applet_ae.cpp b/src/core/hle/service/am/applet_ae.cppindex e454b77d80..9df286d179 100644--- a/src/core/hle/service/am/applet_ae.cpp+++ b/src/core/hle/service/am/applet_ae.cpp@@ -202,7 +202,7 @@ private:IPC::ResponseBuilder rb{ctx, 2, 0, 1};rb.Push(RESULT_SUCCESS);- rb.PushIpcInterface<IHomeMenuFunctions>();+ rb.PushIpcInterface<IHomeMenuFunctions>(system.Kernel());}void GetGlobalStateController(Kernel::HLERequestContext& ctx) {