diff --git a/shell/android/jni/src/Android.cpp b/shell/android/jni/src/Android.cpp index f5bb25798..e5a873ed4 100644 --- a/shell/android/jni/src/Android.cpp +++ b/shell/android/jni/src/Android.cpp @@ -58,6 +58,7 @@ extern "C" JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_frameskip(JNIEnv *env,jobject obj, jint frames) __attribute__((visibility("default"))); JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_pvrrender(JNIEnv *env,jobject obj, jint render) __attribute__((visibility("default"))); JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_cheatdisk(JNIEnv *env,jobject obj, jstring disk) __attribute__((visibility("default"))); + JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_usereios(JNIEnv *env,jobject obj, jint reios) __attribute__((visibility("default"))); JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_dreamtime(JNIEnv *env,jobject obj, jlong clock) __attribute__((visibility("default"))); }; @@ -136,6 +137,11 @@ JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_cheatdisk(JNIEnv *env } +JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_usereios(JNIEnv *env,jobject obj, jint reios) +{ + settings.bios.UseReios = reios; +} + JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_dreamtime(JNIEnv *env,jobject obj, jlong clock) { settings.dreamcast.RTC = (u32)(clock); diff --git a/shell/android/res/layout/configure_fragment.xml b/shell/android/res/layout/configure_fragment.xml index 732f03b5c..90cb954ad 100644 --- a/shell/android/res/layout/configure_fragment.xml +++ b/shell/android/res/layout/configure_fragment.xml @@ -80,6 +80,41 @@ android:text="@string/browse" /> + + + + + + + + + + + + + - + android:gravity="center_vertical" > - + android:layout_marginRight="5dp" + android:layout_weight="1" + android:ems="10" + android:gravity="right" + android:inputType="number" > + + - + - - - + + + Optimization and Debugging Options Experimental (May cause widespread panic) + Use reios BIOS BIOS Region (dc_flash[X].bin) Enable Game Details Native Mode [No OSD] diff --git a/shell/android/src/com/reicast/emulator/config/Config.java b/shell/android/src/com/reicast/emulator/config/Config.java index fe77dcca8..d69fbfb55 100644 --- a/shell/android/src/com/reicast/emulator/config/Config.java +++ b/shell/android/src/com/reicast/emulator/config/Config.java @@ -31,6 +31,7 @@ public class Config { public static final String pref_frameskip = "frame_skip"; public static final String pref_pvrrender = "pvr_render"; public static final String pref_cheatdisk = "cheat_disk"; + public static final String pref_usereios = "use_reios"; public static final String pref_showfps = "show_fps"; public static final String pref_forcegpu = "force_gpu"; @@ -57,6 +58,7 @@ public class Config { public static int frameskip = 0; public static boolean pvrrender = false; public static String cheatdisk = "null"; + public static boolean usereios = false; public static boolean nativeact = false; public static int vibrationDuration = 20; @@ -87,6 +89,7 @@ public class Config { Config.frameskip = mPrefs.getInt(pref_frameskip, frameskip); Config.pvrrender = mPrefs.getBoolean(pref_pvrrender, pvrrender); Config.cheatdisk = mPrefs.getString(pref_cheatdisk, cheatdisk); + Config.usereios = mPrefs.getBoolean(pref_usereios, usereios); Config.nativeact = mPrefs.getBoolean(pref_nativeact, nativeact); } @@ -109,6 +112,7 @@ public class Config { JNIdc.subdivide(Config.subdivide ? 1 : 0); JNIdc.frameskip(Config.frameskip); JNIdc.pvrrender(Config.pvrrender ? 1 : 0); + JNIdc.usereios(Config.usereios ? 1 : 0); JNIdc.cheatdisk(Config.cheatdisk); JNIdc.dreamtime(DreamTime.getDreamtime()); } diff --git a/shell/android/src/com/reicast/emulator/config/OptionsFragment.java b/shell/android/src/com/reicast/emulator/config/OptionsFragment.java index e731fd0d6..eace4651b 100644 --- a/shell/android/src/com/reicast/emulator/config/OptionsFragment.java +++ b/shell/android/src/com/reicast/emulator/config/OptionsFragment.java @@ -152,6 +152,18 @@ public class OptionsFragment extends Fragment { } }); + OnCheckedChangeListener reios_options = new OnCheckedChangeListener() { + + public void onCheckedChanged(CompoundButton buttonView, + boolean isChecked) { + mPrefs.edit().putBoolean(Config.pref_usereios, isChecked).commit(); + } + }; + Switch reios_opt = (Switch) getView().findViewById( + R.id.reios_option); + reios_opt.setChecked(mPrefs.getBoolean(Config.pref_usereios, false)); + reios_opt.setOnCheckedChangeListener(reios_options); + OnCheckedChangeListener details_options = new OnCheckedChangeListener() { public void onCheckedChanged(CompoundButton buttonView, @@ -379,10 +391,10 @@ public class OptionsFragment extends Fragment { stretch_view.setChecked(Config.widescreen); stretch_view.setOnCheckedChangeListener(full_screen); - final TextView mainFrames = (TextView) getView().findViewById(R.id.current_frames); + final EditText mainFrames = (EditText) getView().findViewById(R.id.current_frames); mainFrames.setText(String.valueOf(Config.frameskip)); - SeekBar frameSeek = (SeekBar) getView().findViewById(R.id.frame_seekbar); + final SeekBar frameSeek = (SeekBar) getView().findViewById(R.id.frame_seekbar); frameSeek.setProgress(Config.frameskip); frameSeek.setIndeterminate(false); frameSeek.setOnSeekBarChangeListener(new OnSeekBarChangeListener() { @@ -400,6 +412,23 @@ public class OptionsFragment extends Fragment { Config.frameskip = progress; } }); + mainFrames.addTextChangedListener(new TextWatcher() { + public void afterTextChanged(Editable s) { + String frameText = mainFrames.getText().toString(); + if (frameText != null) { + int frames = Integer.parseInt(frameText); + frameSeek.setProgress(frames); + mPrefs.edit().putInt(Config.pref_frameskip, frames).commit(); + Config.frameskip = frames; + } + } + + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + } + + public void onTextChanged(CharSequence s, int start, int before, int count) { + } + }); OnCheckedChangeListener pvr_rendering = new OnCheckedChangeListener() { diff --git a/shell/android/src/com/reicast/emulator/emu/JNIdc.java b/shell/android/src/com/reicast/emulator/emu/JNIdc.java index d6888dd89..852efe09c 100644 --- a/shell/android/src/com/reicast/emulator/emu/JNIdc.java +++ b/shell/android/src/com/reicast/emulator/emu/JNIdc.java @@ -42,6 +42,7 @@ public final class JNIdc public static native void frameskip(int frames); public static native void pvrrender(int render); public static native void cheatdisk(String disk); + public static native void usereios(int reios); public static native void dreamtime(long clock); public static void show_osd() {