Browse Source
Service/am: Add AppletAE service (#153)
Service/am: Add AppletAE service (#153)
* Add AppletAE, step 1: move common interfaces to am.h * Add AppletAE, step 2pull/15/merge
committed by
bunnei
7 changed files with 571 additions and 379 deletions
-
2src/core/CMakeLists.txt
-
333src/core/hle/service/am/am.cpp
-
93src/core/hle/service/am/am.h
-
112src/core/hle/service/am/applet_ae.cpp
-
30src/core/hle/service/am/applet_ae.h
-
374src/core/hle/service/am/applet_oe.cpp
-
6src/core/hle/service/am/applet_oe.h
@ -0,0 +1,112 @@ |
|||||
|
// 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 { |
||||
|
namespace 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"}, |
||||
|
{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>(); |
||||
|
LOG_DEBUG(Service, "called"); |
||||
|
} |
||||
|
|
||||
|
void GetSelfController(Kernel::HLERequestContext& ctx) { |
||||
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
||||
|
rb.Push(RESULT_SUCCESS); |
||||
|
rb.PushIpcInterface<ISelfController>(nvflinger); |
||||
|
LOG_DEBUG(Service, "called"); |
||||
|
} |
||||
|
|
||||
|
void GetWindowController(Kernel::HLERequestContext& ctx) { |
||||
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
||||
|
rb.Push(RESULT_SUCCESS); |
||||
|
rb.PushIpcInterface<IWindowController>(); |
||||
|
LOG_DEBUG(Service, "called"); |
||||
|
} |
||||
|
|
||||
|
void GetAudioController(Kernel::HLERequestContext& ctx) { |
||||
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
||||
|
rb.Push(RESULT_SUCCESS); |
||||
|
rb.PushIpcInterface<IAudioController>(); |
||||
|
LOG_DEBUG(Service, "called"); |
||||
|
} |
||||
|
|
||||
|
void GetDisplayController(Kernel::HLERequestContext& ctx) { |
||||
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
||||
|
rb.Push(RESULT_SUCCESS); |
||||
|
rb.PushIpcInterface<IDisplayController>(); |
||||
|
LOG_DEBUG(Service, "called"); |
||||
|
} |
||||
|
|
||||
|
void GetDebugFunctions(Kernel::HLERequestContext& ctx) { |
||||
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
||||
|
rb.Push(RESULT_SUCCESS); |
||||
|
rb.PushIpcInterface<IDebugFunctions>(); |
||||
|
LOG_DEBUG(Service, "called"); |
||||
|
} |
||||
|
|
||||
|
void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) { |
||||
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
||||
|
rb.Push(RESULT_SUCCESS); |
||||
|
rb.PushIpcInterface<ILibraryAppletCreator>(); |
||||
|
LOG_DEBUG(Service, "called"); |
||||
|
} |
||||
|
|
||||
|
void GetApplicationFunctions(Kernel::HLERequestContext& ctx) { |
||||
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
||||
|
rb.Push(RESULT_SUCCESS); |
||||
|
rb.PushIpcInterface<IApplicationFunctions>(); |
||||
|
LOG_DEBUG(Service, "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); |
||||
|
LOG_DEBUG(Service, "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 AM
|
||||
|
} // namespace Service
|
||||
@ -0,0 +1,30 @@ |
|||||
|
// Copyright 2018 yuzu emulator team |
||||
|
// Licensed under GPLv2 or any later version |
||||
|
// Refer to the license.txt file included. |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include <memory> |
||||
|
#include "core/hle/kernel/hle_ipc.h" |
||||
|
#include "core/hle/service/service.h" |
||||
|
|
||||
|
namespace Service { |
||||
|
namespace NVFlinger { |
||||
|
class NVFlinger; |
||||
|
} |
||||
|
|
||||
|
namespace AM { |
||||
|
|
||||
|
class AppletAE final : public ServiceFramework<AppletAE> { |
||||
|
public: |
||||
|
AppletAE(std::shared_ptr<NVFlinger::NVFlinger> nvflinger); |
||||
|
~AppletAE() = default; |
||||
|
|
||||
|
private: |
||||
|
void OpenLibraryAppletProxyOld(Kernel::HLERequestContext& ctx); |
||||
|
|
||||
|
std::shared_ptr<NVFlinger::NVFlinger> nvflinger; |
||||
|
}; |
||||
|
|
||||
|
} // namespace AM |
||||
|
} // namespace Service |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue