From cada4d04efe8a3c19c290da3257c231da9872e40 Mon Sep 17 00:00:00 2001 From: Tsubasa0504 <60139445+Tsubasa0504@users.noreply.github.com> Date: Tue, 14 May 2024 23:26:49 +0900 Subject: [PATCH] HID: Stub IHidServer: 134 (SetNpadAnalogStickUseCenterClamp) (#6664) * Add files via upload * Update IHidServer.cs mistakes... * format how do i do it * Update src/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs Co-authored-by: Agatem * Update src/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs Co-authored-by: Agatem * bruh * Apply suggestions from code review Co-authored-by: gdkchan * use readuint32 instead * second thought * i hope it works thanks someone higher up with the same thing * pid * Apply suggestions from code review Co-authored-by: Ac_K * styles i think * Apply suggestions from code review Co-authored-by: makigumo --------- Co-authored-by: Agatem Co-authored-by: gdkchan Co-authored-by: Ac_K Co-authored-by: makigumo --- src/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs b/src/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs index bcc87f53..e3f505f3 100644 --- a/src/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs +++ b/src/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs @@ -22,6 +22,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid private bool _sixAxisSensorFusionEnabled; private bool _unintendedHomeButtonInputProtectionEnabled; + private bool _npadAnalogStickCenterClampEnabled; private bool _vibrationPermitted; private bool _usbFullKeyControllerEnabled; private readonly bool _isFirmwareUpdateAvailableForSixAxisSensor; @@ -1107,6 +1108,19 @@ namespace Ryujinx.HLE.HOS.Services.Hid // If not, it returns nothing. } + [CommandCmif(134)] // 6.1.0+ + // SetNpadUseAnalogStickUseCenterClamp(bool Enable, nn::applet::AppletResourceUserId) + public ResultCode SetNpadUseAnalogStickUseCenterClamp(ServiceCtx context) + { + ulong pid = context.RequestData.ReadUInt64(); + _npadAnalogStickCenterClampEnabled = context.RequestData.ReadUInt32() != 0; + long appletResourceUserId = context.RequestData.ReadInt64(); + + Logger.Stub?.PrintStub(LogClass.ServiceHid, new { pid, appletResourceUserId, _npadAnalogStickCenterClampEnabled }); + + return ResultCode.Success; + } + [CommandCmif(200)] // GetVibrationDeviceInfo(nn::hid::VibrationDeviceHandle) -> nn::hid::VibrationDeviceInfo public ResultCode GetVibrationDeviceInfo(ServiceCtx context)