5 Commits b949eb2e98 ... 42cc750813

Author SHA1 Message Date
  wangyongj 42cc750813 add game screen setting 1 year ago
  wangyongj 224cfe12c0 Merge branch 'master' of http://8.136.234.80:10002/WangYongJun/GameConsole 1 year ago
  wangyongj 15e81b50af sysnc 1 year ago
  wangyongj a8437d47e8 Merge branch 'master' of http://8.136.234.80:10002/WangYongJun/GameConsole 1 year ago
  wangyongj a9b7fc2cc2 sync 1 year ago

+ 2 - 2
app/build.gradle

@@ -47,8 +47,8 @@ android {
         debug {
             keyAlias 'system'
             keyPassword 'xugame888'
-//            storeFile file('../s905_system.jks')
-            storeFile file('../android_4.4_haisi_zou_system.jks')//android4.4
+            storeFile file('../s905_system.jks')
+//            storeFile file('../android_4.4_haisi_zou_system.jks')//android4.4
 //            storeFile file('../q5_t509_system.jks')
 //            storeFile file('../q5_t509_system.jks')
 //            storeFile file('../3399_systemkey.jks')

BIN
app/release/Mt6572_Emulator_20230915.apk


+ 0 - 20
app/release/output-metadata.json

@@ -1,20 +0,0 @@
-{
-  "version": 3,
-  "artifactType": {
-    "type": "APK",
-    "kind": "Directory"
-  },
-  "applicationId": "com.xugame.gameconsole",
-  "variantName": "release",
-  "elements": [
-    {
-      "type": "SINGLE",
-      "filters": [],
-      "attributes": [],
-      "versionCode": 1,
-      "versionName": "1.0",
-      "outputFile": "app-release.apk"
-    }
-  ],
-  "elementType": "File"
-}

+ 10 - 10
app/src/main/AndroidManifest.xml

@@ -63,18 +63,18 @@
 
             android:launchMode="singleTop">
             <intent-filter>
-<!--                <action android:name="android.intent.action.MAIN" />-->
-<!--                <category android:name="android.intent.category.LAUNCHER" />-->
-<!--                <data-->
-<!--                    android:host="com.xugame.gameconsole.TextCopyFileActivity"-->
-<!--                    android:scheme="com.xugame.gameconsole.TextCopyFileActivity"-->
-<!--                    tools:ignore="AppLinkUrlError" />-->
+                <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
+                <data
+                    android:host="com.xugame.gameconsole.TextCopyFileActivity"
+                    android:scheme="com.xugame.gameconsole.TextCopyFileActivity"
+                    tools:ignore="AppLinkUrlError" />
+<!--                <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" />
+<!--                <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>
         </activity>
         <activity

+ 81 - 69
app/src/main/java/com/xugame/gameconsole/emulator/RetroArchEmulatorActivity.java

@@ -327,56 +327,57 @@ public class RetroArchEmulatorActivity extends RetroActivityCamera {
     }
 
     private void showDialog() {
-        GameMenuDialog menuDialog = new GameMenuDialog(this, new GameMenuDialogListener() {
-            @Override
-            public void onExitGame() {
-                exitLocalGame();
-                finish();
-            }
+        GameMenuDialog menuDialog = new GameMenuDialog(this,
+                new GameMenuDialogListener() {
+                    @Override
+                    public void onExitGame() {
+                        exitLocalGame();
+                        finish();
+                    }
 
-            @Override
-            public void onResumeGame(ScreenType type, int archiveIndex) {
-                mScreenType = type;
-                mUpdateScreen = true;
-                gameDialogClosed();
-            }
+                    @Override
+                    public void onResumeGame(ScreenType type, int archiveIndex) {
+                        mScreenType = type;
+                        mUpdateScreen = true;
+                        gameDialogClosed();
+                    }
 
-            @Override
-            public boolean onSaveState(int stateIndex) {
-                // Toast.makeText(mContext, "写入存档" + stateIndex, Toast.LENGTH_SHORT).show();
-                return saveState(stateIndex);
-            }
+                    @Override
+                    public boolean onSaveState(int stateIndex) {
+                        // Toast.makeText(mContext, "写入存档" + stateIndex, Toast.LENGTH_SHORT).show();
+                        return saveState(stateIndex);
+                    }
 
-            @Override
-            public boolean onLoadState(int stateIndex) {
-                // Toast.makeText(mContext,"读取存档"+stateIndex,Toast.LENGTH_SHORT).show();
-                return loadState(stateIndex);
-            }
+                    @Override
+                    public boolean onLoadState(int stateIndex) {
+                        // Toast.makeText(mContext,"读取存档"+stateIndex,Toast.LENGTH_SHORT).show();
+                        return loadState(stateIndex);
+                    }
 
-            @Override
-            public void onKeySettingNums(int[] keys) {
-                for (int i = 0; i < keys.length; i++) {
-                    setInputKeys(0, i, keys[i]);
-                }
-                saveOverrideConfig();
-            }
+                    @Override
+                    public void onKeySettingNums(int[] keys) {
+                        for (int i = 0; i < keys.length; i++) {
+                            setInputKeys(0, i, keys[i]);
+                        }
+                        saveOverrideConfig();
+                    }
 
-            @Override
-            public void onSetRatio(int type) {
-                switch (type) {
-                    case 0:
-                        setAspectRatio(AspectRatio.ASPECT_RATIO_CORE.getValue());
-                        break;
-                    case 1:
-                        setAspectRatio(AspectRatio.ASPECT_RATIO_FULL.getValue());
-                        break;
-                    case 2:
-                        setAspectRatio(AspectRatio.ASPECT_RATIO_CUSTOM.getValue());
-                        setCustomViewPort(100, 100, 480, 320);
-                        break;
-                }
-            }
-        });
+                    @Override
+                    public void onSetRatio(int type) {
+                        switch (type) {
+                            case 0:
+                                setAspectRatio(AspectRatio.ASPECT_RATIO_CORE.getValue());
+                                break;
+                            case 1:
+                                setAspectRatio(AspectRatio.ASPECT_RATIO_FULL.getValue());
+                                break;
+                            case 2:
+                                setAspectRatio(AspectRatio.ASPECT_RATIO_CUSTOM.getValue());
+                                setCustomViewPort(100, 100, 480, 320);
+                                break;
+                        }
+                    }
+                });
         menuDialog.setCanceledOnTouchOutside(true);
         menuDialog.show();
 
@@ -400,6 +401,9 @@ public class RetroArchEmulatorActivity extends RetroActivityCamera {
 //        alertDialog.show();
     }
 
+    private int mScreen = 0;
+    private int mScanline = 0;
+
     @Override
     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
         if (requestCode == 200) {
@@ -409,34 +413,42 @@ public class RetroArchEmulatorActivity extends RetroActivityCamera {
                     int scanLine = data.getIntExtra("scanLine", 0);
                     int screen = data.getIntExtra("screen", 0);
                     DebugUtil.i(TAG, "scanline=" + scanLine + "screen=" + screen);
-
-                    if (screen >= 0 && screen < 3) {
-                        switch (screen) {
-                            case 0:
-                                setAspectRatio(AspectRatio.ASPECT_RATIO_CUSTOM.getValue());
-                                setCustomViewPort(Util.getSize(420), Util.getSize(87), Util.getSize(1080), Util.getSize(810));
-                                break;
-                            case 1:
-                                setAspectRatio(AspectRatio.ASPECT_RATIO_CORE.getValue());
-                                break;
-                            case 2:
-                                setAspectRatio(AspectRatio.ASPECT_RATIO_FULL.getValue());
-                                break;
+                    if (mScreen != screen) {
+                        mScreen = screen;
+                        if (screen >= 0 && screen < 3) {
+                            switch (screen) {
+                                case 0:
+                                    setAspectRatio(AspectRatio.ASPECT_RATIO_CUSTOM.getValue());
+                                    setCustomViewPort(Util.getSize(420), Util.getSize(87), Util.getSize(1080), Util.getSize(810));
+                                    break;
+                                case 1:
+                                    setAspectRatio(AspectRatio.ASPECT_RATIO_CORE.getValue());
+                                    break;
+                                case 2:
+                                    setAspectRatio(AspectRatio.ASPECT_RATIO_FULL.getValue());
+                                    break;
+                            }
                         }
                     }
-                    if (scanLine >= 0 && scanLine < 3) {
-                        switch (ScreenType.values()[scanLine]) {
-                            case NORMAL:
-                                switchFilter(null);
-                                break;
-                            case SAI_2X:
-                                switchFilter("/data/user/0/com.xugame.gameconsole/filters/video/2xSaI.filt");
-                                break;
-                            case SCANLINE:
-                                switchFilter("/data/user/0/com.xugame.gameconsole/filters/video/Scanline2x.filt");
-                                break;
+                    if (mScanline != scanLine) {
+                        if (scanLine >= 0 && scanLine < 4) {
+                            switch (ScreenType.values()[scanLine]) {
+                                case NORMAL:
+                                    switchFilter(null);
+                                    break;
+                                case SAI_2X:
+                                    switchFilter("/data/user/0/com.xugame.gameconsole/filters/video/Scale2x.filt");
+                                    break;
+                                case SCANLINE:
+                                    switchFilter("/data/user/0/com.xugame.gameconsole/filters/video/Scanline2x.filt");
+                                    break;
+                                case SAI_4X:
+                                    switchFilter("/data/user/0/com.xugame.gameconsole/filters/video/EPX.filt");
+                                    break;
+                            }
                         }
                     }
+
                 }
             } else if (resultCode == 0) {
                 exitLocalGame();

+ 1 - 0
app/src/main/java/com/xugame/gameconsole/emulator/ScreenType.java

@@ -4,4 +4,5 @@ public enum ScreenType {
     NORMAL,
     SAI_2X,
     SCANLINE,
+    SAI_4X
 }