|
@@ -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();
|