Add support for the Nacon Revolution Pro Controller 2 & disable SixAxis calibrations for Nacon controllers as a preliminary fix for broken support.

This commit is contained in:
Yuki-nyan 2018-06-23 22:04:29 +01:00
parent cf5ea7a5f9
commit 3ae386cb7c
3 changed files with 13 additions and 3 deletions

View File

@ -150,6 +150,7 @@ namespace DS4Windows
public DateTime lastActive = DateTime.UtcNow; public DateTime lastActive = DateTime.UtcNow;
public DateTime firstActive = DateTime.UtcNow; public DateTime firstActive = DateTime.UtcNow;
private bool charging; private bool charging;
private bool isNacon = false;
private bool outputRumble = false; private bool outputRumble = false;
private int warnInterval = WARN_INTERVAL_USB; private int warnInterval = WARN_INTERVAL_USB;
public int getWarnInterval() public int getWarnInterval()
@ -428,6 +429,11 @@ namespace DS4Windows
micAudio = new DS4Audio(DS4Library.CoreAudio.DataFlow.Capture); micAudio = new DS4Audio(DS4Library.CoreAudio.DataFlow.Capture);
} }
else if (tempAttr.VendorId == 0x146B)
{
isNacon = true;
}
synced = true; synced = true;
} }
else else
@ -971,7 +977,7 @@ namespace DS4Windows
pbAccel[i-6] = pbInput[i]; pbAccel[i-6] = pbInput[i];
} }
} }
sixAxis.handleSixaxis(gyro, accel, cState, elapsedDeltaTime); sixAxis.handleSixaxis(gyro, accel, cState, elapsedDeltaTime, isNacon);
/* Debug output of incoming HID data: /* Debug output of incoming HID data:
if (cState.L2 == 0xff && cState.R2 == 0xff) if (cState.L2 == 0xff && cState.R2 == 0xff)

View File

@ -40,6 +40,7 @@ namespace DS4Windows
new VidPidInfo(SONY_VID, 0x09CC), new VidPidInfo(SONY_VID, 0x09CC),
new VidPidInfo(RAZER_VID, 0x1000), new VidPidInfo(RAZER_VID, 0x1000),
new VidPidInfo(NACON_VID, 0x0D01), new VidPidInfo(NACON_VID, 0x0D01),
new VidPidInfo(NACON_VID, 0x0D02),
new VidPidInfo(HORI_VID, 0x00EE), // Hori PS4 Mini Wired Gamepad new VidPidInfo(HORI_VID, 0x00EE), // Hori PS4 Mini Wired Gamepad
new VidPidInfo(0x7545, 0x0104) new VidPidInfo(0x7545, 0x0104)
}; };

View File

@ -218,7 +218,7 @@ namespace DS4Windows
} }
public void handleSixaxis(byte[] gyro, byte[] accel, DS4State state, public void handleSixaxis(byte[] gyro, byte[] accel, DS4State state,
double elapsedDelta) double elapsedDelta, bool disableCalibs)
{ {
int currentYaw = (short)((ushort)(gyro[3] << 8) | gyro[2]); int currentYaw = (short)((ushort)(gyro[3] << 8) | gyro[2]);
int currentPitch = (short)((ushort)(gyro[1] << 8) | gyro[0]); int currentPitch = (short)((ushort)(gyro[1] << 8) | gyro[0]);
@ -227,7 +227,10 @@ namespace DS4Windows
int AccelY = (short)((ushort)(accel[3] << 8) | accel[2]); int AccelY = (short)((ushort)(accel[3] << 8) | accel[2]);
int AccelZ = (short)((ushort)(accel[5] << 8) | accel[4]); int AccelZ = (short)((ushort)(accel[5] << 8) | accel[4]);
if (!disableCalibs)
{
applyCalibs(ref currentYaw, ref currentPitch, ref currentRoll, ref AccelX, ref AccelY, ref AccelZ); applyCalibs(ref currentYaw, ref currentPitch, ref currentRoll, ref AccelX, ref AccelY, ref AccelZ);
}
SixAxisEventArgs args = null; SixAxisEventArgs args = null;
if (AccelX != 0 || AccelY != 0 || AccelZ != 0) if (AccelX != 0 || AccelY != 0 || AccelZ != 0)