From 0158dc4db310b320a38eaf09e67276e4af8a12bf Mon Sep 17 00:00:00 2001 From: Ac_K Date: Sun, 20 Sep 2020 06:32:58 +0200 Subject: [PATCH] acc/hid: Implement ListQualifiedUsers and SetTouchScreenConfiguration (#1555) * acc/hid: Implement ListQualifiedUsers and SetTouchScreenConfiguration * Fix symbols --- .../Acc/IAccountServiceForApplication.cs | 25 +++++++++++++++++++ Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs | 12 +++++++++ 2 files changed, 37 insertions(+) diff --git a/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForApplication.cs b/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForApplication.cs index d1bf94e7..6382a4ba 100644 --- a/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForApplication.cs +++ b/Ryujinx.HLE/HOS/Services/Account/Acc/IAccountServiceForApplication.cs @@ -274,6 +274,31 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc return ResultCode.Success; } + [Command(131)] // 6.0.0+ + // ListOpenContextStoredUsers() -> array + public ResultCode ListOpenContextStoredUsers(ServiceCtx context) + { + long outputPosition = context.Request.RecvListBuff[0].Position; + long outputSize = context.Request.RecvListBuff[0].Size; + + MemoryHelper.FillWithZeros(context.Memory, outputPosition, (int)outputSize); + + // TODO: This seems to write stored userids of the OpenContext in the buffer. We needs to determine them. + + Logger.Stub?.PrintStub(LogClass.ServiceAcc); + + return ResultCode.Success; + } + + [Command(141)] // 6.0.0+ + // ListQualifiedUsers() -> array + public ResultCode ListQualifiedUsers(ServiceCtx context) + { + // TODO: Determine how users are "qualified". We assume all users are "qualified" for now. + + return WriteUserList(context, context.Device.System.State.Account.GetAllUsers()); + } + [Command(150)] // 6.0.0+ // IsUserAccountSwitchLocked() -> bool public ResultCode IsUserAccountSwitchLocked(ServiceCtx context) diff --git a/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs b/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs index ec4c0980..a700b0ca 100644 --- a/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs +++ b/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs @@ -1501,5 +1501,17 @@ namespace Ryujinx.HLE.HOS.Services.Hid return ResultCode.Success; } + + [Command(1002)] // 9.0.0+ + // SetTouchScreenConfiguration(nn::hid::TouchScreenConfigurationForNx, nn::applet::AppletResourceUserId) + public ResultCode SetTouchScreenConfiguration(ServiceCtx context) + { + long touchScreenConfigurationForNx = context.RequestData.ReadInt64(); + long appletResourceUserId = context.RequestData.ReadInt64(); + + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { appletResourceUserId, touchScreenConfigurationForNx }); + + return ResultCode.Success; + } } }