Android: Use square stick calibration

Fixes https://bugs.dolphin-emu.org/issues/11911 and makes the range of
values when using touch controls correct. Also affects the range of
values for physical controllers in a way that may or may not be
desirable, depending on the controller model. (If there are
undesirable effects, they would be that the range of inputs is too
small, especially diagonally.) Such is our messy Android input system.
Should be an improvement on the whole for physical controllers, though.
This commit is contained in:
JosJuice 2019-11-28 18:35:50 +01:00
parent 7e64bdc85f
commit d9c78d54da
4 changed files with 77 additions and 39 deletions

View File

@ -14,12 +14,14 @@ Main Stick/Up = `Axis 11`
Main Stick/Down = `Axis 12`
Main Stick/Left = `Axis 13`
Main Stick/Right = `Axis 14`
Main Stick/Radius = 100,000000
Main Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Main Stick/Center = 0,00 0,00
C-Stick/Up = `Axis 16`
C-Stick/Down = `Axis 17`
C-Stick/Left = `Axis 18`
C-Stick/Right = `Axis 19`
C-Stick/Radius = 100,000000
C-Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
C-Stick/Center = 0,00 0,00
Triggers/L = `Axis 20`
Triggers/R = `Axis 21`
Triggers/L-Analog = `Axis 20`
@ -42,12 +44,14 @@ Main Stick/Up = `Axis 11`
Main Stick/Down = `Axis 12`
Main Stick/Left = `Axis 13`
Main Stick/Right = `Axis 14`
Main Stick/Radius = 100,000000
Main Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Main Stick/Center = 0,00 0,00
C-Stick/Up = `Axis 16`
C-Stick/Down = `Axis 17`
C-Stick/Left = `Axis 18`
C-Stick/Right = `Axis 19`
C-Stick/Radius = 100,000000
C-Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
C-Stick/Center = 0,00 0,00
Triggers/L = `Axis 20`
Triggers/R = `Axis 21`
Triggers/L-Analog = `Axis 20`
@ -70,12 +74,14 @@ Main Stick/Up = `Axis 11`
Main Stick/Down = `Axis 12`
Main Stick/Left = `Axis 13`
Main Stick/Right = `Axis 14`
Main Stick/Radius = 100,000000
Main Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Main Stick/Center = 0,00 0,00
C-Stick/Up = `Axis 16`
C-Stick/Down = `Axis 17`
C-Stick/Left = `Axis 18`
C-Stick/Right = `Axis 19`
C-Stick/Radius = 100,000000
C-Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
C-Stick/Center = 0,00 0,00
Triggers/L = `Axis 20`
Triggers/R = `Axis 21`
Triggers/L-Analog = `Axis 20`
@ -98,12 +104,14 @@ Main Stick/Up = `Axis 11`
Main Stick/Down = `Axis 12`
Main Stick/Left = `Axis 13`
Main Stick/Right = `Axis 14`
Main Stick/Radius = 100,000000
Main Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Main Stick/Center = 0,00 0,00
C-Stick/Up = `Axis 16`
C-Stick/Down = `Axis 17`
C-Stick/Left = `Axis 18`
C-Stick/Right = `Axis 19`
C-Stick/Radius = 100,000000
C-Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
C-Stick/Center = 0,00 0,00
Triggers/L = `Axis 20`
Triggers/R = `Axis 21`
Triggers/L-Analog = `Axis 20`

View File

