Skip to content

Commit

Permalink
- Changed things back to non-DS4 gyro times
Browse files Browse the repository at this point in the history
  • Loading branch information
Davidobot committed May 6, 2020
1 parent 7d75f39 commit 38609c0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 21 deletions.
4 changes: 2 additions & 2 deletions BetterJoyForCemu/BetterJoy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@
<Reference Include="JetBrains.Annotations, Version=2020.1.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
<HintPath>..\packages\JetBrains.Annotations.2020.1.0\lib\net20\JetBrains.Annotations.dll</HintPath>
</Reference>
<Reference Include="Nefarius.ViGEm.Client, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Nefarius.ViGEm.Client.1.0.0\lib\net452\Nefarius.ViGEm.Client.dll</HintPath>
<Reference Include="Nefarius.ViGEm.Client, Version=1.16.150.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Nefarius.ViGEm.Client.1.16.150\lib\net452\Nefarius.ViGEm.Client.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
Expand Down
17 changes: 0 additions & 17 deletions BetterJoyForCemu/Joycon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1003,23 +1003,6 @@ private void SetDS4ReportState(int n) {
ds4.SetSliderValue(DualShock4Slider.LeftTrigger, (byte)(buttons[(int)(isLeft ? Button.SHOULDER_2 : Button.SHOULDER_1)] ? Byte.MaxValue : 0));
ds4.SetSliderValue(DualShock4Slider.RightTrigger, (byte)(buttons[(int)(isLeft ? Button.SHOULDER_1 : Button.SHOULDER_2)] ? Byte.MaxValue : 0));
}

// Gyro and accel
// Timestamp is in us. DS4 is in 5.33us
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);
ds4.SetIMUValue(DualShock4IMU.GyroZ, (short) -gyr.X);
Vector3 acc = GetAccel() * 8192f;
ds4.SetIMUValue(DualShock4IMU.AccelX, (short) -acc.Y);
ds4.SetIMUValue(DualShock4IMU.AccelY, (short) acc.Z);
ds4.SetIMUValue(DualShock4IMU.AccelZ, (short) -acc.X);

lag = Timestamp;
}

// Get Gyro/Accel data
Expand Down
2 changes: 1 addition & 1 deletion BetterJoyForCemu/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion BetterJoyForCemu/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<packages>
<package id="Crc32.NET" version="1.2.0" targetFramework="net461" />
<package id="JetBrains.Annotations" version="2020.1.0" targetFramework="net461" />
<package id="Nefarius.ViGEm.Client" version="1.0.0" targetFramework="net461" />
<package id="Nefarius.ViGEm.Client" version="1.16.150" targetFramework="net461" />
<package id="WindowsInput" version="6.1.1" targetFramework="net461" />
</packages>

0 comments on commit 38609c0

Please sign in to comment.