From dc51b95313d0903bc82d941d66450a95c2b0f85e Mon Sep 17 00:00:00 2001 From: zackhow Date: Sat, 23 Mar 2019 08:07:56 -0400 Subject: [PATCH 1/3] Android: fix touch ir from pr7829 changes --- .../dolphinemu/dolphinemu/overlay/InputOverlay.java | 12 +++++++----- .../dolphinemu/overlay/InputOverlayPointer.java | 10 ++++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.java index c2f0ca473e..40e4a3d6ed 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlay.java @@ -298,12 +298,14 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener if (!pressed && overlayPointer != null) { overlayPointer.onTouch(event); - float[] axises = overlayPointer.getAxisValues(); + float[] axes = overlayPointer.getAxisValues(); - NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice, ButtonType.WIIMOTE_IR + 2, - axises[0]); - NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice, ButtonType.WIIMOTE_IR + 4, - axises[1]); + for (int i = 0; i < 4; i++) + { + NativeLibrary + .onGamePadMoveEvent(NativeLibrary.TouchScreenDevice, ButtonType.WIIMOTE_IR_UP + i, + axes[i]); + } } invalidate(); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlayPointer.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlayPointer.java index 8280e73913..18ce190f15 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlayPointer.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/overlay/InputOverlayPointer.java @@ -127,9 +127,11 @@ public class InputOverlayPointer public float[] getAxisValues() { - float[] ir = {0f, 0f}; - ir[0] = axes[0]; - ir[1] = axes[1]; - return axes; + float[] iraxes = {0f, 0f, 0f, 0f}; + iraxes[1] = axes[0]; + iraxes[0] = axes[0]; + iraxes[3] = axes[1]; + iraxes[2] = axes[1]; + return iraxes; } } From f6225e96940185bea50483f39239d7f4afb6c0ce Mon Sep 17 00:00:00 2001 From: zackhow Date: Sat, 23 Mar 2019 08:10:13 -0400 Subject: [PATCH 2/3] Android: update IR defaults --- .../Android/app/src/main/assets/WiimoteNew.ini | 8 ++++---- .../app/src/main/assets/WiimoteProfile.ini | 2 +- .../utils/DirectoryInitialization.java | 16 +++++++++++++++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Source/Android/app/src/main/assets/WiimoteNew.ini b/Source/Android/app/src/main/assets/WiimoteNew.ini index caa82c3268..e1a3804587 100644 --- a/Source/Android/app/src/main/assets/WiimoteNew.ini +++ b/Source/Android/app/src/main/assets/WiimoteNew.ini @@ -19,7 +19,7 @@ IR/Forward = `Axis 116` IR/Backward = `Axis 117` IR/Hide = `Button 118` IR/Height = 50 -IR/Width = 30 +IR/Width = 50 IR/Center = 50 Swing/Up = `Axis 120` Swing/Down = `Axis 121` @@ -158,7 +158,7 @@ IR/Forward = `Axis 116` IR/Backward = `Axis 117` IR/Hide = `Button 118` IR/Height = 50 -IR/Width = 30 +IR/Width = 50 IR/Center = 50 Swing/Up = `Axis 120` Swing/Down = `Axis 121` @@ -297,7 +297,7 @@ IR/Forward = `Axis 116` IR/Backward = `Axis 117` IR/Hide = `Button 118` IR/Height = 50 -IR/Width = 30 +IR/Width = 50 IR/Center = 50 Swing/Up = `Axis 120` Swing/Down = `Axis 121` @@ -436,7 +436,7 @@ IR/Forward = `Axis 116` IR/Backward = `Axis 117` IR/Hide = `Button 118` IR/Height = 50 -IR/Width = 30 +IR/Width = 50 IR/Center = 50 Swing/Up = `Axis 120` Swing/Down = `Axis 121` diff --git a/Source/Android/app/src/main/assets/WiimoteProfile.ini b/Source/Android/app/src/main/assets/WiimoteProfile.ini index f31f68346c..2283a1add2 100644 --- a/Source/Android/app/src/main/assets/WiimoteProfile.ini +++ b/Source/Android/app/src/main/assets/WiimoteProfile.ini @@ -19,7 +19,7 @@ IR/Forward = `Axis 116` IR/Backward = `Axis 117` IR/Hide = `Button 118` IR/Height = 50 -IR/Width = 30 +IR/Width = 50 IR/Center = 50 Swing/Up = `Axis 120` Swing/Down = `Axis 121` diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/DirectoryInitialization.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/DirectoryInitialization.java index c8b54b36f0..47925df998 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/DirectoryInitialization.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/DirectoryInitialization.java @@ -34,6 +34,7 @@ public final class DirectoryInitialization "org.dolphinemu.dolphinemu.DIRECTORY_INITIALIZATION"; public static final String EXTRA_STATE = "directoryState"; + private static final Integer WiimoteNewVersion = 2; private static volatile DirectoryInitializationState directoryState = null; private static String userPath; private static String internalPath; @@ -145,7 +146,20 @@ public final class DirectoryInitialization createWiimoteProfileDirectory(profileDirectory); copyAsset("GCPadNew.ini", new File(configDirectory, "GCPadNew.ini"), true, context); - copyAsset("WiimoteNew.ini", new File(configDirectory, "WiimoteNew.ini"), false, context); + + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); + if (prefs.getInt("WiimoteNewVersion", 0) != WiimoteNewVersion) + { + copyAsset("WiimoteNew.ini", new File(configDirectory, "WiimoteNew.ini"), true, context); + SharedPreferences.Editor sPrefsEditor = prefs.edit(); + sPrefsEditor.putInt("WiimoteNewVersion", WiimoteNewVersion); + sPrefsEditor.apply(); + } + else + { + copyAsset("WiimoteNew.ini", new File(configDirectory, "WiimoteNew.ini"), false, context); + } + copyAsset("WiimoteProfile.ini", new File(profileDirectory, "WiimoteProfile.ini"), true, context); } From fd323e7d4c5b9dafd98ff20f9761a6f40f9a2e3e Mon Sep 17 00:00:00 2001 From: zackhow Date: Sat, 23 Mar 2019 08:11:35 -0400 Subject: [PATCH 3/3] Android: Remove game specific IR values Most games map fine with the default values and I have yet to read a single complaint on mapping the touch pointer. Going to just leave it up to the users to setup mapping if the defaults are not correct. --- Data/Sys/GameSettings/RMC.ini | 6 ------ Data/Sys/GameSettings/RMG.ini | 6 ------ Data/Sys/GameSettings/ROD.ini | 5 ----- Data/Sys/GameSettings/RUU.ini | 5 ----- Data/Sys/GameSettings/RZD.ini | 5 ----- Data/Sys/GameSettings/SB4.ini | 5 ----- 6 files changed, 32 deletions(-) diff --git a/Data/Sys/GameSettings/RMC.ini b/Data/Sys/GameSettings/RMC.ini index 2f933454a1..70571e0d41 100644 --- a/Data/Sys/GameSettings/RMC.ini +++ b/Data/Sys/GameSettings/RMC.ini @@ -1,10 +1,4 @@ # RMCE01, RMCJ01, RMCK01, RMCP01 - Mario Kart Wii - -[Controls] -IRHeight = 50 -IRWidth = 30 -IRCenter = 50 - [Core] # Values set here will override the main Dolphin settings. diff --git a/Data/Sys/GameSettings/RMG.ini b/Data/Sys/GameSettings/RMG.ini index 79f9f3d5e9..b5a2976662 100644 --- a/Data/Sys/GameSettings/RMG.ini +++ b/Data/Sys/GameSettings/RMG.ini @@ -1,10 +1,4 @@ # RMGE01, RMGJ01, RMGK01, RMGP01 - SUPER MARIO GALAXY - -[Controls] -IRHeight = 50 -IRWidth = 30 -IRCenter = 50 - [Core] # Values set here will override the main Dolphin settings. diff --git a/Data/Sys/GameSettings/ROD.ini b/Data/Sys/GameSettings/ROD.ini index 90c26ba2cd..76506da3ae 100644 --- a/Data/Sys/GameSettings/ROD.ini +++ b/Data/Sys/GameSettings/ROD.ini @@ -1,9 +1,4 @@ # RODE01, RODJ01, RODK01, RODP01 - WarioWare: Smooth Moves -[Controls] -IRHeight = 71 -IRWidth = 64 -IRCenter = 99 - [Core] # Values set here will override the main Dolphin settings. diff --git a/Data/Sys/GameSettings/RUU.ini b/Data/Sys/GameSettings/RUU.ini index 6a9159d4d6..18f0cccb06 100644 --- a/Data/Sys/GameSettings/RUU.ini +++ b/Data/Sys/GameSettings/RUU.ini @@ -1,9 +1,4 @@ # RUUE01, RUUJ01, RUUK01, RUUP01 - Animal Crossing Wii -[Controls] -IRHeight = 50 -IRWidth = 30 -IRCenter = 50 - [Core] # Values set here will override the main Dolphin settings. diff --git a/Data/Sys/GameSettings/RZD.ini b/Data/Sys/GameSettings/RZD.ini index 0ceb74c8ac..bb65f1a246 100644 --- a/Data/Sys/GameSettings/RZD.ini +++ b/Data/Sys/GameSettings/RZD.ini @@ -1,9 +1,4 @@ # RZDE01, RZDJ01, RZDK01, RZDP01 - The Legend of Zelda: Twilight Princess [Wii] -[Controls] -IRHeight = 39 -IRWidth = 37 -IRCenter = 91 - [Core] # Values set here will override the main Dolphin settings. diff --git a/Data/Sys/GameSettings/SB4.ini b/Data/Sys/GameSettings/SB4.ini index 8041f211ff..b05b10039c 100644 --- a/Data/Sys/GameSettings/SB4.ini +++ b/Data/Sys/GameSettings/SB4.ini @@ -1,9 +1,4 @@ # SB4E01, SB4J01, SB4P01 - Super Mario Galaxy 2 -[Controls] -IRHeight = 50 -IRWidth = 30 -IRCenter = 50 - [Core] # Values set here will override the main Dolphin settings.