diff options
| author | Ac_K <Acoustik666@gmail.com> | 2020-12-16 01:41:42 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-15 21:41:42 -0300 |
| commit | 808380690c684a7598efad791f560e02ce70bc82 (patch) | |
| tree | 8103996f96b852affbfa55e48dde99cd63d55dcb /Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy | |
| parent | 3332b29f01993d22195f417d39ae4074d53fb55c (diff) | |
am/gui: Implement Wake-up message (#1750)
* am/gui: Implement Wake-up message.
This implement the ability to send a Wake-up (Resume) message to the guest.
Sometime games needs to Sleep and Wake-up the switch to unlock some ingame features.
* Address gdkchan feedback
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy')
2 files changed, 16 insertions, 1 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs index e3b73c29..0d003aba 100644 --- a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs +++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/ICommonStateGetter.cs @@ -46,11 +46,25 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys // ReceiveMessage() -> nn::am::AppletMessage public ResultCode ReceiveMessage(ServiceCtx context) { - if (!context.Device.System.AppletState.TryDequeueMessage(out MessageInfo message)) + if (!context.Device.System.AppletState.Messages.TryDequeue(out MessageInfo message)) { return ResultCode.NoMessages; } + KEvent messageEvent = context.Device.System.AppletState.MessageEvent; + + // NOTE: Service checks if current states are different than the stored ones. + // Since we don't support any states for now, it's fine to check if there is still messages available. + + if (context.Device.System.AppletState.Messages.IsEmpty) + { + messageEvent.ReadableEvent.Clear(); + } + else + { + messageEvent.ReadableEvent.Signal(); + } + context.ResponseData.Write((int)message); return ResultCode.Success; diff --git a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/Types/MessageInfo.cs b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/Types/MessageInfo.cs index ff699315..0291b9bc 100644 --- a/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/Types/MessageInfo.cs +++ b/Ryujinx.HLE/HOS/Services/Am/AppletAE/AllSystemAppletProxiesService/SystemAppletProxy/Types/MessageInfo.cs @@ -3,6 +3,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys enum MessageInfo { FocusStateChanged = 0xf, + Resume = 0x10, OperationModeChanged = 0x1e, PerformanceModeChanged = 0x1f } |
