From 1b714ab1aabe542862cda731abbc55b9506bd4c9 Mon Sep 17 00:00:00 2001 From: sh0inx Date: Sun, 15 Mar 2026 09:46:36 -0500 Subject: [PATCH] [HLE] Added "null" check for isAtRest If an npad device was checking for if the device was at rest, we called `GetSixAxisSensorLifo()` -- if the npad was of type `None`, it triggered the `NotImplementedException` in that method because `None` doesn't have a gyroscope, and therefore no data attached to it. --- src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs b/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs index a79360b91..cf5e22694 100644 --- a/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs +++ b/src/Ryujinx.HLE/HOS/Services/Hid/HidDevices/NpadDevices.cs @@ -584,8 +584,13 @@ namespace Ryujinx.HLE.HOS.Services.Hid public bool isAtRest(int playerNumber) { - ref NpadInternalState currentNpad = ref _device.Hid.SharedMemory.Npads[playerNumber].InternalState; + + if (currentNpad.StyleSet == NpadStyleTag.None) + { + return true; // it will always be at rest because it cannot move. + } + ref SixAxisSensorState storage = ref GetSixAxisSensorLifo(ref currentNpad, false).GetCurrentEntryRef(); float acceleration = Math.Abs(storage.Acceleration.X)