summaryrefslogtreecommitdiff
path: root/src/core/hle
diff options
context:
space:
mode:
authorGravatar Zach Hilman2019-07-06 13:09:27 -0400
committerGravatar Zach Hilman2019-09-21 22:24:10 -0400
commit4c1c8801a51335aa4a74e7db0868b861803d0c61 (patch)
tree98304ff292ee922a6acc9d384c74a8d9ed47efd6 /src/core/hle
parentcore: Track system exit lock status (diff)
downloadyuzu-4c1c8801a51335aa4a74e7db0868b861803d0c61.tar.gz
yuzu-4c1c8801a51335aa4a74e7db0868b861803d0c61.tar.xz
yuzu-4c1c8801a51335aa4a74e7db0868b861803d0c61.zip
am: Add RequestExit event to AppletMessageQueue
Tested against libnx, signals to games to begin cleanup.
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/service/am/am.cpp4
-rw-r--r--src/core/hle/service/am/am.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 6c594dcaf..c98fefdeb 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -550,6 +550,10 @@ void AppletMessageQueue::OperationModeChanged() {
550 on_operation_mode_changed.writable->Signal(); 550 on_operation_mode_changed.writable->Signal();
551} 551}
552 552
553void AppletMessageQueue::RequestExit() {
554 PushMessage(AppletMessage::ExitRequested);
555}
556
553ICommonStateGetter::ICommonStateGetter(Core::System& system, 557ICommonStateGetter::ICommonStateGetter(Core::System& system,
554 std::shared_ptr<AppletMessageQueue> msg_queue) 558 std::shared_ptr<AppletMessageQueue> msg_queue)
555 : ServiceFramework("ICommonStateGetter"), system(system), msg_queue(std::move(msg_queue)) { 559 : ServiceFramework("ICommonStateGetter"), system(system), msg_queue(std::move(msg_queue)) {
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h
index 28f870302..9d2c8b2ca 100644
--- a/src/core/hle/service/am/am.h
+++ b/src/core/hle/service/am/am.h
@@ -45,6 +45,7 @@ class AppletMessageQueue {
45public: 45public:
46 enum class AppletMessage : u32 { 46 enum class AppletMessage : u32 {
47 NoMessage = 0, 47 NoMessage = 0,
48 ExitRequested = 4,
48 FocusStateChanged = 15, 49 FocusStateChanged = 15,
49 OperationModeChanged = 30, 50 OperationModeChanged = 30,
50 PerformanceModeChanged = 31, 51 PerformanceModeChanged = 31,
@@ -59,6 +60,7 @@ public:
59 AppletMessage PopMessage(); 60 AppletMessage PopMessage();
60 std::size_t GetMessageCount() const; 61 std::size_t GetMessageCount() const;
61 void OperationModeChanged(); 62 void OperationModeChanged();
63 void RequestExit();
62 64
63private: 65private:
64 std::queue<AppletMessage> messages; 66 std::queue<AppletMessage> messages;