summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/am/am.cpp
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-11-11 22:41:31 +0100
committerZach Hilman <zachhilman@gmail.com>2018-11-18 16:53:47 +0100
commitfed6ab14c37f196f2a2fd378b46d7e5bd0118224 (patch)
tree9e199e88df8e5a35e1f18d7a2f2ca29373d90367 /src/core/hle/service/am/am.cpp
parentam: Deglobalize software keyboard applet (diff)
downloadyuzu-fed6ab14c37f196f2a2fd378b46d7e5bd0118224.tar
yuzu-fed6ab14c37f196f2a2fd378b46d7e5bd0118224.tar.gz
yuzu-fed6ab14c37f196f2a2fd378b46d7e5bd0118224.tar.bz2
yuzu-fed6ab14c37f196f2a2fd378b46d7e5bd0118224.tar.lz
yuzu-fed6ab14c37f196f2a2fd378b46d7e5bd0118224.tar.xz
yuzu-fed6ab14c37f196f2a2fd378b46d7e5bd0118224.tar.zst
yuzu-fed6ab14c37f196f2a2fd378b46d7e5bd0118224.zip
Diffstat (limited to 'src/core/hle/service/am/am.cpp')
-rw-r--r--src/core/hle/service/am/am.cpp37
1 files changed, 32 insertions, 5 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index fc464270e..ea00c5c72 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -544,7 +544,7 @@ public:
{102, nullptr, "PushExtraStorage"},
{103, &ILibraryAppletAccessor::PushInteractiveInData, "PushInteractiveInData"},
{104, &ILibraryAppletAccessor::PopInteractiveOutData, "PopInteractiveOutData"},
- {105, nullptr, "GetPopOutDataEvent"},
+ {105, &ILibraryAppletAccessor::GetPopOutDataEvent, "GetPopOutDataEvent"},
{106, &ILibraryAppletAccessor::GetPopInteractiveOutDataEvent, "GetPopInteractiveOutDataEvent"},
{110, nullptr, "NeedsToExitProcess"},
{120, nullptr, "GetLibraryAppletInfo"},
@@ -558,6 +558,8 @@ public:
auto& kernel = Core::System::GetInstance().Kernel();
state_changed_event = Kernel::Event::Create(kernel, Kernel::ResetType::OneShot,
"ILibraryAppletAccessor:StateChangedEvent");
+ pop_out_data_event = Kernel::Event::Create(kernel, Kernel::ResetType::OneShot,
+ "ILibraryAppletAccessor:PopDataOutEvent");
pop_interactive_out_data_event =
Kernel::Event::Create(kernel, Kernel::ResetType::OneShot,
"ILibraryAppletAccessor:PopInteractiveDataOutEvent");
@@ -585,9 +587,16 @@ private:
ASSERT(applet != nullptr);
applet->Initialize(storage_stack);
- interactive_storage_stack.push_back(std::make_shared<IStorage>(applet->Execute()));
+ const auto data = std::make_shared<IStorage>(applet->Execute());
state_changed_event->Signal();
- pop_interactive_out_data_event->Signal();
+
+ if (applet->TransactionComplete()) {
+ storage_stack.push_back(data);
+ pop_out_data_event->Signal();
+ } else {
+ interactive_storage_stack.push_back(data);
+ pop_interactive_out_data_event->Signal();
+ }
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
@@ -617,6 +626,19 @@ private:
IPC::RequestParser rp{ctx};
interactive_storage_stack.push_back(rp.PopIpcInterface<IStorage>());
+ ASSERT(applet->IsInitialized());
+ applet->ReceiveInteractiveData(interactive_storage_stack.back());
+ const auto data = std::make_shared<IStorage>(applet->Execute());
+ state_changed_event->Signal();
+
+ if (applet->TransactionComplete()) {
+ storage_stack.push_back(data);
+ pop_out_data_event->Signal();
+ } else {
+ interactive_storage_stack.push_back(data);
+ pop_interactive_out_data_event->Signal();
+ }
+
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
@@ -633,9 +655,13 @@ private:
LOG_DEBUG(Service_AM, "called");
}
- void GetPopInteractiveOutDataEvent(Kernel::HLERequestContext& ctx) {
- pop_interactive_out_data_event->Signal();
+ void GetPopOutDataEvent(Kernel::HLERequestContext& ctx) {
+ IPC::ResponseBuilder rb{ctx, 2, 1};
+ rb.Push(RESULT_SUCCESS);
+ rb.PushCopyObjects(pop_out_data_event);
+ }
+ void GetPopInteractiveOutDataEvent(Kernel::HLERequestContext& ctx) {
IPC::ResponseBuilder rb{ctx, 2, 1};
rb.Push(RESULT_SUCCESS);
rb.PushCopyObjects(pop_interactive_out_data_event);
@@ -647,6 +673,7 @@ private:
std::vector<std::shared_ptr<IStorage>> storage_stack;
std::vector<std::shared_ptr<IStorage>> interactive_storage_stack;
Kernel::SharedPtr<Kernel::Event> state_changed_event;
+ Kernel::SharedPtr<Kernel::Event> pop_out_data_event;
Kernel::SharedPtr<Kernel::Event> pop_interactive_out_data_event;
};