|
@@ -176,18 +176,37 @@ public class RetroArchEmulatorActivity extends RetroActivityCamera implements
|
|
|
if (quitfocus) System.exit(0);
|
|
|
}
|
|
|
|
|
|
+ int index = 0;
|
|
|
+
|
|
|
@Override
|
|
|
public boolean dispatchKeyEvent(KeyEvent event) {
|
|
|
DebugUtil.i(TAG, "" + event.getKeyCode());
|
|
|
if (event.getKeyCode() == KeyEvent.KEYCODE_BACK
|
|
|
&& event.getAction() == KeyEvent.ACTION_DOWN) {
|
|
|
// 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);
|
|
|
- return super.dispatchKeyEvent(event);
|
|
|
+// Intent intent = new Intent();//调出主菜单UI
|
|
|
+// ComponentName componentName = new ComponentName("com.xugame.gameconsoleMenu",
|
|
|
+// "com.xugame.gameconsole.dialog.localgamesetting.LocalGameSettingDialog");
|
|
|
+// intent.setComponent(componentName);
|
|
|
+// startActivityForResult(intent, 200);
|
|
|
+ switch (index) {
|
|
|
+ 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;
|
|
|
+
|
|
|
+ }
|
|
|
+ if (index >= 3)
|
|
|
+ index = 0;
|
|
|
+ else
|
|
|
+ index++;
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
return super.dispatchKeyEvent(event);
|
|
@@ -350,16 +369,16 @@ public class RetroArchEmulatorActivity extends RetroActivityCamera implements
|
|
|
|
|
|
@Override
|
|
|
public void onMenuSaveState(int index) {
|
|
|
- DebugUtil.i(TAG,"onMenuSaveState"+index);
|
|
|
- boolean isOk=saveState(index);
|
|
|
- if(isOk){
|
|
|
+ DebugUtil.i(TAG, "onMenuSaveState" + index);
|
|
|
+ boolean isOk = saveState(index);
|
|
|
+ if (isOk) {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void onMenuLoadState(int index) {
|
|
|
- DebugUtil.i(TAG,"onMenuLoadState"+index);
|
|
|
+ DebugUtil.i(TAG, "onMenuLoadState" + index);
|
|
|
loadState(index);
|
|
|
}
|
|
|
}
|