diff options
| author | mpnico <mpnico@gmail.com> | 2021-08-05 00:39:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-05 00:39:40 +0200 |
| commit | 70f79e689bc947313aab11c41e59928ce43be517 (patch) | |
| tree | db4aecd13e2895c650a6cf2cd84966ab06b44648 /Ryujinx.HLE/HOS/Services/Hid/HidServer | |
| parent | 46ffc81d90bd3a8f2d24c2997166d22f12ecbbb6 (diff) | |
Implement vibrations (#2468)
* First working vibration implementation
* Fix Infinite Rumble in SDL2Mouse
* Stop ignoring one vibValues every 2
* Remove RumbleInfinity as suggested
* Reworked all the vibration handle / calculation
* Revert HidVibrationDevicePosition changes
* Add UI to enable and tune rumble
* Remove some stub logs
* Add PlayerIndex in rumble debug log
* Fix all requested changes
* Implements hid::GetVibrationDeviceInfo
* Better implements HidVibrationValue.Equals/GetHashCode
* Added requested changes from code review
* Last fixes from review
* Update configuration file version for rebase
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Hid/HidServer')
3 files changed, 28 insertions, 2 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Hid/HidServer/Types/Vibration/HidVibrationDeviceHandle.cs b/Ryujinx.HLE/HOS/Services/Hid/HidServer/Types/Vibration/HidVibrationDeviceHandle.cs new file mode 100644 index 00000000..4501c721 --- /dev/null +++ b/Ryujinx.HLE/HOS/Services/Hid/HidServer/Types/Vibration/HidVibrationDeviceHandle.cs @@ -0,0 +1,10 @@ +namespace Ryujinx.HLE.HOS.Services.Hid +{ + public struct HidVibrationDeviceHandle + { + public byte DeviceType; + public byte PlayerId; + public byte Position; + public byte Reserved; + } +}
\ No newline at end of file diff --git a/Ryujinx.HLE/HOS/Services/Hid/HidServer/Types/Vibration/HidVibrationDeviceType.cs b/Ryujinx.HLE/HOS/Services/Hid/HidServer/Types/Vibration/HidVibrationDeviceType.cs index cf9e6498..898384be 100644 --- a/Ryujinx.HLE/HOS/Services/Hid/HidServer/Types/Vibration/HidVibrationDeviceType.cs +++ b/Ryujinx.HLE/HOS/Services/Hid/HidServer/Types/Vibration/HidVibrationDeviceType.cs @@ -3,6 +3,7 @@ public enum HidVibrationDeviceType { None, - LinearResonantActuator + LinearResonantActuator, + GcErm } }
\ No newline at end of file diff --git a/Ryujinx.HLE/HOS/Services/Hid/HidServer/Types/Vibration/HidVibrationValue.cs b/Ryujinx.HLE/HOS/Services/Hid/HidServer/Types/Vibration/HidVibrationValue.cs index 7211396e..3f45d269 100644 --- a/Ryujinx.HLE/HOS/Services/Hid/HidServer/Types/Vibration/HidVibrationValue.cs +++ b/Ryujinx.HLE/HOS/Services/Hid/HidServer/Types/Vibration/HidVibrationValue.cs @@ -1,4 +1,7 @@ -namespace Ryujinx.HLE.HOS.Services.Hid +using Ryujinx.HLE.HOS.Tamper; +using System; + +namespace Ryujinx.HLE.HOS.Services.Hid { public struct HidVibrationValue { @@ -6,5 +9,17 @@ public float FrequencyLow; public float AmplitudeHigh; public float FrequencyHigh; + + public override bool Equals(object obj) + { + return obj is HidVibrationValue value && + AmplitudeLow == value.AmplitudeLow && + AmplitudeHigh == value.AmplitudeHigh; + } + + public override int GetHashCode() + { + return HashCode.Combine(AmplitudeLow, AmplitudeHigh); + } } }
\ No newline at end of file |
