From 1da641aee464cbb38ad3cb0c05d2c61c4c998c39 Mon Sep 17 00:00:00 2001 From: Lawstorant Date: Fri, 12 Jul 2024 15:46:42 +0200 Subject: [PATCH] Explain WHEEL_DIRECTION_FIX value --- hid-pidff.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hid-pidff.c b/hid-pidff.c index 0954721..5174036 100644 --- a/hid-pidff.c +++ b/hid-pidff.c @@ -25,6 +25,14 @@ #define PID_EFFECTS_MAX 64 +/* + * This is 16384 or 90 degrees in polar coordinates (up) + * Racing games exclusively use polar coordinates but sometimes + * SDL/Proton mess with this value as they try to do + * some conversions to fix FFB for flight sticks + */ +#define PIDFF_FIXED_DIRECTION 0x4000 + /* Report usage table used to put reports into an array */ #define PID_SET_EFFECT 0 @@ -343,7 +351,7 @@ static void pidff_set_effect_report(struct pidff_device *pidff, unsigned short direction = effect->direction; if (pidff->quirks & PIDFF_QUIRK_FIX_WHEEL_DIRECTION) - direction = 0x4000; + direction = PIDFF_FIXED_DIRECTION; pidff->set_effect[PID_EFFECT_BLOCK_INDEX].value[0] = pidff->block_load[PID_EFFECT_BLOCK_INDEX].value[0];