Skip to content

Commit

Permalink
Merge pull request dolphin-emu#8439 from JosJuice/android-native-moti…
Browse files Browse the repository at this point in the history
…on-controls

Android: Native motion controls
  • Loading branch information
Helios747 authored Nov 27, 2019
2 parents 34a1df1 + 2d4a3f4 commit 1550165
Show file tree
Hide file tree
Showing 19 changed files with 468 additions and 48 deletions.
6 changes: 6 additions & 0 deletions Source/Android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false"/>
<uses-feature
android:name="android.hardware.sensor.accelerometer"
android:required="false"/>
<uses-feature
android:name="android.hardware.sensor.gyroscope"
android:required="false"/>
<uses-feature
android:name="android.hardware.gamepad"
android:required="false"/>
Expand Down
56 changes: 52 additions & 4 deletions Source/Android/app/src/main/assets/WiimoteNew.ini
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Guitar/Stick/Down = `Axis 411`
Guitar/Stick/Left = `Axis 412`
Guitar/Stick/Right = `Axis 413`
Guitar/Stick/Radius = 100,000000
Guitar/Whammy/Bar = `Axis = 414`
Guitar/Whammy/Bar = `Axis 414`
Drums/Buttons/- = `Button 500`
Drums/Buttons/+ = `Button 501`
Drums/Pads/Red = `Button 502`
Expand Down Expand Up @@ -135,6 +135,18 @@ Turntable/Stick/Radius = 100,000000
Turntable/Effect/Dial = `Axis 621`
Turntable/Crossfade/Left = `Axis 623`
Turntable/Crossfade/Right = `Axis 624`
IMUAccelerometer/Left = `Axis 625`
IMUAccelerometer/Right = `Axis 626`
IMUAccelerometer/Forward = `Axis 627`
IMUAccelerometer/Backward = `Axis 628`
IMUAccelerometer/Up = `Axis 629`
IMUAccelerometer/Down = `Axis 630`
IMUGyroscope/Pitch Up = `Axis 631`
IMUGyroscope/Pitch Down = `Axis 632`
IMUGyroscope/Roll Left = `Axis 633`
IMUGyroscope/Roll Right = `Axis 634`
IMUGyroscope/Yaw Left = `Axis 635`
IMUGyroscope/Yaw Right = `Axis 636`
Source = 1
Rumble/Motor = `Rumble 700`
[Wiimote2]
Expand Down Expand Up @@ -238,7 +250,7 @@ Guitar/Stick/Down = `Axis 411`
Guitar/Stick/Left = `Axis 412`
Guitar/Stick/Right = `Axis 413`
Guitar/Stick/Radius = 100,000000
Guitar/Whammy/Bar = `Axis = 414`
Guitar/Whammy/Bar = `Axis 414`
Drums/Buttons/- = `Button 500`
Drums/Buttons/+ = `Button 501`
Drums/Pads/Red = `Button 502`
Expand Down Expand Up @@ -274,6 +286,18 @@ Turntable/Stick/Radius = 100,000000
Turntable/Effect/Dial = `Axis 621`
Turntable/Crossfade/Left = `Axis 623`
Turntable/Crossfade/Right = `Axis 624`
IMUAccelerometer/Left = `Axis 625`
IMUAccelerometer/Right = `Axis 626`
IMUAccelerometer/Forward = `Axis 627`
IMUAccelerometer/Backward = `Axis 628`
IMUAccelerometer/Up = `Axis 629`
IMUAccelerometer/Down = `Axis 630`
IMUGyroscope/Pitch Up = `Axis 631`
IMUGyroscope/Pitch Down = `Axis 632`
IMUGyroscope/Roll Left = `Axis 633`
IMUGyroscope/Roll Right = `Axis 634`
IMUGyroscope/Yaw Left = `Axis 635`
IMUGyroscope/Yaw Right = `Axis 636`
Source = 0
Rumble/Motor = `Rumble 700`
[Wiimote3]
Expand Down Expand Up @@ -377,7 +401,7 @@ Guitar/Stick/Down = `Axis 411`
Guitar/Stick/Left = `Axis 412`
Guitar/Stick/Right = `Axis 413`
Guitar/Stick/Radius = 100,000000
Guitar/Whammy/Bar = `Axis = 414`
Guitar/Whammy/Bar = `Axis 414`
Drums/Buttons/- = `Button 500`
Drums/Buttons/+ = `Button 501`
Drums/Pads/Red = `Button 502`
Expand Down Expand Up @@ -413,6 +437,18 @@ Turntable/Stick/Radius = 100,000000
Turntable/Effect/Dial = `Axis 621`
Turntable/Crossfade/Left = `Axis 623`
Turntable/Crossfade/Right = `Axis 624`
IMUAccelerometer/Left = `Axis 625`
IMUAccelerometer/Right = `Axis 626`
IMUAccelerometer/Forward = `Axis 627`
IMUAccelerometer/Backward = `Axis 628`
IMUAccelerometer/Up = `Axis 629`
IMUAccelerometer/Down = `Axis 630`
IMUGyroscope/Pitch Up = `Axis 631`
IMUGyroscope/Pitch Down = `Axis 632`
IMUGyroscope/Roll Left = `Axis 633`
IMUGyroscope/Roll Right = `Axis 634`
IMUGyroscope/Yaw Left = `Axis 635`
IMUGyroscope/Yaw Right = `Axis 636`
Source = 0
Rumble/Motor = `Rumble 700`
[Wiimote4]
Expand Down Expand Up @@ -516,7 +552,7 @@ Guitar/Stick/Down = `Axis 411`
Guitar/Stick/Left = `Axis 412`
Guitar/Stick/Right = `Axis 413`
Guitar/Stick/Radius = 100,000000
Guitar/Whammy/Bar = `Axis = 414`
Guitar/Whammy/Bar = `Axis 414`
Drums/Buttons/- = `Button 500`
Drums/Buttons/+ = `Button 501`
Drums/Pads/Red = `Button 502`
Expand Down Expand Up @@ -552,5 +588,17 @@ Turntable/Stick/Radius = 100,000000
Turntable/Effect/Dial = `Axis 621`
Turntable/Crossfade/Left = `Axis 623`
Turntable/Crossfade/Right = `Axis 624`
IMUAccelerometer/Left = `Axis 625`
IMUAccelerometer/Right = `Axis 626`
IMUAccelerometer/Forward = `Axis 627`
IMUAccelerometer/Backward = `Axis 628`
IMUAccelerometer/Up = `Axis 629`
IMUAccelerometer/Down = `Axis 630`
IMUGyroscope/Pitch Up = `Axis 631`
IMUGyroscope/Pitch Down = `Axis 632`
IMUGyroscope/Roll Left = `Axis 633`
IMUGyroscope/Roll Right = `Axis 634`
IMUGyroscope/Yaw Left = `Axis 635`
IMUGyroscope/Yaw Right = `Axis 636`
Source = 0
Rumble/Motor = `Rumble 700`
14 changes: 13 additions & 1 deletion Source/Android/app/src/main/assets/WiimoteProfile.ini
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Guitar/Stick/Down = `Axis 411`
Guitar/Stick/Left = `Axis 412`
Guitar/Stick/Right = `Axis 413`
Guitar/Stick/Radius = 100,000000
Guitar/Whammy/Bar = `Axis = 414`
Guitar/Whammy/Bar = `Axis 414`
Drums/Buttons/- = `Button 500`
Drums/Buttons/+ = `Button 501`
Drums/Pads/Red = `Button 502`
Expand Down Expand Up @@ -135,4 +135,16 @@ Turntable/Stick/Radius = 100,000000
Turntable/Effect/Dial = `Axis 621`
Turntable/Crossfade/Left = `Axis 623`
Turntable/Crossfade/Right = `Axis 624`
IMUAccelerometer/Left = `Axis 625`
IMUAccelerometer/Right = `Axis 626`
IMUAccelerometer/Forward = `Axis 627`
IMUAccelerometer/Backward = `Axis 628`
IMUAccelerometer/Up = `Axis 629`
IMUAccelerometer/Down = `Axis 630`
IMUGyroscope/Pitch Up = `Axis 631`
IMUGyroscope/Pitch Down = `Axis 632`
IMUGyroscope/Roll Left = `Axis 633`
IMUGyroscope/Roll Right = `Axis 634`
IMUGyroscope/Yaw Left = `Axis 635`
IMUGyroscope/Yaw Right = `Axis 636`
Rumble/Motor = `Rumble 700`
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,18 @@ public static final class ButtonType
public static final int TURNTABLE_CROSSFADE = 622;
public static final int TURNTABLE_CROSSFADE_LEFT = 623;
public static final int TURNTABLE_CROSSFADE_RIGHT = 624;
public static final int WIIMOTE_ACCEL_LEFT = 625;
public static final int WIIMOTE_ACCEL_RIGHT = 626;
public static final int WIIMOTE_ACCEL_FORWARD = 627;
public static final int WIIMOTE_ACCEL_BACKWARD = 628;
public static final int WIIMOTE_ACCEL_UP = 629;
public static final int WIIMOTE_ACCEL_DOWN = 630;
public static final int WIIMOTE_GYRO_PITCH_UP = 631;
public static final int WIIMOTE_GYRO_PITCH_DOWN = 632;
public static final int WIIMOTE_GYRO_ROLL_LEFT = 633;
public static final int WIIMOTE_GYRO_ROLL_RIGHT = 634;
public static final int WIIMOTE_GYRO_YAW_LEFT = 635;
public static final int WIIMOTE_GYRO_YAW_RIGHT = 636;
}

/**
Expand Down Expand Up @@ -254,6 +266,9 @@ public static void rumble(int padID, double state)
Rumble.checkRumble(padID, state);
}

public static native void SetMotionSensorsEnabled(boolean accelerometerEnabled,
boolean gyroscopeEnabled);

public static native void NewGameIniFile();

public static native void LoadGameIniFile(String gameId);
Expand Down
Loading

0 comments on commit 1550165

Please sign in to comment.