|
|
@ -532,8 +532,7 @@ void ICommonStateGetter::GetPerformanceMode(Kernel::HLERequestContext& ctx) {
|
|
|
|
class ILibraryAppletAccessor final : public ServiceFramework<ILibraryAppletAccessor> {
|
|
|
|
class ILibraryAppletAccessor final : public ServiceFramework<ILibraryAppletAccessor> {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
explicit ILibraryAppletAccessor(std::shared_ptr<Applets::Applet> applet)
|
|
|
|
explicit ILibraryAppletAccessor(std::shared_ptr<Applets::Applet> applet)
|
|
|
|
: ServiceFramework("ILibraryAppletAccessor"), applet(std::move(applet)),
|
|
|
|
: ServiceFramework("ILibraryAppletAccessor"), applet(std::move(applet)) {
|
|
|
|
broker(std::make_shared<Applets::AppletDataBroker>()) {
|
|
|
|
|
|
|
|
// clang-format off
|
|
|
|
// clang-format off
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
{0, &ILibraryAppletAccessor::GetAppletStateChangedEvent, "GetAppletStateChangedEvent"},
|
|
|
|
{0, &ILibraryAppletAccessor::GetAppletStateChangedEvent, "GetAppletStateChangedEvent"},
|
|
|
@ -562,7 +561,7 @@ public:
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
void GetAppletStateChangedEvent(Kernel::HLERequestContext& ctx) {
|
|
|
|
void GetAppletStateChangedEvent(Kernel::HLERequestContext& ctx) {
|
|
|
|
const auto event = broker->GetStateChangedEvent();
|
|
|
|
const auto event = applet->GetBroker().GetStateChangedEvent();
|
|
|
|
event->Signal();
|
|
|
|
event->Signal();
|
|
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 1};
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 1};
|
|
|
@ -590,7 +589,7 @@ private:
|
|
|
|
void Start(Kernel::HLERequestContext& ctx) {
|
|
|
|
void Start(Kernel::HLERequestContext& ctx) {
|
|
|
|
ASSERT(applet != nullptr);
|
|
|
|
ASSERT(applet != nullptr);
|
|
|
|
|
|
|
|
|
|
|
|
applet->Initialize(broker);
|
|
|
|
applet->Initialize();
|
|
|
|
applet->Execute();
|
|
|
|
applet->Execute();
|
|
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
@ -601,7 +600,7 @@ private:
|
|
|
|
|
|
|
|
|
|
|
|
void PushInData(Kernel::HLERequestContext& ctx) {
|
|
|
|
void PushInData(Kernel::HLERequestContext& ctx) {
|
|
|
|
IPC::RequestParser rp{ctx};
|
|
|
|
IPC::RequestParser rp{ctx};
|
|
|
|
broker->PushNormalDataFromGame(*rp.PopIpcInterface<IStorage>());
|
|
|
|
applet->GetBroker().PushNormalDataFromGame(*rp.PopIpcInterface<IStorage>());
|
|
|
|
|
|
|
|
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2};
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
|
|
@ -612,7 +611,7 @@ private:
|
|
|
|
void PopOutData(Kernel::HLERequestContext& ctx) {
|
|
|
|
void PopOutData(Kernel::HLERequestContext& ctx) {
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
|
|
|
|
|
|
|
|
|
|
|
const auto storage = broker->PopNormalDataToGame();
|
|
|
|
const auto storage = applet->GetBroker().PopNormalDataToGame();
|
|
|
|
if (storage == nullptr) {
|
|
|
|
if (storage == nullptr) {
|
|
|
|
rb.Push(ERR_NO_DATA_IN_CHANNEL);
|
|
|
|
rb.Push(ERR_NO_DATA_IN_CHANNEL);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -626,7 +625,7 @@ private:
|
|
|
|
|
|
|
|
|
|
|
|
void PushInteractiveInData(Kernel::HLERequestContext& ctx) {
|
|
|
|
void PushInteractiveInData(Kernel::HLERequestContext& ctx) {
|
|
|
|
IPC::RequestParser rp{ctx};
|
|
|
|
IPC::RequestParser rp{ctx};
|
|
|
|
broker->PushInteractiveDataFromGame(*rp.PopIpcInterface<IStorage>());
|
|
|
|
applet->GetBroker().PushInteractiveDataFromGame(*rp.PopIpcInterface<IStorage>());
|
|
|
|
|
|
|
|
|
|
|
|
ASSERT(applet->IsInitialized());
|
|
|
|
ASSERT(applet->IsInitialized());
|
|
|
|
applet->ExecuteInteractive();
|
|
|
|
applet->ExecuteInteractive();
|
|
|
@ -641,7 +640,7 @@ private:
|
|
|
|
void PopInteractiveOutData(Kernel::HLERequestContext& ctx) {
|
|
|
|
void PopInteractiveOutData(Kernel::HLERequestContext& ctx) {
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
|
|
|
|
|
|
|
|
|
|
|
const auto storage = broker->PopInteractiveDataToGame();
|
|
|
|
const auto storage = applet->GetBroker().PopInteractiveDataToGame();
|
|
|
|
if (storage == nullptr) {
|
|
|
|
if (storage == nullptr) {
|
|
|
|
rb.Push(ERR_NO_DATA_IN_CHANNEL);
|
|
|
|
rb.Push(ERR_NO_DATA_IN_CHANNEL);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -656,7 +655,7 @@ private:
|
|
|
|
void GetPopOutDataEvent(Kernel::HLERequestContext& ctx) {
|
|
|
|
void GetPopOutDataEvent(Kernel::HLERequestContext& ctx) {
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 1};
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 1};
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
|
|
|
rb.PushCopyObjects(broker->GetNormalDataEvent());
|
|
|
|
rb.PushCopyObjects(applet->GetBroker().GetNormalDataEvent());
|
|
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_AM, "called");
|
|
|
|
LOG_DEBUG(Service_AM, "called");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -664,13 +663,12 @@ private:
|
|
|
|
void GetPopInteractiveOutDataEvent(Kernel::HLERequestContext& ctx) {
|
|
|
|
void GetPopInteractiveOutDataEvent(Kernel::HLERequestContext& ctx) {
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 1};
|
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 1};
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
|
|
|
rb.Push(RESULT_SUCCESS);
|
|
|
|
rb.PushCopyObjects(broker->GetInteractiveDataEvent());
|
|
|
|
rb.PushCopyObjects(applet->GetBroker().GetInteractiveDataEvent());
|
|
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG(Service_AM, "called");
|
|
|
|
LOG_DEBUG(Service_AM, "called");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<Applets::Applet> applet;
|
|
|
|
std::shared_ptr<Applets::Applet> applet;
|
|
|
|
std::shared_ptr<Applets::AppletDataBroker> broker;
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
void IStorage::Open(Kernel::HLERequestContext& ctx) {
|
|
|
|
void IStorage::Open(Kernel::HLERequestContext& ctx) {
|
|
|
|