summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-11-09 20:07:42 -0500
committerGravatar Zach Hilman2018-11-18 10:53:47 -0500
commitba03bfa4309664d55d585c89271d9656f8385a78 (patch)
treee0a640386cab993483fb727f276c5054441d57ed
parentam: Convert storage stack to vector (diff)
downloadyuzu-ba03bfa4309664d55d585c89271d9656f8385a78.tar.gz
yuzu-ba03bfa4309664d55d585c89271d9656f8385a78.tar.xz
yuzu-ba03bfa4309664d55d585c89271d9656f8385a78.zip
am: Implement PopInteractiveOutData and PushInteractiveInData
Used by software keyboard applet for data transfer.
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/am/am.cpp38
1 files changed, 24 insertions, 14 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index a872bea0c..b78489df7 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -548,6 +548,9 @@ public:
548 auto& kernel = Core::System::GetInstance().Kernel(); 548 auto& kernel = Core::System::GetInstance().Kernel();
549 state_changed_event = Kernel::Event::Create(kernel, Kernel::ResetType::OneShot, 549 state_changed_event = Kernel::Event::Create(kernel, Kernel::ResetType::OneShot,
550 "ILibraryAppletAccessor:StateChangedEvent"); 550 "ILibraryAppletAccessor:StateChangedEvent");
551 pop_interactive_out_data_event =
552 Kernel::Event::Create(kernel, Kernel::ResetType::OneShot,
553 "ILibraryAppletAccessor:PopInteractiveDataOutEvent");
551 } 554 }
552 555
553private: 556private:
@@ -596,27 +599,34 @@ private:
596 LOG_DEBUG(Service_AM, "called"); 599 LOG_DEBUG(Service_AM, "called");
597 } 600 }
598 601
599 ctx.WriteBuffer(buffer.data() + offset, size); 602 void PushInteractiveInData(Kernel::HLERequestContext& ctx) {
603 IPC::RequestParser rp{ctx};
604 interactive_storage_stack.push_back(rp.PopIpcInterface<IStorage>());
600 605
601 IPC::ResponseBuilder rb{ctx, 2}; 606 IPC::ResponseBuilder rb{ctx, 2};
602 rb.Push(RESULT_SUCCESS); 607 rb.Push(RESULT_SUCCESS);
603 608
604 LOG_DEBUG(Service_AM, "called, offset={}", offset); 609 LOG_DEBUG(Service_AM, "called");
605 } 610 }
606};
607 611
608class IStorage final : public ServiceFramework<IStorage> { 612 void PopInteractiveOutData(Kernel::HLERequestContext& ctx) {
609public: 613 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
610 explicit IStorage(std::vector<u8> buffer) 614 rb.Push(RESULT_SUCCESS);
611 : ServiceFramework("IStorage"), buffer(std::move(buffer)) { 615 rb.PushIpcInterface<IStorage>(std::move(interactive_storage_stack.back()));
612 // clang-format off
613 static const FunctionInfo functions[] = {
614 {0, &IStorage::Open, "Open"},
615 {1, nullptr, "OpenTransferStorage"},
616 };
617 // clang-format on
618 616
619 RegisterHandlers(functions); 617 interactive_storage_stack.pop_back();
618
619 LOG_DEBUG(Service_AM, "called");
620 }
621
622 void GetPopInteractiveOutDataEvent(Kernel::HLERequestContext& ctx) {
623 pop_interactive_out_data_event->Signal();
624
625 IPC::ResponseBuilder rb{ctx, 2, 1};
626 rb.Push(RESULT_SUCCESS);
627 rb.PushCopyObjects(pop_interactive_out_data_event);
628
629 LOG_WARNING(Service_AM, "(STUBBED) called");
620 } 630 }
621 631
622 std::shared_ptr<Applets::Applet> applet; 632 std::shared_ptr<Applets::Applet> applet;