| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- // Copyright 2018 yuzu emulator team
- // Licensed under GPLv2 or any later version
- // Refer to the license.txt file included.
- #include "common/logging/log.h"
- #include "core/hle/ipc_helpers.h"
- #include "core/hle/service/am/am.h"
- #include "core/hle/service/am/applet_ae.h"
- #include "core/hle/service/nvflinger/nvflinger.h"
- namespace Service::AM {
- class ILibraryAppletProxy final : public ServiceFramework<ILibraryAppletProxy> {
- public:
- ILibraryAppletProxy(std::shared_ptr<NVFlinger::NVFlinger> nvflinger)
- : ServiceFramework("ILibraryAppletProxy"), nvflinger(std::move(nvflinger)) {
- static const FunctionInfo functions[] = {
- {0, &ILibraryAppletProxy::GetCommonStateGetter, "GetCommonStateGetter"},
- {1, &ILibraryAppletProxy::GetSelfController, "GetSelfController"},
- {2, &ILibraryAppletProxy::GetWindowController, "GetWindowController"},
- {3, &ILibraryAppletProxy::GetAudioController, "GetAudioController"},
- {4, &ILibraryAppletProxy::GetDisplayController, "GetDisplayController"},
- {10, nullptr, "GetProcessWindingController"},
- {11, &ILibraryAppletProxy::GetLibraryAppletCreator, "GetLibraryAppletCreator"},
- {20, &ILibraryAppletProxy::GetApplicationFunctions, "GetApplicationFunctions"},
- {1000, &ILibraryAppletProxy::GetDebugFunctions, "GetDebugFunctions"},
- };
- RegisterHandlers(functions);
- }
- private:
- void GetCommonStateGetter(Kernel::HLERequestContext& ctx) {
- IPC::ResponseBuilder rb{ctx, 2, 0, 1};
- rb.Push(RESULT_SUCCESS);
- rb.PushIpcInterface<ICommonStateGetter>();
- NGLOG_DEBUG(Service_AM, "called");
- }
- void GetSelfController(Kernel::HLERequestContext& ctx) {
- IPC::ResponseBuilder rb{ctx, 2, 0, 1};
- rb.Push(RESULT_SUCCESS);
- rb.PushIpcInterface<ISelfController>(nvflinger);
- NGLOG_DEBUG(Service_AM, "called");
- }
- void GetWindowController(Kernel::HLERequestContext& ctx) {
- IPC::ResponseBuilder rb{ctx, 2, 0, 1};
- rb.Push(RESULT_SUCCESS);
- rb.PushIpcInterface<IWindowController>();
- NGLOG_DEBUG(Service_AM, "called");
- }
- void GetAudioController(Kernel::HLERequestContext& ctx) {
- IPC::ResponseBuilder rb{ctx, 2, 0, 1};
- rb.Push(RESULT_SUCCESS);
- rb.PushIpcInterface<IAudioController>();
- NGLOG_DEBUG(Service_AM, "called");
- }
- void GetDisplayController(Kernel::HLERequestContext& ctx) {
- IPC::ResponseBuilder rb{ctx, 2, 0, 1};
- rb.Push(RESULT_SUCCESS);
- rb.PushIpcInterface<IDisplayController>();
- NGLOG_DEBUG(Service_AM, "called");
- }
- void GetDebugFunctions(Kernel::HLERequestContext& ctx) {
- IPC::ResponseBuilder rb{ctx, 2, 0, 1};
- rb.Push(RESULT_SUCCESS);
- rb.PushIpcInterface<IDebugFunctions>();
- NGLOG_DEBUG(Service_AM, "called");
- }
- void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) {
- IPC::ResponseBuilder rb{ctx, 2, 0, 1};
- rb.Push(RESULT_SUCCESS);
- rb.PushIpcInterface<ILibraryAppletCreator>();
- NGLOG_DEBUG(Service_AM, "called");
- }
- void GetApplicationFunctions(Kernel::HLERequestContext& ctx) {
- IPC::ResponseBuilder rb{ctx, 2, 0, 1};
- rb.Push(RESULT_SUCCESS);
- rb.PushIpcInterface<IApplicationFunctions>();
- NGLOG_DEBUG(Service_AM, "called");
- }
- std::shared_ptr<NVFlinger::NVFlinger> nvflinger;
- };
- void AppletAE::OpenLibraryAppletProxyOld(Kernel::HLERequestContext& ctx) {
- IPC::ResponseBuilder rb{ctx, 2, 0, 1};
- rb.Push(RESULT_SUCCESS);
- rb.PushIpcInterface<ILibraryAppletProxy>(nvflinger);
- NGLOG_DEBUG(Service_AM, "called");
- }
- AppletAE::AppletAE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger)
- : ServiceFramework("appletAE"), nvflinger(std::move(nvflinger)) {
- static const FunctionInfo functions[] = {
- {100, nullptr, "OpenSystemAppletProxy"},
- {200, &AppletAE::OpenLibraryAppletProxyOld, "OpenLibraryAppletProxyOld"},
- {201, nullptr, "OpenLibraryAppletProxy"},
- {300, nullptr, "OpenOverlayAppletProxy"},
- {350, nullptr, "OpenSystemApplicationProxy"},
- {400, nullptr, "CreateSelfLibraryAppletCreatorForDevelop"},
- };
- RegisterHandlers(functions);
- }
- } // namespace Service::AM
|