|
@@ -30,7 +30,7 @@ import java.io.InputStream;
|
|
|
|
|
|
public class TextCopyFileActivity extends Activity {
|
|
|
private static final String TAG = "TextCopyFileActivity";
|
|
|
- private Button btn1, btn2;
|
|
|
+ private Button btn1, btn2, btn3;
|
|
|
private Context mContext;
|
|
|
|
|
|
@Override
|
|
@@ -72,6 +72,7 @@ public class TextCopyFileActivity extends Activity {
|
|
|
private void init() {
|
|
|
btn1 = findViewById(R.id.btn1);
|
|
|
btn2 = findViewById(R.id.btn2);
|
|
|
+ btn3 = findViewById(R.id.btn3);
|
|
|
btn1.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View view) {
|
|
@@ -90,6 +91,15 @@ public class TextCopyFileActivity extends Activity {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
+ btn3.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View view) {
|
|
|
+ startGame(Environment.getExternalStorageDirectory().getAbsolutePath() + "/arcade/rom/super_mario_bros_world.nes",
|
|
|
+ mContext.getFilesDir().getParent() + "/cores/mesen_libretro_android.so",
|
|
|
+ EmulatorType.NES);
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
private void startGame(String rompath, String corepath, EmulatorType Type) {
|
|
@@ -109,6 +119,9 @@ public class TextCopyFileActivity extends Activity {
|
|
|
case NEOGEO:
|
|
|
coreName = "fbalpha2012_neogeo_libretro_android.so";
|
|
|
break;
|
|
|
+ case NES:
|
|
|
+ coreName = "mesen_libretro_android.so";
|
|
|
+ break;
|
|
|
}
|
|
|
if (!TextUtils.isEmpty(coreName))
|
|
|
startCopy(coreName,
|
|
@@ -174,6 +187,7 @@ public class TextCopyFileActivity extends Activity {
|
|
|
try {
|
|
|
InputStream in = null;
|
|
|
in = this.getResources().getAssets().open("cores/"+fileName);
|
|
|
+// in = openFileInput("/storage/emulated/0/arcade/cores/" + fileName);
|
|
|
BufferedOutputStream outStream
|
|
|
= new BufferedOutputStream(new FileOutputStream(file_path, false));
|
|
|
byte[] buffer = new byte[1024];
|