diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/hle/service/am/applet_oe.cpp | 156 | ||||
-rw-r--r-- | src/core/hle/service/am/applet_oe.h | 4 |
2 files changed, 159 insertions, 1 deletions
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<IWindowController> { +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<u64>(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<IAudioController> { +public: + IAudioController() : ServiceFramework("IAudioController") {} +}; + +class IDisplayController final : public ServiceFramework<IDisplayController> { +public: + IDisplayController() : ServiceFramework("IDisplayController") {} +}; + +class IDebugFunctions final : public ServiceFramework<IDebugFunctions> { +public: + IDebugFunctions() : ServiceFramework("IDebugFunctions") {} +}; + +class ISelfController final : public ServiceFramework<ISelfController> { +public: + ISelfController() : ServiceFramework("ISelfController") {} +}; + +class ICommonStateGetter final : public ServiceFramework<ICommonStateGetter> { +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<u32>(1); + + LOG_WARNING(Service, "(STUBBED) called"); + } + + Kernel::SharedPtr<Kernel::Event> event; +}; + +class IApplicationFunctions final : public ServiceFramework<IApplicationFunctions> { +public: + IApplicationFunctions() : ServiceFramework("IApplicationFunctions") {} +}; + +class ILibraryAppletCreator final : public ServiceFramework<ILibraryAppletCreator> { +public: + ILibraryAppletCreator() : ServiceFramework("ILibraryAppletCreator") {} +}; + +class IApplicationProxy final : public ServiceFramework<IApplicationProxy> { +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<IAudioController>(); + } + + void GetDisplayController(Kernel::HLERequestContext& ctx) { + IPC::RequestBuilder rb{ctx, 1}; + rb.PushIpcInterface<IDisplayController>(); + } + + void GetDebugFunctions(Kernel::HLERequestContext& ctx) { + IPC::RequestBuilder rb{ctx, 1}; + rb.PushIpcInterface<IDebugFunctions>(); + } + + void GetWindowController(Kernel::HLERequestContext& ctx) { + IPC::RequestBuilder rb{ctx, 1}; + rb.PushIpcInterface<IWindowController>(); + } + + void GetSelfController(Kernel::HLERequestContext& ctx) { + IPC::RequestBuilder rb{ctx, 1}; + rb.PushIpcInterface<ISelfController>(); + } + + void GetCommonStateGetter(Kernel::HLERequestContext& ctx) { + IPC::RequestBuilder rb{ctx, 1}; + rb.PushIpcInterface<ICommonStateGetter>(); + } + + void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) { + IPC::RequestBuilder rb{ctx, 1}; + rb.PushIpcInterface<ILibraryAppletCreator>(); + } + + void GetApplicationFunctions(Kernel::HLERequestContext& ctx) { + IPC::RequestBuilder rb{ctx, 1}; + rb.PushIpcInterface<IApplicationFunctions>(); + } +}; + +void AppletOE::OpenApplicationProxy(Kernel::HLERequestContext& ctx) { + IPC::RequestBuilder rb{ctx, 1}; + rb.PushIpcInterface<IApplicationProxy>(); +} + 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<AppletOE> { public: AppletOE(); ~AppletOE() = default; + +private: + void OpenApplicationProxy(Kernel::HLERequestContext& ctx); }; } // namespace AM |