浏览代码

1. add ppsspp btn
2. fix ppsspp draw error

ZengGengSen 2 年之前
父节点
当前提交
2e737b76d8

+ 13 - 1
app/src/main/java/com/xugame/gameconsole/TextCopyFileActivity.java

@@ -35,7 +35,7 @@ import java.io.InputStream;
 
 
 public class TextCopyFileActivity extends Activity {
 public class TextCopyFileActivity extends Activity {
     private static final String TAG = "TextCopyFileActivityTAG";
     private static final String TAG = "TextCopyFileActivityTAG";
-    private Button btn1, btn2, btn3;
+    private Button btn1, btn2, btn3, btn4;
     private Context mContext;
     private Context mContext;
 
 
     @Override
     @Override
@@ -109,6 +109,7 @@ public class TextCopyFileActivity extends Activity {
         btn1 = findViewById(R.id.btn1);
         btn1 = findViewById(R.id.btn1);
         btn2 = findViewById(R.id.btn2);
         btn2 = findViewById(R.id.btn2);
         btn3 = findViewById(R.id.btn3);
         btn3 = findViewById(R.id.btn3);
+        btn4 = findViewById(R.id.btn4);
         btn1.setOnClickListener(new View.OnClickListener() {
         btn1.setOnClickListener(new View.OnClickListener() {
             @Override
             @Override
             public void onClick(View view) {
             public void onClick(View view) {
@@ -136,6 +137,14 @@ public class TextCopyFileActivity extends Activity {
 
 
             }
             }
         });
         });
+        btn4.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                startGame(Environment.getExternalStorageDirectory().getAbsolutePath() + "/arcade/rom/PPSSPP/三国无双/三国无双.iso",
+                        mContext.getFilesDir().getParent() + "/cores/ppsspp_libretro_android.so",
+                        EmulatorType.PSP);
+            }
+        });
     }
     }
 
 
     private void startGame(String rompath, String corepath, EmulatorType Type) {
     private void startGame(String rompath, String corepath, EmulatorType Type) {
@@ -159,6 +168,9 @@ public class TextCopyFileActivity extends Activity {
                 case NES:
                 case NES:
                     coreName = "mesen_libretro_android.so";
                     coreName = "mesen_libretro_android.so";
                     break;
                     break;
+                case PSP:
+                    coreName = "ppsspp_libretro_android.so";
+                    break;
             }
             }
             if (!TextUtils.isEmpty(coreName))
             if (!TextUtils.isEmpty(coreName))
                 startCopy(coreName,
                 startCopy(coreName,

+ 2 - 1
app/src/main/java/com/xugame/gameconsole/emulator/EmulatorType.java

@@ -5,5 +5,6 @@ public enum EmulatorType {
     NEOGEO,
     NEOGEO,
     CPS1,
     CPS1,
     CPS2,
     CPS2,
-    CPS3
+    CPS3,
+    PSP,
 }
 }

+ 9 - 0
app/src/main/res/layout/textcopp_layout.xml

@@ -23,4 +23,13 @@
         android:layout_below="@+id/btn1"
         android:layout_below="@+id/btn1"
         android:layout_marginTop="54dp"
         android:layout_marginTop="54dp"
         android:text="Super Mario"></Button>
         android:text="Super Mario"></Button>
+
+    <Button
+        android:id="@+id/btn4"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_below="@+id/btn1"
+        android:layout_marginTop="110dp"
+        android:text="三国无双"></Button>
+
 </RelativeLayout>
 </RelativeLayout>