|
|
|
@ -4,6 +4,7 @@
|
|
|
|
|
|
|
|
|
|
#include "common/logging/log.h"
|
|
|
|
|
#include "core/hle/ipc_helpers.h"
|
|
|
|
|
#include "core/hle/kernel/process.h"
|
|
|
|
|
#include "core/hle/service/am/am.h"
|
|
|
|
|
#include "core/hle/service/am/applet_ae.h"
|
|
|
|
|
#include "core/hle/service/nvflinger/nvflinger.h"
|
|
|
|
@ -13,9 +14,10 @@ namespace Service::AM {
|
|
|
|
|
class ILibraryAppletProxy final : public ServiceFramework<ILibraryAppletProxy> {
|
|
|
|
|
public:
|
|
|
|
|
explicit ILibraryAppletProxy(std::shared_ptr<NVFlinger::NVFlinger> nvflinger,
|
|
|
|
|
std::shared_ptr<AppletMessageQueue> msg_queue)
|
|
|
|
|
std::shared_ptr<AppletMessageQueue> msg_queue,
|
|
|
|
|
Core::System& system)
|
|
|
|
|
: ServiceFramework("ILibraryAppletProxy"), nvflinger(std::move(nvflinger)),
|
|
|
|
|
msg_queue(std::move(msg_queue)) {
|
|
|
|
|
msg_queue(std::move(msg_queue)), system(system) {
|
|
|
|
|
// clang-format off
|
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
|
{0, &ILibraryAppletProxy::GetCommonStateGetter, "GetCommonStateGetter"},
|
|
|
|
@ -96,7 +98,7 @@ private:
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
|
|
|
|
rb.PushIpcInterface<ILibraryAppletCreator>();
|
|
|
|
|
rb.PushIpcInterface<ILibraryAppletCreator>(system.CurrentProcess()->GetTitleID());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GetApplicationFunctions(Kernel::HLERequestContext& ctx) {
|
|
|
|
@ -109,14 +111,15 @@ private:
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<NVFlinger::NVFlinger> nvflinger;
|
|
|
|
|
std::shared_ptr<AppletMessageQueue> msg_queue;
|
|
|
|
|
Core::System& system;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class ISystemAppletProxy final : public ServiceFramework<ISystemAppletProxy> {
|
|
|
|
|
public:
|
|
|
|
|
explicit ISystemAppletProxy(std::shared_ptr<NVFlinger::NVFlinger> nvflinger,
|
|
|
|
|
std::shared_ptr<AppletMessageQueue> msg_queue)
|
|
|
|
|
std::shared_ptr<AppletMessageQueue> msg_queue, Core::System& system)
|
|
|
|
|
: ServiceFramework("ISystemAppletProxy"), nvflinger(std::move(nvflinger)),
|
|
|
|
|
msg_queue(std::move(msg_queue)) {
|
|
|
|
|
msg_queue(std::move(msg_queue)), system(system) {
|
|
|
|
|
// clang-format off
|
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
|
{0, &ISystemAppletProxy::GetCommonStateGetter, "GetCommonStateGetter"},
|
|
|
|
@ -191,7 +194,7 @@ private:
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
|
|
|
|
rb.PushIpcInterface<ILibraryAppletCreator>();
|
|
|
|
|
rb.PushIpcInterface<ILibraryAppletCreator>(system.CurrentProcess()->GetTitleID());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GetHomeMenuFunctions(Kernel::HLERequestContext& ctx) {
|
|
|
|
@ -219,6 +222,7 @@ private:
|
|
|
|
|
}
|
|
|
|
|
std::shared_ptr<NVFlinger::NVFlinger> nvflinger;
|
|
|
|
|
std::shared_ptr<AppletMessageQueue> msg_queue;
|
|
|
|
|
Core::System& system;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void AppletAE::OpenSystemAppletProxy(Kernel::HLERequestContext& ctx) {
|
|
|
|
@ -226,7 +230,7 @@ void AppletAE::OpenSystemAppletProxy(Kernel::HLERequestContext& ctx) {
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
|
|
|
|
rb.PushIpcInterface<ISystemAppletProxy>(nvflinger, msg_queue);
|
|
|
|
|
rb.PushIpcInterface<ISystemAppletProxy>(nvflinger, msg_queue, system);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AppletAE::OpenLibraryAppletProxy(Kernel::HLERequestContext& ctx) {
|
|
|
|
@ -234,7 +238,7 @@ void AppletAE::OpenLibraryAppletProxy(Kernel::HLERequestContext& ctx) {
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
|
|
|
|
rb.PushIpcInterface<ILibraryAppletProxy>(nvflinger, msg_queue);
|
|
|
|
|
rb.PushIpcInterface<ILibraryAppletProxy>(nvflinger, msg_queue, system);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AppletAE::OpenLibraryAppletProxyOld(Kernel::HLERequestContext& ctx) {
|
|
|
|
@ -242,13 +246,13 @@ void AppletAE::OpenLibraryAppletProxyOld(Kernel::HLERequestContext& ctx) {
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
|
|
|
|
rb.PushIpcInterface<ILibraryAppletProxy>(nvflinger, msg_queue);
|
|
|
|
|
rb.PushIpcInterface<ILibraryAppletProxy>(nvflinger, msg_queue, system);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AppletAE::AppletAE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger,
|
|
|
|
|
std::shared_ptr<AppletMessageQueue> msg_queue)
|
|
|
|
|
std::shared_ptr<AppletMessageQueue> msg_queue, Core::System& system)
|
|
|
|
|
: ServiceFramework("appletAE"), nvflinger(std::move(nvflinger)),
|
|
|
|
|
msg_queue(std::move(msg_queue)) {
|
|
|
|
|
msg_queue(std::move(msg_queue)), system(system) {
|
|
|
|
|
// clang-format off
|
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
|
{100, &AppletAE::OpenSystemAppletProxy, "OpenSystemAppletProxy"},
|
|
|
|
|