@ -43,7 +43,8 @@ Nunchuk/Stick/Up = `Axis 203`
Nunchuk/Stick/Down = `Axis 204`
Nunchuk/Stick/Left = `Axis 205`
Nunchuk/Stick/Right = `Axis 206`
Nunchuk/Stick/Radius = 100,000000
Nunchuk/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Nunchuk/Stick/Center = 0,00 0,00
Nunchuk/Swing/Up = `Axis 208`
Nunchuk/Swing/Down = `Axis 209`
Nunchuk/Swing/Left = `Axis 210`
@ -76,12 +77,14 @@ Classic/Left Stick/Up = `Axis 314`
Classic/Left Stick/Down = `Axis 315`
Classic/Left Stick/Left = `Axis 316`
Classic/Left Stick/Right = `Axis 317`
Classic/Left Stick/Radius = 100,000000
Classic/Left Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Classic/Left Stick/Center = 0,00 0,00
Classic/Right Stick/Up = `Axis 319`
Classic/Right Stick/Down = `Axis 320`
Classic/Right Stick/Left = `Axis 321`
Classic/Right Stick/Right = `Axis 322`
Classic/Right Stick/Radius = 100,000000
Classic/Right Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Classic/Right Stick/Center = 0,00 0,00
Classic/Triggers/L = `Axis 323`
Classic/Triggers/R = `Axis 324`
Classic/Triggers/Threshold = 90,000000
@ -98,7 +101,8 @@ Guitar/Stick/Up = `Axis 410`
Guitar/Stick/Down = `Axis 411`
Guitar/Stick/Left = `Axis 412`
Guitar/Stick/Right = `Axis 413`
Guitar/Stick/Radius = 100,000000
Guitar/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Guitar/Stick/Center = 0,00 0,00
Guitar/Whammy/Bar = `Axis 414`
Drums/Buttons/- = `Button 500`
Drums/Buttons/+ = `Button 501`
@ -112,7 +116,8 @@ Drums/Stick/Up = `Axis 509`
Drums/Stick/Down = `Axis 510`
Drums/Stick/Left = `Axis 511`
Drums/Stick/Right = `Axis 512`
Drums/Stick/Radius = 100,000000
Drums/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Drums/Stick/Center = 0,00 0,00
Turntable/Buttons/Green Left = `Button 600`
Turntable/Buttons/Red Left = `Button 601`
Turntable/Buttons/Blue Left = `Button 602`
@ -131,7 +136,8 @@ Turntable/Stick/Up = `Axis 617`
Turntable/Stick/Down = `Axis 618`
Turntable/Stick/Left = `Axis 619`
Turntable/Stick/Right = `Axis 620`
Turntable/Stick/Radius = 100,000000
Turntable/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Turntable/Stick/Center = 0,00 0,00
Turntable/Effect/Dial = `Axis 621`
Turntable/Crossfade/Left = `Axis 623`
Turntable/Crossfade/Right = `Axis 624`
@ -194,7 +200,8 @@ Nunchuk/Stick/Up = `Axis 203`
Nunchuk/Stick/Down = `Axis 204`
Nunchuk/Stick/Left = `Axis 205`
Nunchuk/Stick/Right = `Axis 206`
Nunchuk/Stick/Radius = 100,000000
Nunchuk/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Nunchuk/Stick/Center = 0,00 0,00
Nunchuk/Swing/Up = `Axis 208`
Nunchuk/Swing/Down = `Axis 209`
Nunchuk/Swing/Left = `Axis 210`
@ -227,12 +234,14 @@ Classic/Left Stick/Up = `Axis 314`
Classic/Left Stick/Down = `Axis 315`
Classic/Left Stick/Left = `Axis 316`
Classic/Left Stick/Right = `Axis 317`
Classic/Left Stick/Radius = 100,000000
Classic/Left Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Classic/Left Stick/Center = 0,00 0,00
Classic/Right Stick/Up = `Axis 319`
Classic/Right Stick/Down = `Axis 320`
Classic/Right Stick/Left = `Axis 321`
Classic/Right Stick/Right = `Axis 322`
Classic/Right Stick/Radius = 100,000000
Classic/Right Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Classic/Right Stick/Center = 0,00 0,00
Classic/Triggers/L = `Axis 323`
Classic/Triggers/R = `Axis 324`
Classic/Triggers/Threshold = 90,000000
@ -249,7 +258,8 @@ Guitar/Stick/Up = `Axis 410`
Guitar/Stick/Down = `Axis 411`
Guitar/Stick/Left = `Axis 412`
Guitar/Stick/Right = `Axis 413`
Guitar/Stick/Radius = 100,000000
Guitar/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Guitar/Stick/Center = 0,00 0,00
Guitar/Whammy/Bar = `Axis 414`
Drums/Buttons/- = `Button 500`
Drums/Buttons/+ = `Button 501`
@ -263,7 +273,8 @@ Drums/Stick/Up = `Axis 509`
Drums/Stick/Down = `Axis 510`
Drums/Stick/Left = `Axis 511`
Drums/Stick/Right = `Axis 512`
Drums/Stick/Radius = 100,000000
Drums/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Drums/Stick/Center = 0,00 0,00
Turntable/Buttons/Green Left = `Button 600`
Turntable/Buttons/Red Left = `Button 601`
Turntable/Buttons/Blue Left = `Button 602`
@ -282,7 +293,8 @@ Turntable/Stick/Up = `Axis 617`
Turntable/Stick/Down = `Axis 618`
Turntable/Stick/Left = `Axis 619`
Turntable/Stick/Right = `Axis 620`
Turntable/Stick/Radius = 100,000000
Turntable/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Turntable/Stick/Center = 0,00 0,00
Turntable/Effect/Dial = `Axis 621`
Turntable/Crossfade/Left = `Axis 623`
Turntable/Crossfade/Right = `Axis 624`
@ -345,7 +357,8 @@ Nunchuk/Stick/Up = `Axis 203`
Nunchuk/Stick/Down = `Axis 204`
Nunchuk/Stick/Left = `Axis 205`
Nunchuk/Stick/Right = `Axis 206`
Nunchuk/Stick/Radius = 100,000000
Nunchuk/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Nunchuk/Stick/Center = 0,00 0,00
Nunchuk/Swing/Up = `Axis 208`
Nunchuk/Swing/Down = `Axis 209`
Nunchuk/Swing/Left = `Axis 210`
@ -378,12 +391,14 @@ Classic/Left Stick/Up = `Axis 314`
Classic/Left Stick/Down = `Axis 315`
Classic/Left Stick/Left = `Axis 316`
Classic/Left Stick/Right = `Axis 317`
Classic/Left Stick/Radius = 100,000000
Classic/Left Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Classic/Left Stick/Center = 0,00 0,00
Classic/Right Stick/Up = `Axis 319`
Classic/Right Stick/Down = `Axis 320`
Classic/Right Stick/Left = `Axis 321`
Classic/Right Stick/Right = `Axis 322`
Classic/Right Stick/Radius = 100,000000
Classic/Right Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Classic/Right Stick/Center = 0,00 0,00
Classic/Triggers/L = `Axis 323`
Classic/Triggers/R = `Axis 324`
Classic/Triggers/Threshold = 90,000000
@ -400,7 +415,8 @@ Guitar/Stick/Up = `Axis 410`
Guitar/Stick/Down = `Axis 411`
Guitar/Stick/Left = `Axis 412`
Guitar/Stick/Right = `Axis 413`
Guitar/Stick/Radius = 100,000000
Guitar/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Guitar/Stick/Center = 0,00 0,00
Guitar/Whammy/Bar = `Axis 414`
Drums/Buttons/- = `Button 500`
Drums/Buttons/+ = `Button 501`
@ -414,7 +430,8 @@ Drums/Stick/Up = `Axis 509`
Drums/Stick/Down = `Axis 510`
Drums/Stick/Left = `Axis 511`
Drums/Stick/Right = `Axis 512`
Drums/Stick/Radius = 100,000000
Drums/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Drums/Stick/Center = 0,00 0,00
Turntable/Buttons/Green Left = `Button 600`
Turntable/Buttons/Red Left = `Button 601`
Turntable/Buttons/Blue Left = `Button 602`
@ -433,7 +450,8 @@ Turntable/Stick/Up = `Axis 617`
Turntable/Stick/Down = `Axis 618`
Turntable/Stick/Left = `Axis 619`
Turntable/Stick/Right = `Axis 620`
Turntable/Stick/Radius = 100,000000
Turntable/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Turntable/Stick/Center = 0,00 0,00
Turntable/Effect/Dial = `Axis 621`
Turntable/Crossfade/Left = `Axis 623`
Turntable/Crossfade/Right = `Axis 624`
@ -496,7 +514,8 @@ Nunchuk/Stick/Up = `Axis 203`
Nunchuk/Stick/Down = `Axis 204`
Nunchuk/Stick/Left = `Axis 205`
Nunchuk/Stick/Right = `Axis 206`
Nunchuk/Stick/Radius = 100,000000
Nunchuk/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Nunchuk/Stick/Center = 0,00 0,00
Nunchuk/Swing/Up = `Axis 208`
Nunchuk/Swing/Down = `Axis 209`
Nunchuk/Swing/Left = `Axis 210`
@ -529,12 +548,14 @@ Classic/Left Stick/Up = `Axis 314`
Classic/Left Stick/Down = `Axis 315`
Classic/Left Stick/Left = `Axis 316`
Classic/Left Stick/Right = `Axis 317`
Classic/Left Stick/Radius = 100,000000
Classic/Left Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Classic/Left Stick/Center = 0,00 0,00
Classic/Right Stick/Up = `Axis 319`
Classic/Right Stick/Down = `Axis 320`
Classic/Right Stick/Left = `Axis 321`
Classic/Right Stick/Right = `Axis 322`
Classic/Right Stick/Radius = 100,000000
Classic/Right Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Classic/Right Stick/Center = 0,00 0,00
Classic/Triggers/L = `Axis 323`
Classic/Triggers/R = `Axis 324`
Classic/Triggers/Threshold = 90,000000
@ -551,7 +572,8 @@ Guitar/Stick/Up = `Axis 410`
Guitar/Stick/Down = `Axis 411`
Guitar/Stick/Left = `Axis 412`
Guitar/Stick/Right = `Axis 413`
Guitar/Stick/Radius = 100,000000
Guitar/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Guitar/Stick/Center = 0,00 0,00
Guitar/Whammy/Bar = `Axis 414`
Drums/Buttons/- = `Button 500`
Drums/Buttons/+ = `Button 501`
@ -565,7 +587,8 @@ Drums/Stick/Up = `Axis 509`
Drums/Stick/Down = `Axis 510`
Drums/Stick/Left = `Axis 511`
Drums/Stick/Right = `Axis 512`
Drums/Stick/Radius = 100,000000
Drums/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Drums/Stick/Center = 0,00 0,00
Turntable/Buttons/Green Left = `Button 600`
Turntable/Buttons/Red Left = `Button 601`
Turntable/Buttons/Blue Left = `Button 602`
@ -584,7 +607,8 @@ Turntable/Stick/Up = `Axis 617`
Turntable/Stick/Down = `Axis 618`
Turntable/Stick/Left = `Axis 619`
Turntable/Stick/Right = `Axis 620`
Turntable/Stick/Radius = 100,000000
Turntable/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Turntable/Stick/Center = 0,00 0,00
Turntable/Effect/Dial = `Axis 621`
Turntable/Crossfade/Left = `Axis 623`
Turntable/Crossfade/Right = `Axis 624`

