Skip to content

Instantly share code, notes, and snippets.

View Ryochan7's full-sized avatar

Travis Nickles Ryochan7

View GitHub Profile
@Ryochan7
Ryochan7 / ds4windows_vigem_20180322.diff
Last active March 22, 2018 23:43
ViGEm integration into DS4Windows
diff --git a/DS4Windows/DS4Control/ControlService.cs b/DS4Windows/DS4Control/ControlService.cs
index e8a164c..ae10895 100644
--- a/DS4Windows/DS4Control/ControlService.cs
+++ b/DS4Windows/DS4Control/ControlService.cs
@@ -7,6 +7,9 @@ using System.Media;
using System.Threading.Tasks;
using static DS4Windows.Global;
using System.Threading;
+using Nefarius.ViGEm.Client;
+using Nefarius.ViGEm.Client.Targets;
diff --git a/DS4Windows/DS4Control/ControlService.cs b/DS4Windows/DS4Control/ControlService.cs
index e8a164c..833a4a6 100644
--- a/DS4Windows/DS4Control/ControlService.cs
+++ b/DS4Windows/DS4Control/ControlService.cs
@@ -39,6 +39,7 @@ namespace DS4Windows
};
public bool suspending;
//SoundPlayer sp = new SoundPlayer();
+ private UdpServer _udpServer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.ComponentModel;
namespace DS4Windows
{
@Ryochan7
Ryochan7 / ds4windows_vigem_udp_test_20180323.diff
Last active March 24, 2018 01:38
Patch for DS4Windows implementing ViGEm and UDP
diff --git a/DS4Windows/DS4Control/ControlService.cs b/DS4Windows/DS4Control/ControlService.cs
index e8a164c..7ae2ade 100644
--- a/DS4Windows/DS4Control/ControlService.cs
+++ b/DS4Windows/DS4Control/ControlService.cs
@@ -7,6 +7,9 @@ using System.Media;
using System.Threading.Tasks;
using static DS4Windows.Global;
using System.Threading;
+using Nefarius.ViGEm.Client;
+using Nefarius.ViGEm.Client.Targets;
@Ryochan7
Ryochan7 / ds4windows_deltastick_20180610.diff
Created June 10, 2018 22:15
Messy experimental DS4Windows version of delta acceleration for stick mouse
diff --git a/DS4Windows/DS4Control/ControlService.cs b/DS4Windows/DS4Control/ControlService.cs
index 3c4ff38..70a81b4 100644
--- a/DS4Windows/DS4Control/ControlService.cs
+++ b/DS4Windows/DS4Control/ControlService.cs
@@ -828,7 +828,11 @@ namespace DS4Windows
if (getEnableTouchToggle(ind))
CheckForTouchToggle(ind, cState, pState);
- cState = Mapping.SetCurveAndDeadzone(ind, cState, TempState[ind]);
+ cState = Mapping.SetCurveAndDeadzone(ind, cState, pState, TempState[ind]);
@Ryochan7
Ryochan7 / testudpthread.diff
Created August 3, 2018 02:54
Current misadventures with the UDP server code
diff --git a/DS4Windows/DS4Control/ControlService.cs b/DS4Windows/DS4Control/ControlService.cs
index f2b19d5..80e7408 100644
--- a/DS4Windows/DS4Control/ControlService.cs
+++ b/DS4Windows/DS4Control/ControlService.cs
@@ -141,8 +141,43 @@ namespace DS4Windows
PreviousState[i] = new DS4State();
ExposedState[i] = new DS4StateExposed(CurrentState[i]);
}
+
+ boob = new ManualResetEvent(false);
@Ryochan7
Ryochan7 / Tester.cs
Created September 29, 2018 07:10
Small sample of DS4WindowsAPI in action
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS4ImportTest
{
class Tester
{
@Ryochan7
Ryochan7 / 360steeringchange.diff
Created February 11, 2019 17:35
Proposed changes to DS4Windows 360 steering that change performance
diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs
index 7af90bd..cd82824 100644
--- a/DS4Windows/DS4Control/Mapping.cs
+++ b/DS4Windows/DS4Control/Mapping.cs
@@ -1579,11 +1579,16 @@ namespace DS4Windows
if (macroControl[24]) MappedState.RY = 0;
}
- if (getSASteeringWheelEmulationAxis(device) != SASteeringWheelEmulationAxisType.None)
+ if (GetSASteeringWheelEmulationAxis(device)
@Ryochan7
Ryochan7 / squaresticktestds4.diff
Last active February 12, 2019 02:27
Square stick output option for DS4Windows
diff --git a/DS4Windows/DS4Control/Mapping.cs b/DS4Windows/DS4Control/Mapping.cs
index 29a0bcd..e8158b3 100644
--- a/DS4Windows/DS4Control/Mapping.cs
+++ b/DS4Windows/DS4Control/Mapping.cs
@@ -75,6 +75,74 @@ namespace DS4Windows
new Queue<ControlToXInput>(), new Queue<ControlToXInput>()
};
+ struct DS4Vector2
+ {
@Ryochan7
Ryochan7 / skipvirtualds4.diff
Created March 24, 2019 06:38
Patch for DS4Windows to skip grabbing virtual DS4 controllers. Will be needed if DS4 emulation gets integrated
diff --git a/DS4Windows/DS4Control/ScpUtil.cs b/DS4Windows/DS4Control/ScpUtil.cs
index f5ccddc..c4111ef 100644
--- a/DS4Windows/DS4Control/ScpUtil.cs
+++ b/DS4Windows/DS4Control/ScpUtil.cs
@@ -334,6 +334,34 @@ namespace DS4Windows
return result;
}
+ internal static string GetDeviceProperty(string deviceInstanceId,
+ NativeMethods.DEVPROPKEY prop)