Skip to content

Commit

Permalink
Fake DS4 FrameCounter field for Switch Pro and JoyCon devices
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryochan7 committed Aug 9, 2021
1 parent 7641d11 commit 98961f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions DS4Windows/DS4Library/InputDevices/JoyConDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,8 @@ protected unsafe void ReadInput()

utcNow = DateTime.UtcNow; // timestamp with UTC in case system time zone changes
cState.PacketCounter = pState.PacketCounter + 1;
// DS4 Frame Counter range is [0-127]
cState.FrameCounter = (byte)(cState.PacketCounter % 128);
cState.ReportTimeStamp = utcNow;

cState.elapsedTime = combLatency;
Expand Down
2 changes: 2 additions & 0 deletions DS4Windows/DS4Library/InputDevices/SwitchProDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@ protected unsafe void ReadInput()

utcNow = DateTime.UtcNow; // timestamp with UTC in case system time zone changes
cState.PacketCounter = pState.PacketCounter + 1;
// DS4 Frame Counter range is [0-127]
cState.FrameCounter = (byte)(cState.PacketCounter % 128);
cState.ReportTimeStamp = utcNow;

cState.elapsedTime = combLatency;
Expand Down

0 comments on commit 98961f8

Please sign in to comment.