mirror of
https://github.com/dborth/vbagx.git
synced 2025-01-14 11:39:07 +01:00
set default calibration values for controllers that return invalid data
This commit is contained in:
parent
6901e668b3
commit
aa3ca5b2aa
@ -137,6 +137,14 @@ s8 GuiTrigger::WPAD_Stick(u8 stick, int axis)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// some 3rd party controllers return invalid analog sticks calibration data
|
||||||
|
if ((min >= center) || (max <= center)) {
|
||||||
|
// force default calibration settings
|
||||||
|
min = 0;
|
||||||
|
max = stick ? 32 : 64;
|
||||||
|
center = stick ? 16 : 32;
|
||||||
|
}
|
||||||
|
|
||||||
if (pos > max) return 127;
|
if (pos > max) return 127;
|
||||||
if (pos < min) return -128;
|
if (pos < min) return -128;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user