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
This commit is contained in:
@ -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;
|
||||
|
@ -3,6 +3,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
|
||||
enum MessageInfo
|
||||
{
|
||||
FocusStateChanged = 0xf,
|
||||
Resume = 0x10,
|
||||
OperationModeChanged = 0x1e,
|
||||
PerformanceModeChanged = 0x1f
|
||||
}
|
||||
|
Reference in New Issue
Block a user