Merge branch 'Yuki-nyan-ryochan7' into jay

This commit is contained in:
Travis Nickles 2018-07-10 00:43:13 -05:00
commit 1f85128c22
3 changed files with 13 additions and 3 deletions

View File

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

View File

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

View File

@ -218,7 +218,7 @@ namespace DS4Windows
}
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 currentPitch = (short)((ushort)(gyro[1] << 8) | gyro[0]);
@ -227,7 +227,10 @@ namespace DS4Windows
int AccelY = (short)((ushort)(accel[3] << 8) | accel[2]);
int AccelZ = (short)((ushort)(accel[5] << 8) | accel[4]);
if (!disableCalibs)
{
applyCalibs(ref currentYaw, ref currentPitch, ref currentRoll, ref AccelX, ref AccelY, ref AccelZ);
}
SixAxisEventArgs args = null;
if (AccelX != 0 || AccelY != 0 || AccelZ != 0)