diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/am/applets/applets.cpp | 24 | ||||
-rw-r--r-- | src/core/hle/service/am/applets/applets.h | 6 |
2 files changed, 12 insertions, 18 deletions
diff --git a/src/core/hle/service/am/applets/applets.cpp b/src/core/hle/service/am/applets/applets.cpp index 494205322..47da35537 100644 --- a/src/core/hle/service/am/applets/applets.cpp +++ b/src/core/hle/service/am/applets/applets.cpp @@ -15,11 +15,11 @@ namespace Service::AM::Applets { AppletDataBroker::AppletDataBroker() { auto& kernel = Core::System::GetInstance().Kernel(); - state_changed_event = Kernel::WritableEvent::CreateRegisteredEventPair( + state_changed_event = Kernel::WritableEvent::CreateEventPair( kernel, Kernel::ResetType::OneShot, "ILibraryAppletAccessor:StateChangedEvent"); - pop_out_data_event = Kernel::WritableEvent::CreateRegisteredEventPair( + pop_out_data_event = Kernel::WritableEvent::CreateEventPair( kernel, Kernel::ResetType::OneShot, "ILibraryAppletAccessor:PopDataOutEvent"); - pop_interactive_out_data_event = Kernel::WritableEvent::CreateRegisteredEventPair( + pop_interactive_out_data_event = Kernel::WritableEvent::CreateEventPair( kernel, Kernel::ResetType::OneShot, "ILibraryAppletAccessor:PopInteractiveDataOutEvent"); } @@ -67,7 +67,7 @@ void AppletDataBroker::PushNormalDataFromGame(IStorage storage) { void AppletDataBroker::PushNormalDataFromApplet(IStorage storage) { out_channel.push(std::make_unique<IStorage>(storage)); - pop_out_data_event->Signal(); + pop_out_data_event.writable->Signal(); } void AppletDataBroker::PushInteractiveDataFromGame(IStorage storage) { @@ -76,29 +76,23 @@ void AppletDataBroker::PushInteractiveDataFromGame(IStorage storage) { void AppletDataBroker::PushInteractiveDataFromApplet(IStorage storage) { out_interactive_channel.push(std::make_unique<IStorage>(storage)); - pop_interactive_out_data_event->Signal(); + pop_interactive_out_data_event.writable->Signal(); } void AppletDataBroker::SignalStateChanged() const { - state_changed_event->Signal(); + state_changed_event.writable->Signal(); } Kernel::SharedPtr<Kernel::ReadableEvent> AppletDataBroker::GetNormalDataEvent() const { - const auto& event{Core::System::GetInstance().Kernel().FindNamedEvent( - "ILibraryAppletAccessor:PopDataOutEvent")}; - return event->second; + return pop_out_data_event.readable; } Kernel::SharedPtr<Kernel::ReadableEvent> AppletDataBroker::GetInteractiveDataEvent() const { - const auto& event{Core::System::GetInstance().Kernel().FindNamedEvent( - "ILibraryAppletAccessor:PopInteractiveDataOutEvent")}; - return event->second; + return pop_interactive_out_data_event.readable; } Kernel::SharedPtr<Kernel::ReadableEvent> AppletDataBroker::GetStateChangedEvent() const { - const auto& event{Core::System::GetInstance().Kernel().FindNamedEvent( - "ILibraryAppletAccessor:StateChangedEvent")}; - return event->second; + return state_changed_event.readable; } Applet::Applet() = default; diff --git a/src/core/hle/service/am/applets/applets.h b/src/core/hle/service/am/applets/applets.h index 5cd6232cc..3eff471eb 100644 --- a/src/core/hle/service/am/applets/applets.h +++ b/src/core/hle/service/am/applets/applets.h @@ -60,13 +60,13 @@ private: // PopInteractiveDataToGame and PushInteractiveDataFromApplet std::queue<std::unique_ptr<IStorage>> out_interactive_channel; - Kernel::SharedPtr<Kernel::WritableEvent> state_changed_event; + Kernel::EventPair state_changed_event; // Signaled on PushNormalDataFromApplet - Kernel::SharedPtr<Kernel::WritableEvent> pop_out_data_event; + Kernel::EventPair pop_out_data_event; // Signaled on PushInteractiveDataFromApplet - Kernel::SharedPtr<Kernel::WritableEvent> pop_interactive_out_data_event; + Kernel::EventPair pop_interactive_out_data_event; }; class Applet { |