mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-03-24 22:15:04 +00:00
The latest Armor-X Pro firmware update fixes the sign on the Z axis of the sensors
(cherry picked from commit 558bbbb07ae0afa0108c1560915351cfa13442b7)
This commit is contained in:
parent
7914234b26
commit
cb0cf14155
|
@ -603,40 +603,19 @@ static void HIDAPI_DriverPS4_LoadCalibrationData(SDL_HIDAPI_Device *device)
|
||||||
if (i < 3) {
|
if (i < 3) {
|
||||||
scale *= ((double)ctx->gyro_numerator / ctx->gyro_denominator) * M_PI / 180.0;
|
scale *= ((double)ctx->gyro_numerator / ctx->gyro_denominator) * M_PI / 180.0;
|
||||||
|
|
||||||
if (device->vendor_id == USB_VENDOR_SONY &&
|
if (device->vendor_id == USB_VENDOR_SONY &&
|
||||||
device->product_id == USB_PRODUCT_SONY_DS4_STRIKEPAD) {
|
device->product_id == USB_PRODUCT_SONY_DS4_STRIKEPAD) {
|
||||||
/* The Armor-X Pro seems to only deliver half the rotation it should,
|
/* The Armor-X Pro seems to only deliver half the rotation it should */
|
||||||
* and in the opposite direction on the Z axis */
|
scale *= 2.0;
|
||||||
switch (i) {
|
}
|
||||||
case 0:
|
|
||||||
case 1:
|
|
||||||
scale *= 2.0;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
scale *= -2.0;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
scale *= ((double)ctx->accel_numerator / ctx->accel_denominator) * SDL_STANDARD_GRAVITY;
|
scale *= ((double)ctx->accel_numerator / ctx->accel_denominator) * SDL_STANDARD_GRAVITY;
|
||||||
|
|
||||||
if (device->vendor_id == USB_VENDOR_SONY &&
|
if (device->vendor_id == USB_VENDOR_SONY &&
|
||||||
device->product_id == USB_PRODUCT_SONY_DS4_STRIKEPAD) {
|
device->product_id == USB_PRODUCT_SONY_DS4_STRIKEPAD) {
|
||||||
/* The Armor-X Pro seems to only deliver half the acceleration it should,
|
/* The Armor-X Pro seems to only deliver half the acceleration it should,
|
||||||
* and in the opposite direction on the X and Y axes */
|
* and in the opposite direction on all axes */
|
||||||
switch (i) {
|
scale *= -2.0;
|
||||||
case 3:
|
|
||||||
case 4:
|
|
||||||
scale *= -2.0;
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
scale *= 2.0;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ctx->calibration[i].scale = (float)scale;
|
ctx->calibration[i].scale = (float)scale;
|
||||||
|
|
Loading…
Reference in a new issue