mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-26 11:04:21 +01:00
Use unsafe memory pointers for copying imu data
This commit is contained in:
parent
60847ee54e
commit
37bb576aa6
@ -958,8 +958,20 @@ namespace DS4Windows
|
|||||||
catch { currerror = "Index out of bounds: touchpad"; }
|
catch { currerror = "Index out of bounds: touchpad"; }
|
||||||
|
|
||||||
// Store Gyro and Accel values
|
// Store Gyro and Accel values
|
||||||
Array.Copy(inputReport, 13, gyro, 0, 6);
|
//Array.Copy(inputReport, 13, gyro, 0, 6);
|
||||||
Array.Copy(inputReport, 19, accel, 0, 6);
|
//Array.Copy(inputReport, 19, accel, 0, 6);
|
||||||
|
fixed (byte* pbInput = inputReport, pbGyro = gyro, pbAccel = accel)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 6; i++)
|
||||||
|
{
|
||||||
|
pbGyro[i] = pbInput[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 6; i < 12; i++)
|
||||||
|
{
|
||||||
|
pbAccel[i] = pbInput[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
sixAxis.handleSixaxis(gyro, accel, cState, elapsedDeltaTime);
|
sixAxis.handleSixaxis(gyro, accel, cState, elapsedDeltaTime);
|
||||||
|
|
||||||
/* Debug output of incoming HID data:
|
/* Debug output of incoming HID data:
|
||||||
|
Loading…
Reference in New Issue
Block a user