- Fixed DS4 Gyro timestamp field

This commit is contained in:
David Khachaturov 2020-04-24 10:13:37 +01:00
parent da9680eb9a
commit a0a0a21646
2 changed files with 4 additions and 3 deletions

View file

@ -109,6 +109,7 @@
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Numerics" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Web.Extensions" />
@ -117,7 +118,6 @@
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WindowsInput, Version=6.1.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\WindowsInput.6.1.1\lib\net461\WindowsInput.dll</HintPath>

View file

@ -1006,9 +1006,10 @@ namespace BetterJoyForCemu {
// Gyro and accel
// Timestamp is in us. DS4 is in 5.33us
ushort dt = (ushort) ((Timestamp - lag)/1000);
ds4_ts += (ushort) ((n == 0) ? 5 : 4);
ushort dt = (ushort)((Timestamp - lag) * 3 / 16);
ds4_ts += dt;
ds4.SetIMUTimestamp(ds4_ts);
Vector3 gyr = GetGyro() * 16;
ds4.SetIMUValue(DualShock4IMU.GyroX, (short) gyr.Y);
ds4.SetIMUValue(DualShock4IMU.GyroY, (short) -gyr.Z);