View File

@ -43,7 +43,8 @@ Nunchuk/Stick/Up = `Axis 203`
Nunchuk/Stick/Down = `Axis 204`
Nunchuk/Stick/Left = `Axis 205`
Nunchuk/Stick/Right = `Axis 206`
Nunchuk/Stick/Radius = 100,000000
Nunchuk/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Nunchuk/Stick/Center = 0,00 0,00
Nunchuk/Swing/Up = `Axis 208`
Nunchuk/Swing/Down = `Axis 209`
Nunchuk/Swing/Left = `Axis 210`
@ -76,12 +77,14 @@ Classic/Left Stick/Up = `Axis 314`
Classic/Left Stick/Down = `Axis 315`
Classic/Left Stick/Left = `Axis 316`
Classic/Left Stick/Right = `Axis 317`
Classic/Left Stick/Radius = 100,000000
Classic/Left Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Classic/Left Stick/Center = 0,00 0,00
Classic/Right Stick/Up = `Axis 319`
Classic/Right Stick/Down = `Axis 320`
Classic/Right Stick/Left = `Axis 321`
Classic/Right Stick/Right = `Axis 322`
Classic/Right Stick/Radius = 100,000000
Classic/Right Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Classic/Right Stick/Center = 0,00 0,00
Classic/Triggers/L = `Axis 323`
Classic/Triggers/R = `Axis 324`
Classic/Triggers/Threshold = 90,000000
@ -98,7 +101,8 @@ Guitar/Stick/Up = `Axis 410`
Guitar/Stick/Down = `Axis 411`
Guitar/Stick/Left = `Axis 412`
Guitar/Stick/Right = `Axis 413`
Guitar/Stick/Radius = 100,000000
Guitar/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Guitar/Stick/Center = 0,00 0,00
Guitar/Whammy/Bar = `Axis 414`
Drums/Buttons/- = `Button 500`
Drums/Buttons/+ = `Button 501`
@ -112,7 +116,8 @@ Drums/Stick/Up = `Axis 509`
Drums/Stick/Down = `Axis 510`
Drums/Stick/Left = `Axis 511`
Drums/Stick/Right = `Axis 512`
Drums/Stick/Radius = 100,000000
Drums/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Drums/Stick/Center = 0,00 0,00
Turntable/Buttons/Green Left = `Button 600`
Turntable/Buttons/Red Left = `Button 601`
Turntable/Buttons/Blue Left = `Button 602`
@ -131,7 +136,8 @@ Turntable/Stick/Up = `Axis 617`
Turntable/Stick/Down = `Axis 618`
Turntable/Stick/Left = `Axis 619`
Turntable/Stick/Right = `Axis 620`
Turntable/Stick/Radius = 100,000000
Turntable/Stick/Calibration = 100,00 141,42 100,00 141,42 100,00 141,42 100,00 141,42
Turntable/Stick/Center = 0,00 0,00
Turntable/Effect/Dial = `Axis 621`
Turntable/Crossfade/Left = `Axis 623`
Turntable/Crossfade/Right = `Axis 624`

View File

@ -35,7 +35,7 @@ public final class DirectoryInitialization
"org.dolphinemu.dolphinemu.DIRECTORY_INITIALIZATION";
public static final String EXTRA_STATE = "directoryState";
private static final int WiimoteNewVersion = 3; // Last changed in PR 8439
private static final int WiimoteNewVersion = 4; // Last changed in PR 8503
private static volatile DirectoryInitializationState directoryState = null;
private static String userPath;
private static String internalPath;