|
@@ -143,6 +143,10 @@ public class RetroArchEmulatorActivity extends RetroActivityCamera
|
|
@Override
|
|
@Override
|
|
public void saveStateCallback(int error) {
|
|
public void saveStateCallback(int error) {
|
|
Log.i("EnvironmentCallback", "saveStateCallback: " + error);
|
|
Log.i("EnvironmentCallback", "saveStateCallback: " + error);
|
|
|
|
+ Intent intent = new Intent();
|
|
|
|
+ intent.setAction(EmulatorMonitor.EMULATOR_SAVE_STATE_RESULT_ACTION);
|
|
|
|
+ intent.putExtra("save_state_flag", error == 0);
|
|
|
|
+ sendBroadcast(intent);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
mEmulatorMonitor = new EmulatorMonitor(this, this);
|
|
mEmulatorMonitor = new EmulatorMonitor(this, this);
|
|
@@ -436,6 +440,7 @@ public class RetroArchEmulatorActivity extends RetroActivityCamera
|
|
|
|
|
|
@Override
|
|
@Override
|
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
|
|
+ DebugUtil.i(TAG,"requestCode="+requestCode+"resultCode="+resultCode);
|
|
if (requestCode == 200) {
|
|
if (requestCode == 200) {
|
|
if (resultCode == 201) {//继续游戏
|
|
if (resultCode == 201) {//继续游戏
|
|
gameDialogClosed();
|
|
gameDialogClosed();
|
|
@@ -449,50 +454,50 @@ public class RetroArchEmulatorActivity extends RetroActivityCamera
|
|
int screen = data.getIntExtra("screen", 0);
|
|
int screen = data.getIntExtra("screen", 0);
|
|
DebugUtil.i(TAG, "scanline=" + scanLine + "screen=" + screen);
|
|
DebugUtil.i(TAG, "scanline=" + scanLine + "screen=" + screen);
|
|
// if (mScreen != screen) {
|
|
// if (mScreen != screen) {
|
|
- mScreen = screen;
|
|
|
|
- if (screen >= 0 && screen < 3) {
|
|
|
|
- DebugUtil.i(TAG, "设置screen" + screen);
|
|
|
|
- switch (screen) {
|
|
|
|
|
|
+ mScreen = screen;
|
|
|
|
+ if (screen >= 0 && screen < 3) {
|
|
|
|
+ DebugUtil.i(TAG, "设置screen" + screen);
|
|
|
|
+ switch (screen) {
|
|
|
|
|
|
- case 0:
|
|
|
|
- setAspectRatio(AspectRatio.ASPECT_RATIO_CORE.getValue());
|
|
|
|
|
|
+ case 0:
|
|
|
|
+ setAspectRatio(AspectRatio.ASPECT_RATIO_CORE.getValue());
|
|
// setCustomViewPort(Util.getSize(420), Util.getSize(87), Util.getSize(1080), Util.getSize(810));
|
|
// setCustomViewPort(Util.getSize(420), Util.getSize(87), Util.getSize(1080), Util.getSize(810));
|
|
- break;
|
|
|
|
- case 1:
|
|
|
|
- setAspectRatio(AspectRatio.ASPECT_RATIO_4_3.getValue());
|
|
|
|
- break;
|
|
|
|
- case 2:
|
|
|
|
- setAspectRatio(AspectRatio.ASPECT_RATIO_FULL.getValue());
|
|
|
|
- break;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+ break;
|
|
|
|
+ case 1:
|
|
|
|
+ setAspectRatio(AspectRatio.ASPECT_RATIO_4_3.getValue());
|
|
|
|
+ break;
|
|
|
|
+ case 2:
|
|
|
|
+ setAspectRatio(AspectRatio.ASPECT_RATIO_FULL.getValue());
|
|
|
|
+ break;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
+ }
|
|
// }
|
|
// }
|
|
// if (mScanline != scanLine) {
|
|
// if (mScanline != scanLine) {
|
|
- mScanline = scanLine;
|
|
|
|
- if (scanLine >= 0 && scanLine < 4) {
|
|
|
|
- DebugUtil.i(TAG, "设置scanLine" + scanLine + ScreenType.values()[scanLine]);
|
|
|
|
-
|
|
|
|
- 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 EPX:
|
|
|
|
- switchFilter("/data/user/0/com.xugame.gameconsole/filters/video/EPX.filt");
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
|
|
+ mScanline = scanLine;
|
|
|
|
+ if (scanLine >= 0 && scanLine < 4) {
|
|
|
|
+ DebugUtil.i(TAG, "设置scanLine" + scanLine + ScreenType.values()[scanLine]);
|
|
|
|
+
|
|
|
|
+ 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 EPX:
|
|
|
|
+ switchFilter("/data/user/0/com.xugame.gameconsole/filters/video/EPX.filt");
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
|
|
+ }
|
|
// }
|
|
// }
|
|
} else {
|
|
} else {
|
|
int multiple = data.getIntExtra("multiple", -1);
|
|
int multiple = data.getIntExtra("multiple", -1);
|
|
- mScanline=-1;
|
|
|
|
- mScreen=-1;
|
|
|
|
|
|
+ mScanline = -1;
|
|
|
|
+ mScreen = -1;
|
|
DebugUtil.i(TAG, "multiple=" + multiple);
|
|
DebugUtil.i(TAG, "multiple=" + multiple);
|
|
if (multiple >= 2 && multiple <= 5) {
|
|
if (multiple >= 2 && multiple <= 5) {
|
|
resetScreenForPerfect(multiple);
|
|
resetScreenForPerfect(multiple);
|
|
@@ -693,12 +698,13 @@ public class RetroArchEmulatorActivity extends RetroActivityCamera
|
|
public void onMenuSaveState(int index) {
|
|
public void onMenuSaveState(int index) {
|
|
DebugUtil.i(TAG, "saveState" + index);
|
|
DebugUtil.i(TAG, "saveState" + index);
|
|
if (index >= 0 && index < 10) {
|
|
if (index >= 0 && index < 10) {
|
|
- if (saveState(index)) {
|
|
|
|
- Intent intent = new Intent();
|
|
|
|
- intent.setAction(EmulatorMonitor.EMULATOR_SAVE_STATE_ACTION);
|
|
|
|
- intent.putExtra("save_state_flag", true);
|
|
|
|
- this.sendBroadcast(intent);
|
|
|
|
- }
|
|
|
|
|
|
+ saveState(index);
|
|
|
|
+// if (saveState(index)) {
|
|
|
|
+// Intent intent = new Intent();
|
|
|
|
+// intent.setAction(EmulatorMonitor.EMULATOR_SAVE_STATE_ACTION);
|
|
|
|
+// intent.putExtra("save_state_flag", true);
|
|
|
|
+// this.sendBroadcast(intent);
|
|
|
|
+// }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|