Parcourir la source

add saveState broadcast

wangyongj il y a 1 an
Parent
commit
9b57a7346a

BIN
app/release/Emulator_20231019.apk


+ 0 - 2
app/src/main/AndroidManifest.xml

@@ -3,7 +3,6 @@
     xmlns:tools="http://schemas.android.com/tools"
     package="com.xugame.gameconsole"
     android:installLocation="internalOnly"
-    android:sharedUserId="android.uid.system"
     android:versionCode="1597175257"
     android:versionName="1.15.0">
 
@@ -72,7 +71,6 @@
                 <category android:name="android.intent.category.LAUNCHER" />
 
                 <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.HOME" />
                 <category android:name="android.intent.category.DEFAULT" />
                 <category android:name="android.intent.category.MONKEY" />
             </intent-filter>

+ 45 - 45
app/src/main/java/com/xugame/bean/InputCode.java

@@ -7,21 +7,21 @@ public class InputCode {
         // Joypad
         public static final int JOYPAD_BIND_START = 0;
 
-        public static final int JOYPAD_B = 0;
-        public static final int JOYPAD_Y = 1;
+        public static final int JOYPAD_B = 0;//拳皇97轻拳
+        public static final int JOYPAD_Y = 1;//重拳
         public static final int JOYPAD_SELECT = 2;
         public static final int JOYPAD_START = 3;
         public static final int JOYPAD_UP = 4;
-        public static final int JOYPAD_DOWN = 5;     
-        public static final int JOYPAD_LEFT = 6;     
+        public static final int JOYPAD_DOWN = 5;
+        public static final int JOYPAD_LEFT = 6;
         public static final int JOYPAD_RIGHT = 7;
-        public static final int JOYPAD_A = 8;        
-        public static final int JOYPAD_X = 9;        
-        public static final int JOYPAD_L = 10;       
+        public static final int JOYPAD_A = 8;    //轻脚
+        public static final int JOYPAD_X = 9;       //重脚
+        public static final int JOYPAD_L = 10;
         public static final int JOYPAD_R = 11;
-        public static final int JOYPAD_L2 = 12;      
-        public static final int JOYPAD_R2 = 13;      
-        public static final int JOYPAD_L3 = 14;      
+        public static final int JOYPAD_L2 = 12;
+        public static final int JOYPAD_R2 = 13;
+        public static final int JOYPAD_L3 = 14;
         public static final int JOYPAD_R3 = 15;
 
         public static final int JOYPAD_BIND_END = 16;
@@ -63,47 +63,47 @@ public class InputCode {
     }
 
     public static class JoypadBindKeySet {
-        public static final int JOYPAD_NONE                = -1;
-        public static final int JOYPAD_BTN_B               = KeyEvent.KEYCODE_BUTTON_B;
-        public static final int JOYPAD_BTN_Y               = KeyEvent.KEYCODE_BUTTON_Y;
-        public static final int JOYPAD_BTN_SELECT          = KeyEvent.KEYCODE_BUTTON_SELECT;
-        public static final int JOYPAD_BTN_START           = KeyEvent.KEYCODE_BUTTON_START;
+        public static final int JOYPAD_NONE = -1;
+        public static final int JOYPAD_BTN_B = KeyEvent.KEYCODE_BUTTON_B;
+        public static final int JOYPAD_BTN_Y = KeyEvent.KEYCODE_BUTTON_Y;
+        public static final int JOYPAD_BTN_SELECT = KeyEvent.KEYCODE_BUTTON_SELECT;
+        public static final int JOYPAD_BTN_START = KeyEvent.KEYCODE_BUTTON_START;
         // public static final int JOYPAD_BTN_UP              = KeyEvent.KEYCODE_DPAD_UP;
         // public static final int JOYPAD_BTN_DOWN            = KeyEvent.KEYCODE_DPAD_DOWN;
         // public static final int JOYPAD_BTN_LEFT            = KeyEvent.KEYCODE_DPAD_LEFT;
         // public static final int JOYPAD_BTN_RIGHT           = KeyEvent.KEYCODE_DPAD_RIGHT;
-        public static final int JOYPAD_BTN_A               = KeyEvent.KEYCODE_BUTTON_A;
-        public static final int JOYPAD_BTN_X               = KeyEvent.KEYCODE_BUTTON_X;
-        public static final int JOYPAD_BTN_L               = KeyEvent.KEYCODE_BUTTON_L1;
-        public static final int JOYPAD_BTN_R               = KeyEvent.KEYCODE_BUTTON_R1;
-        public static final int JOYPAD_BTN_L2              = KeyEvent.KEYCODE_BUTTON_L2;
-        public static final int JOYPAD_BTN_R2              = KeyEvent.KEYCODE_BUTTON_R2;
-        public static final int JOYPAD_BTN_L3              = KeyEvent.KEYCODE_BUTTON_THUMBL;
-        public static final int JOYPAD_BTN_R3              = KeyEvent.KEYCODE_BUTTON_THUMBR;
-        public static final int JOYPAD_HAT_UP              = 1 << 15;
-        public static final int JOYPAD_HAT_DOWN            = 1 << 14;
-        public static final int JOYPAD_HAT_LEFT            = 1 << 13;
-        public static final int JOYPAD_HAT_RIGHT           = 1 << 12;
-        public static final int JOYPAD_AXIS_X_PLUS         = 0 - 65536;
-        public static final int JOYPAD_AXIS_X_MINIS        = 0 * 65536 + 65535;
-        public static final int JOYPAD_AXIS_Y_PLUS         = 1 - 65536;
-        public static final int JOYPAD_AXIS_Y_MINIS        = 1 * 65536 + 65535;
-        public static final int JOYPAD_AXIS_Z_PLUS         = 2 - 65536;
-        public static final int JOYPAD_AXIS_Z_MINIS        = 2 * 65536 + 65535;
-        public static final int JOYPAD_AXIS_RZ_PLUS        = 3 - 65536;
-        public static final int JOYPAD_AXIS_RZ_MINIS       = 3 * 65536 + 65535;
-        public static final int JOYPAD_AXIS_HAT_X_PLUS     = 4 - 65536;
-        public static final int JOYPAD_AXIS_HAT_X_MINIS    = 4 * 65536 + 65535;
-        public static final int JOYPAD_AXIS_HAT_Y_PLUS     = 5 - 65536;
-        public static final int JOYPAD_AXIS_HAT_Y_MINIS    = 5 * 65536 + 65535;
-        public static final int JOYPAD_AXIS_LTRIGGER_PLUS  = 6 - 65536;
+        public static final int JOYPAD_BTN_A = KeyEvent.KEYCODE_BUTTON_A;
+        public static final int JOYPAD_BTN_X = KeyEvent.KEYCODE_BUTTON_X;
+        public static final int JOYPAD_BTN_L = KeyEvent.KEYCODE_BUTTON_L1;
+        public static final int JOYPAD_BTN_R = KeyEvent.KEYCODE_BUTTON_R1;
+        public static final int JOYPAD_BTN_L2 = KeyEvent.KEYCODE_BUTTON_L2;
+        public static final int JOYPAD_BTN_R2 = KeyEvent.KEYCODE_BUTTON_R2;
+        public static final int JOYPAD_BTN_L3 = KeyEvent.KEYCODE_BUTTON_THUMBL;
+        public static final int JOYPAD_BTN_R3 = KeyEvent.KEYCODE_BUTTON_THUMBR;
+        public static final int JOYPAD_HAT_UP = 1 << 15;
+        public static final int JOYPAD_HAT_DOWN = 1 << 14;
+        public static final int JOYPAD_HAT_LEFT = 1 << 13;
+        public static final int JOYPAD_HAT_RIGHT = 1 << 12;
+        public static final int JOYPAD_AXIS_X_PLUS = 0 - 65536;
+        public static final int JOYPAD_AXIS_X_MINIS = 0 * 65536 + 65535;
+        public static final int JOYPAD_AXIS_Y_PLUS = 1 - 65536;
+        public static final int JOYPAD_AXIS_Y_MINIS = 1 * 65536 + 65535;
+        public static final int JOYPAD_AXIS_Z_PLUS = 2 - 65536;
+        public static final int JOYPAD_AXIS_Z_MINIS = 2 * 65536 + 65535;
+        public static final int JOYPAD_AXIS_RZ_PLUS = 3 - 65536;
+        public static final int JOYPAD_AXIS_RZ_MINIS = 3 * 65536 + 65535;
+        public static final int JOYPAD_AXIS_HAT_X_PLUS = 4 - 65536;
+        public static final int JOYPAD_AXIS_HAT_X_MINIS = 4 * 65536 + 65535;
+        public static final int JOYPAD_AXIS_HAT_Y_PLUS = 5 - 65536;
+        public static final int JOYPAD_AXIS_HAT_Y_MINIS = 5 * 65536 + 65535;
+        public static final int JOYPAD_AXIS_LTRIGGER_PLUS = 6 - 65536;
         public static final int JOYPAD_AXIS_LTRIGGER_MINIS = 6 * 65536 + 65535;
-        public static final int JOYPAD_AXIS_RTRIGGER_PLUS  = 7 - 65536;
+        public static final int JOYPAD_AXIS_RTRIGGER_PLUS = 7 - 65536;
         public static final int JOYPAD_AXIS_RTRIGGER_MINIS = 7 * 65536 + 65535;
-        public static final int JOYPAD_AXIS_BRAKE_PLUS     = 2 - 65536;
-        public static final int JOYPAD_AXIS_BRAKE_MINIS    = 2 * 65536 + 65535;
-        public static final int JOYPAD_AXIS_GAS_PLUS       = 3 - 65536;
-        public static final int JOYPAD_AXIS_GAS_MINIS      = 3 * 65536 + 65535;
+        public static final int JOYPAD_AXIS_BRAKE_PLUS = 2 - 65536;
+        public static final int JOYPAD_AXIS_BRAKE_MINIS = 2 * 65536 + 65535;
+        public static final int JOYPAD_AXIS_GAS_PLUS = 3 - 65536;
+        public static final int JOYPAD_AXIS_GAS_MINIS = 3 * 65536 + 65535;
     }
 
     public static final int INPUT_CODE_END = 24;

+ 39 - 25
app/src/main/java/com/xugame/gameconsole/emulator/RetroArchEmulatorActivity.java

@@ -499,31 +499,45 @@ public class RetroArchEmulatorActivity extends RetroActivityCamera
         super.onActivityResult(requestCode, resultCode, data);
     }
 
