Rebased w/ master, cleanup

This commit is contained in:
Shyanne
2026-02-04 04:22:28 -05:00
parent d41cee9c48
commit f3181d7a9a
2 changed files with 9 additions and 27 deletions

View File

@@ -596,7 +596,8 @@ namespace Ryujinx.HLE.HOS.Services.Hid
+ Math.Abs(storage.AngularVelocity.Y)
+ Math.Abs(storage.AngularVelocity.Z);
return ((acceleration <= 1.5F) && (angularVelocity <= 1.1F));
// TODO: check against config deadzone and add sensitivity setting
return ((acceleration <= 1.0F) && (angularVelocity <= 1.0F));
}
private void UpdateDisconnectedInputSixAxis(PlayerIndex index)

View File

@@ -608,19 +608,15 @@ namespace Ryujinx.HLE.HOS.Services.Hid
int sixAxisSensorHandle = context.RequestData.ReadInt32();
// 4 byte struct w/ 4-byte alignment
// 0x0 0x4 TypeValue
// 0x0 0x1 NpadStyleIndex
// 0x1 0x1 PlayerNumber
// 0x2 0x1 DeviceIdx
// uint typeValue = (uint) sixAxisSensorHandle;
// uint npadStyleIndex = (uint) sixAxisSensorHandle & 0xff;
int playerNumber = (sixAxisSensorHandle << 8) & 0xff;
// uint deviceIdx= ((uint) sixAxisSensorHandle << 16) & 0xff;
// uint typeValue = (uint) sixAxisSensorHandle; // 0x0 0x4 TypeValue
// uint npadStyleIndex = (uint) sixAxisSensorHandle & 0xff; // 0x0 0x1 NpadStyleIndex
int playerNumber = (sixAxisSensorHandle << 8) & 0xff; // 0x1 0x1 PlayerNumber
// uint deviceIdx= ((uint) sixAxisSensorHandle << 16) & 0xff; // 0x2 0x1 DeviceIdx
// uint unknown = ((uint) sixAxisSensorHandle << 24) & 0xff;
// 32bit sign extension padding
// if = 0, + offset, else - offset
// 32bit sign extension padding -> if = 0, + offset, else - offset
// npadStyleIndex = ((npadStyleIndex & 0x8000) == 0) ? npadStyleIndex | 0xFFFF0000 : npadStyleIndex & 0xFFFF0000;
// playerNumber = ((playerNumber & 0x8000) == 0) ? playerNumber | 0xFFFF0000 : playerNumber & 0xFFFF0000;
// deviceIdx = ((deviceIdx & 0x8000) == 0) ? deviceIdx | 0xFFFF0000 : deviceIdx & 0xFFFF0000;
@@ -628,26 +624,11 @@ namespace Ryujinx.HLE.HOS.Services.Hid
context.RequestData.BaseStream.Position += 4; // Padding
long appletResourceUserId = context.RequestData.ReadInt64();
bool isAtRest;
// TODO: link to context.Device.Hid.Npads.SixAxisActive when properly implemented
// We currently do not support stopping or starting SixAxisTracking.
// It is just always tracking, the bool is unused.
// See Ryujinx.HLE.HOS.Services.Hid.NpadDevices
// common cases: if
// controller is keyboard (keyboards don't have gyroscopes, silly goose!)
// controller has no gyroscope
// SixAxisActive == false
// SixAxisTracking == false
// then isAtRest = true
// else check gyroscopic activity
// check gyroscopic activity
isAtRest = context.Device.Hid.Npads.isAtRest(playerNumber);
context.ResponseData.Write(isAtRest);
context.ResponseData.Write(context.Device.Hid.Npads.isAtRest(playerNumber));
return ResultCode.Success;
}