From 1d01ffccb8a3435d092ab61b4043b41dc5a70eaa Mon Sep 17 00:00:00 2001 From: bunnei Date: Fri, 29 Dec 2017 00:44:46 -0500 Subject: applet_oe: Stub out a bunch of interfaces necessary for boot. --- src/core/hle/service/am/applet_oe.cpp | 156 +++++++++++++++++++++++++++++++++- src/core/hle/service/am/applet_oe.h | 4 + 2 files changed, 159 insertions(+), 1 deletion(-) (limited to 'src/core/hle/service/am') diff --git a/src/core/hle/service/am/applet_oe.cpp b/src/core/hle/service/am/applet_oe.cpp index cd8901d2f..6fe7bdce5 100644 --- a/src/core/hle/service/am/applet_oe.cpp +++ b/src/core/hle/service/am/applet_oe.cpp @@ -4,14 +4,168 @@ #include "common/logging/log.h" #include "core/hle/ipc_helpers.h" +#include "core/hle/kernel/event.h" #include "core/hle/service/am/applet_oe.h" namespace Service { namespace AM { +class IWindowController final : public ServiceFramework { +public: + IWindowController() : ServiceFramework("IWindowController") { + static const FunctionInfo functions[] = { + {1, &IWindowController::GetAppletResourceUserId, "GetAppletResourceUserId"}, + {10, &IWindowController::AcquireForegroundRights, "AcquireForegroundRights"}, + }; + RegisterHandlers(functions); + } + +private: + void GetAppletResourceUserId(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service, "(STUBBED) called"); + IPC::RequestBuilder rb{ctx, 3}; + rb.Push(RESULT_SUCCESS); + rb.Push(0); + } + + void AcquireForegroundRights(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service, "(STUBBED) called"); + IPC::RequestBuilder rb{ctx, 1}; + rb.Push(RESULT_SUCCESS); + } +}; + +class IAudioController final : public ServiceFramework { +public: + IAudioController() : ServiceFramework("IAudioController") {} +}; + +class IDisplayController final : public ServiceFramework { +public: + IDisplayController() : ServiceFramework("IDisplayController") {} +}; + +class IDebugFunctions final : public ServiceFramework { +public: + IDebugFunctions() : ServiceFramework("IDebugFunctions") {} +}; + +class ISelfController final : public ServiceFramework { +public: + ISelfController() : ServiceFramework("ISelfController") {} +}; + +class ICommonStateGetter final : public ServiceFramework { +public: + ICommonStateGetter() : ServiceFramework("ICommonStateGetter") { + static const FunctionInfo functions[] = { + {0, &ICommonStateGetter::GetEventHandle, "GetEventHandle"}, + {1, &ICommonStateGetter::ReceiveMessage, "ReceiveMessage"}, + }; + RegisterHandlers(functions); + + event = Kernel::Event::Create(Kernel::ResetType::OneShot, "ICommonStateGetter:Event"); + } + +private: + void GetEventHandle(Kernel::HLERequestContext& ctx) { + event->Signal(); + + IPC::RequestBuilder rb{ctx, 2, 1}; + rb.Push(RESULT_SUCCESS); + rb.PushObjects(event); + + LOG_WARNING(Service, "(STUBBED) called"); + } + + void ReceiveMessage(Kernel::HLERequestContext& ctx) { + IPC::RequestBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); + rb.Skip(1, true); + rb.Push(1); + + LOG_WARNING(Service, "(STUBBED) called"); + } + + Kernel::SharedPtr event; +}; + +class IApplicationFunctions final : public ServiceFramework { +public: + IApplicationFunctions() : ServiceFramework("IApplicationFunctions") {} +}; + +class ILibraryAppletCreator final : public ServiceFramework { +public: + ILibraryAppletCreator() : ServiceFramework("ILibraryAppletCreator") {} +}; + +class IApplicationProxy final : public ServiceFramework { +public: + IApplicationProxy() : ServiceFramework("IApplicationProxy") { + static const FunctionInfo functions[] = { + {0, &IApplicationProxy::GetCommonStateGetter, "GetCommonStateGetter"}, + {1, &IApplicationProxy::GetSelfController, "GetSelfController"}, + {2, &IApplicationProxy::GetWindowController, "GetWindowController"}, + {3, &IApplicationProxy::GetAudioController, "GetAudioController"}, + {4, &IApplicationProxy::GetDisplayController, "GetDisplayController"}, + {11, &IApplicationProxy::GetLibraryAppletCreator, "GetLibraryAppletCreator"}, + {20, &IApplicationProxy::GetApplicationFunctions, "GetApplicationFunctions"}, + {1000, &IApplicationProxy::GetDebugFunctions, "GetDebugFunctions"}, + }; + RegisterHandlers(functions); + } + +private: + void GetAudioController(Kernel::HLERequestContext& ctx) { + IPC::RequestBuilder rb{ctx, 1}; + rb.PushIpcInterface(); + } + + void GetDisplayController(Kernel::HLERequestContext& ctx) { + IPC::RequestBuilder rb{ctx, 1}; + rb.PushIpcInterface(); + } + + void GetDebugFunctions(Kernel::HLERequestContext& ctx) { + IPC::RequestBuilder rb{ctx, 1}; + rb.PushIpcInterface(); + } + + void GetWindowController(Kernel::HLERequestContext& ctx) { + IPC::RequestBuilder rb{ctx, 1}; + rb.PushIpcInterface(); + } + + void GetSelfController(Kernel::HLERequestContext& ctx) { + IPC::RequestBuilder rb{ctx, 1}; + rb.PushIpcInterface(); + } + + void GetCommonStateGetter(Kernel::HLERequestContext& ctx) { + IPC::RequestBuilder rb{ctx, 1}; + rb.PushIpcInterface(); + } + + void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) { + IPC::RequestBuilder rb{ctx, 1}; + rb.PushIpcInterface(); + } + + void GetApplicationFunctions(Kernel::HLERequestContext& ctx) { + IPC::RequestBuilder rb{ctx, 1}; + rb.PushIpcInterface(); + } +}; + +void AppletOE::OpenApplicationProxy(Kernel::HLERequestContext& ctx) { + IPC::RequestBuilder rb{ctx, 1}; + rb.PushIpcInterface(); +} + AppletOE::AppletOE() : ServiceFramework("appletOE") { static const FunctionInfo functions[] = { - {0x00000000, nullptr, "OpenApplicationProxy"}, + {0x00000000, &AppletOE::OpenApplicationProxy, "OpenApplicationProxy"}, }; RegisterHandlers(functions); } diff --git a/src/core/hle/service/am/applet_oe.h b/src/core/hle/service/am/applet_oe.h index 6e1173f01..899ba5570 100644 --- a/src/core/hle/service/am/applet_oe.h +++ b/src/core/hle/service/am/applet_oe.h @@ -4,6 +4,7 @@ #pragma once +#include "core/hle/kernel/hle_ipc.h" #include "core/hle/service/service.h" namespace Service { @@ -13,6 +14,9 @@ class AppletOE final : public ServiceFramework { public: AppletOE(); ~AppletOE() = default; + +private: + void OpenApplicationProxy(Kernel::HLERequestContext& ctx); }; } // namespace AM -- cgit v1.2.3