-//    private void testSetKey() {
-//        int[] javaKey = {
-//            InputCode.JoypadBindKeySet.JOYPAD_BTN_A,
-//            InputCode.JoypadBindKeySet.JOYPAD_BTN_B,
-//        };
-//        int[] emulatorKey = {
-//            InputCode.JoypadBindSet.JOYPAD_B,
-//        InputCode.JoypadBindSet.JOYPAD_Y ,
-//        InputCode.JoypadBindSet.JOYPAD_SELECT = 2;
-//        InputCode.JoypadBindSet.JOYPAD_START = 3;
-//        InputCode.JoypadBindSet.JOYPAD_UP = 4;
-//        InputCode.JoypadBindSet.JOYPAD_DOWN = 5;
-//        InputCode.JoypadBindSet.JOYPAD_LEFT = 6;
-//        InputCode.JoypadBindSet.JOYPAD_RIGHT = 7;
-//        InputCode.JoypadBindSet.JOYPAD_A = 8;
-//        InputCode.JoypadBindSet.JOYPAD_X = 9;
-//        InputCode.JoypadBindSet.JOYPAD_L = 10;
-//        InputCode.JoypadBindSet.JOYPAD_R = 11;
-//        InputCode.JoypadBindSet.JOYPAD_L2 = 12;
-//        InputCode.JoypadBindSet.JOYPAD_R2 = 13;
-//        InputCode.JoypadBindSet.JOYPAD_L3 = 14;
-//        InputCode.JoypadBindSet.JOYPAD_R3 = 15;
-//        };
-//        setJoystickBindNative(0, javaKey, emulatorKey);
-//    }
+    private void testSetKey() {
+        int[] javaKey = {
+                InputCode.JoypadBindKeySet.JOYPAD_BTN_A,//轻拳
+                InputCode.JoypadBindKeySet.JOYPAD_BTN_B,//重拳
+                108,
+                109,
+                InputCode.JoypadBindKeySet.JOYPAD_AXIS_X_PLUS,
+                InputCode.JoypadBindKeySet.JOYPAD_AXIS_X_MINIS,
+                InputCode.JoypadBindKeySet.JOYPAD_AXIS_Y_PLUS,
+                InputCode.JoypadBindKeySet.JOYPAD_AXIS_Y_MINIS,
+                99,//轻脚
+                100,//重脚
+                98,
+                101,
+                103,
+                104,
+                105,
+                106
+        };
+        int[] emulatorKey = {
+                InputCode.JoypadBindSet.JOYPAD_B,
+                InputCode.JoypadBindSet.JOYPAD_Y,
+                InputCode.JoypadBindSet.JOYPAD_SELECT,
+                InputCode.JoypadBindSet.JOYPAD_START,
+                InputCode.JoypadBindSet.JOYPAD_UP,
+                InputCode.JoypadBindSet.JOYPAD_DOWN,
+                InputCode.JoypadBindSet.JOYPAD_LEFT,
+                InputCode.JoypadBindSet.JOYPAD_RIGHT,
+                InputCode.JoypadBindSet.JOYPAD_A,
+                InputCode.JoypadBindSet.JOYPAD_X,
+                InputCode.JoypadBindSet.JOYPAD_L,
+                InputCode.JoypadBindSet.JOYPAD_R,
+                InputCode.JoypadBindSet.JOYPAD_L2,
+                InputCode.JoypadBindSet.JOYPAD_R2,
+                InputCode.JoypadBindSet.JOYPAD_L3,
+                InputCode.JoypadBindSet.JOYPAD_R3,
+        };
+        setJoystickBindNative(0, javaKey, emulatorKey);
+    }
 
 
     private void resetScreenForPerfect(int multiple) {

+ 1 - 1
app/src/main/java/com/xugame/gameconsole/util/DebugUtil.java

@@ -4,7 +4,7 @@ import android.util.Log;
 
 
 public class DebugUtil {
-    static private boolean DEBUG = true;
+    static private boolean DEBUG = false;
 
     public static void d(String tag, String msg) {
         if (DEBUG)