Merge pull request #8503 from JosJuice/android-stick-calibration

Android: Use square stick calibration
This commit is contained in:
Léo Lam 2020-03-15 23:42:05 +01:00 committed by GitHub
commit f81c0658c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 88 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

@ -1,5 +1,6 @@
package org.dolphinemu.dolphinemu.activities;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
@ -237,6 +238,14 @@ public final class EmulationActivity extends AppCompatActivity
activity.startActivity(launcher);
}
public static void clearWiimoteNewIniLinkedPreferences(Context context)
{
SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(context).edit();
editor.remove("wiiController");
editor.remove("motionControlsEnabled");
editor.apply();
}
@Override
protected void onCreate(Bundle savedInstanceState)
{

View File

@ -15,6 +15,7 @@ import android.preference.PreferenceManager;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import org.dolphinemu.dolphinemu.NativeLibrary;
import org.dolphinemu.dolphinemu.activities.EmulationActivity;
import java.io.File;
import java.io.FileInputStream;
@ -34,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;
@ -152,6 +153,7 @@ public final class DirectoryInitialization
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
if (prefs.getInt("WiimoteNewVersion", 0) != WiimoteNewVersion)
{
EmulationActivity.clearWiimoteNewIniLinkedPreferences(context);
copyAsset("WiimoteNew.ini", new File(configDirectory, "WiimoteNew.ini"), true, context);
SharedPreferences.Editor sPrefsEditor = prefs.edit();
sPrefsEditor.putInt("WiimoteNewVersion", WiimoteNewVersion);