aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/hle/service/am/applet_message_queue.cpp
diff options
context:
space:
mode:
authoryuzubot <[email protected]>2024-03-04 13:02:54 +0000
committeryuzubot <[email protected]>2024-03-04 13:02:54 +0000
commit537296095ab24eddcb196b5ef98004f91de9c8c2 (patch)
treee75e9e2441dc3f8657cc42f2daaae08737949c2b /src/core/hle/service/am/applet_message_queue.cpp
parent2ddac7b02b660bbc7bdfe4fef240699df6d52e64 (diff)
downloadyuzu-mainline-master.tar.gz
yuzu-mainline-master.zip
"Merge Tagged PR 13018"HEADmaster
Diffstat (limited to 'src/core/hle/service/am/applet_message_queue.cpp')
-rw-r--r--src/core/hle/service/am/applet_message_queue.cpp73
1 files changed, 0 insertions, 73 deletions
diff --git a/src/core/hle/service/am/applet_message_queue.cpp b/src/core/hle/service/am/applet_message_queue.cpp
deleted file mode 100644
index 83c3c5a55..000000000
--- a/src/core/hle/service/am/applet_message_queue.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
-// SPDX-License-Identifier: GPL-2.0-or-later
-
-#include "core/hle/service/am/applet_message_queue.h"
-#include "core/hle/service/ipc_helpers.h"
-
-namespace Service::AM {
-
-AppletMessageQueue::AppletMessageQueue(Core::System& system)
- : service_context{system, "AppletMessageQueue"} {
- on_new_message = service_context.CreateEvent("AMMessageQueue:OnMessageReceived");
- on_operation_mode_changed = service_context.CreateEvent("AMMessageQueue:OperationModeChanged");
-}
-
-AppletMessageQueue::~AppletMessageQueue() {
- service_context.CloseEvent(on_new_message);
- service_context.CloseEvent(on_operation_mode_changed);
-}
-
-Kernel::KReadableEvent& AppletMessageQueue::GetMessageReceiveEvent() {
- return on_new_message->GetReadableEvent();
-}
-
-Kernel::KReadableEvent& AppletMessageQueue::GetOperationModeChangedEvent() {
- return on_operation_mode_changed->GetReadableEvent();
-}
-
-void AppletMessageQueue::PushMessage(AppletMessage msg) {
- {
- std::scoped_lock lk{lock};
- messages.push(msg);
- }
- on_new_message->Signal();
-}
-
-AppletMessage AppletMessageQueue::PopMessage() {
- std::scoped_lock lk{lock};
- if (messages.empty()) {
- on_new_message->Clear();
- return AppletMessage::None;
- }
- auto msg = messages.front();
- messages.pop();
- if (messages.empty()) {
- on_new_message->Clear();
- }
- return msg;
-}
-
-std::size_t AppletMessageQueue::GetMessageCount() const {
- std::scoped_lock lk{lock};
- return messages.size();
-}
-
-void AppletMessageQueue::RequestExit() {
- PushMessage(AppletMessage::Exit);
-}
-
-void AppletMessageQueue::RequestResume() {
- PushMessage(AppletMessage::Resume);
-}
-
-void AppletMessageQueue::FocusStateChanged() {
- PushMessage(AppletMessage::FocusStateChanged);
-}
-
-void AppletMessageQueue::OperationModeChanged() {
- PushMessage(AppletMessage::OperationModeChanged);
- PushMessage(AppletMessage::PerformanceModeChanged);
- on_operation_mode_changed->Signal();
-}
-
-} // namespace Service::AM