|
@@ -41,6 +41,7 @@ public class RetroArchEmulatorActivity extends RetroActivityCamera {
|
|
|
private boolean quitfocus = false;
|
|
|
|
|
|
private AppSystem system = null;
|
|
|
+ private boolean isBusy=false;
|
|
|
|
|
|
@Override
|
|
|
public void onCreate(Bundle savedInstanceState) {
|
|
@@ -112,6 +113,7 @@ public class RetroArchEmulatorActivity extends RetroActivityCamera {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public void showLocalExitDialog() {
|
|
|
// runOnUiThread(new Runnable() {
|
|
@@ -120,14 +122,26 @@ public class RetroArchEmulatorActivity extends RetroActivityCamera {
|
|
|
// showDialog();
|
|
|
// }
|
|
|
// });
|
|
|
- Intent intent=new Intent();//调出主菜单UI
|
|
|
- ComponentName componentName=new ComponentName("com.xugame.gameconsoleMenu",
|
|
|
- "com.xugame.gameconsole.dialog.localgamesetting.LocalGameSettingDialog");
|
|
|
- intent.setComponent(componentName);
|
|
|
- startActivityForResult(intent,200);
|
|
|
- DebugUtil.i(TAG,"showLocalExitDialog");
|
|
|
+ if(!isBusy){
|
|
|
+ isBusy=true;
|
|
|
+ Intent intent = new Intent();//调出主菜单UI
|
|
|
+ ComponentName componentName = new ComponentName("com.xugame.gameconsoleMenu",
|
|
|
+ "com.xugame.gameconsole.dialog.localgamesetting.LocalGameSettingDialog");
|
|
|
+ intent.setComponent(componentName);
|
|
|
+ startActivityForResult(intent, 200);
|
|
|
+ DebugUtil.i(TAG, "showLocalExitDialog");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onPause() {
|
|
|
+ super.onPause();
|
|
|
+ isBusy=false;
|
|
|
+ DebugUtil.i(TAG,"onPause");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public void onResume() {
|
|
|
super.onResume();
|
|
@@ -173,21 +187,21 @@ public class RetroArchEmulatorActivity extends RetroActivityCamera {
|
|
|
// This requires NVIDIA Android extensions (available on NVIDIA Shield), if they are not
|
|
|
// available then nothing will be done
|
|
|
if (retro.hasExtra("HIDEMOUSE")) hideMouseCursor();
|
|
|
- int screenMode=retro.getIntExtra("screenMode",0);
|
|
|
- if(screenMode>=0&&screenMode<3){
|
|
|
- switch (screenMode) {
|
|
|
- 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(Util.getSize(420), Util.getSize(87), Util.getSize(1080), Util.getSize(810));
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
+ int screenMode = retro.getIntExtra("screenMode", 0);
|
|
|
+// if(screenMode>=0&&screenMode<3){
|
|
|
+// switch (screenMode) {
|
|
|
+// 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(Util.getSize(420), Util.getSize(87), Util.getSize(1080), Util.getSize(810));
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
//Checks if Android versions is above 9.0 (28) and enable the screen to write over notch if the user desires
|
|
@@ -228,7 +242,7 @@ public class RetroArchEmulatorActivity extends RetroActivityCamera {
|
|
|
@Override
|
|
|
public void onStop() {
|
|
|
super.onStop();
|
|
|
-
|
|
|
+ DebugUtil.i(TAG,"onStop");
|
|
|
// If QUITFOCUS parameter was set then completely exit Retroarch when focus is lost
|
|
|
if (quitfocus) System.exit(0);
|
|
|
}
|
|
@@ -244,12 +258,30 @@ public class RetroArchEmulatorActivity extends RetroActivityCamera {
|
|
|
"com.xugame.gameconsole.dialog.localgamesetting.LocalGameSettingDialog");
|
|
|
intent.setComponent(componentName);
|
|
|
startActivityForResult(intent,200);
|
|
|
+// setScan();
|
|
|
return super.dispatchKeyEvent(event);
|
|
|
}
|
|
|
|
|
|
return super.dispatchKeyEvent(event);
|
|
|
}
|
|
|
|
|
|
+ private int tempIndex = 0;
|
|
|
+
|
|
|
+ private void setScan() {
|
|
|
+ tempIndex++;
|
|
|
+ if (tempIndex >= 4)
|
|
|
+ tempIndex = 0;
|
|
|
+ DebugUtil.i(TAG,"tempIndex="+tempIndex);
|
|
|
+ if (tempIndex == 0)
|
|
|
+ switchFilter(null);
|
|
|
+ if (tempIndex == 1)
|
|
|
+ switchFilter("/data/user/0/com.xugame.gameconsole/filters/video/2xSaI.filt");
|
|
|
+ if (tempIndex == 2)
|
|
|
+ switchFilter("/data/user/0/com.xugame.gameconsole/filters/video/Scanline2x.filt");
|
|
|
+ if (tempIndex == 3)
|
|
|
+ switchFilter("/data/user/0/com.xugame.gameconsole/filters/video/Normal2x.filt");
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
|
|
DebugUtil.i(TAG, "onKeyDown=" + event.getKeyCode());
|
|
@@ -261,17 +293,17 @@ public class RetroArchEmulatorActivity extends RetroActivityCamera {
|
|
|
if (mUpdateScreen) {
|
|
|
switch (mScreenType) {
|
|
|
case NORMAL:
|
|
|
- switchFilter(null);
|
|
|
+ switchFilter("/data/user/0/com.xugame.gameconsole/filters/video/Scale2x.filt");
|
|
|
break;
|
|
|
case SAI_2X:
|
|
|
- switchFilter("/data/user/0/com.xugame.gameconsole/filters/video/2xSaI.filt");
|
|
|
+ switchFilter("/data/user/0/com.xugame.gameconsole/filters/video/LQ2x.filt");
|
|
|
break;
|
|
|
case SCANLINE:
|
|
|
- switchFilter("/data/user/0/com.xugame.gameconsole/filters/video/Scanline2x.filt");
|
|
|
+ switchFilter("/data/user/0/com.xugame.gameconsole/filters/video/EPX.filt");
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ DebugUtil.i(TAG,"onWindowFocusChanged"+hasFocus);
|
|
|
super.onWindowFocusChanged(hasFocus);
|
|
|
}
|
|
|
|
|
@@ -357,35 +389,35 @@ public class RetroArchEmulatorActivity extends RetroActivityCamera {
|
|
|
if (data != null) {
|
|
|
int scanLine = data.getIntExtra("scanLine", 0);
|
|
|
int screen = data.getIntExtra("screen", 0);
|
|
|
- DebugUtil.i(TAG,"scanline="+scanLine+"screen="+screen);
|
|
|
+ DebugUtil.i(TAG, "scanline=" + scanLine + "screen=" + screen);
|
|
|
|
|
|
if (screen >= 0 && screen < 3) {
|
|
|
switch (screen) {
|
|
|
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(Util.getSize(420), Util.getSize(87), Util.getSize(1080), Util.getSize(810));
|
|
|
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");
|
|
|
+ case 1:
|
|
|
+ setAspectRatio(AspectRatio.ASPECT_RATIO_CORE.getValue());
|
|
|
break;
|
|
|
- case SCANLINE:
|
|
|
- switchFilter("/data/user/0/com.xugame.gameconsole/filters/video/Scanline2x.filt");
|
|
|
+ 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;
|
|
|
+// }
|
|
|
+// }
|
|
|
}
|
|
|
} else if (resultCode == 0) {
|
|
|
exitLocalGame();
|