summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/am/applets
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-11-27 15:18:29 +0100
committerZach Hilman <zachhilman@gmail.com>2018-11-29 14:48:40 +0100
commita342bcc9b130e9bd78720e09e04c92dcac8840d0 (patch)
treedf1d16c2a71b121fc449b53fc931c6fac8ccf82a /src/core/hle/service/am/applets
parentcore: Port all current usages of Event to Readable/WritableEvent (diff)
downloadyuzu-a342bcc9b130e9bd78720e09e04c92dcac8840d0.tar
yuzu-a342bcc9b130e9bd78720e09e04c92dcac8840d0.tar.gz
yuzu-a342bcc9b130e9bd78720e09e04c92dcac8840d0.tar.bz2
yuzu-a342bcc9b130e9bd78720e09e04c92dcac8840d0.tar.lz
yuzu-a342bcc9b130e9bd78720e09e04c92dcac8840d0.tar.xz
yuzu-a342bcc9b130e9bd78720e09e04c92dcac8840d0.tar.zst
yuzu-a342bcc9b130e9bd78720e09e04c92dcac8840d0.zip
Diffstat (limited to 'src/core/hle/service/am/applets')
-rw-r--r--src/core/hle/service/am/applets/applets.cpp24
-rw-r--r--src/core/hle/service/am/applets/applets.h6
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 {