Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
Version 1.7.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryochan7 committed Apr 27, 2019
1 parent fd0a310 commit 7ff7fb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DS4Windows/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.7.5")]
[assembly: AssemblyFileVersion("1.7.5")]
[assembly: AssemblyVersion("1.7.6")]
[assembly: AssemblyFileVersion("1.7.6")]
[assembly: NeutralResourcesLanguage("en")]

2 comments on commit 7ff7fb1

@mika-n
Copy link
Collaborator

@mika-n mika-n commented on 7ff7fb1 Apr 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be a bug how V1.7.6 DS4OutDevice.cs constructs dpad report value to be sent to ViGem driver. DPadUp+DPadLeft key combination doesn't work. There is an issue ticket created by Niosat about this bug.

The bug is in DS4OutDevice.cs:ConvertAndSendReport method and how it does if-then-else logic to dpad values. Now "dpad up" state is handled "too early", so dpadup+left is never reached.

Here is one way to solve the issue. x360 uses a bitmask with dpad but it seems that DS4 interface uses integer enums without clear bitmask opportunity.

            if (state.DpadUp)
            {
                if (state.DpadRight) tempDPad = DualShock4DPadValues.Northeast;
                else if (state.DpadLeft) tempDPad = DualShock4DPadValues.Northwest;
                else tempDPad = DualShock4DPadValues.North;
            }
            else if (state.DpadLeft)
            {
                if (state.DpadUp) tempDPad = DualShock4DPadValues.Northwest;
                else if (state.DpadDown) tempDPad = DualShock4DPadValues.Southwest;
                else tempDPad = DualShock4DPadValues.West;
            }
            else if (state.DpadDown)
            {
                if (state.DpadLeft) tempDPad = DualShock4DPadValues.Southwest;
                else if (state.DpadRight) tempDPad = DualShock4DPadValues.Southeast;
                else tempDPad = DualShock4DPadValues.South;
            }
            else if (state.DpadRight)
            {
                if (state.DpadUp) tempDPad = DualShock4DPadValues.Northeast;
                else if (state.DpadDown) tempDPad = DualShock4DPadValues.Southeast;
                else tempDPad = DualShock4DPadValues.East;
            }

@Ryochan7
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ViGEm represents the enum like how it is handled in the DS4 input report. DPad values are represented using a clock model with the value incrementing by one in a clockwise rotation. Centered is equal to 0.

That changed version introduced slowdown for some reason. I have made an update to the routine to handle the DPadUp+Left case earlier.

Please sign in to comment.