diff --git a/core/nullDC.cpp b/core/nullDC.cpp index 00309250c..e70d9220a 100755 --- a/core/nullDC.cpp +++ b/core/nullDC.cpp @@ -294,6 +294,7 @@ void LoadSettings() settings.dreamcast.RTC = cfgLoadInt("config", "Dreamcast.RTC", GetRTC_now()); settings.dreamcast.region = cfgLoadInt("config", "Dreamcast.Region", 3); settings.dreamcast.broadcast = cfgLoadInt("config", "Dreamcast.Broadcast", 4); + settings.dreamcast.rttOption = cfgLoadInt("config", "Dreamcast.Rtt", 0); settings.aica.LimitFPS = cfgLoadInt("config", "aica.LimitFPS", 1); settings.aica.NoBatch = cfgLoadInt("config", "aica.NoBatch", 0); settings.aica.NoSound = cfgLoadInt("config", "aica.NoSound", 0); @@ -377,4 +378,5 @@ void SaveSettings() cfgSaveInt("config","Dreamcast.RTC", settings.dreamcast.RTC); cfgSaveInt("config","Dreamcast.Region", settings.dreamcast.region); cfgSaveInt("config","Dreamcast.Broadcast", settings.dreamcast.broadcast); + cfgSaveInt("config","Dreamcast.Rtt", settings.dreamcast.rttOption); } diff --git a/core/rend/gles/gles.cpp b/core/rend/gles/gles.cpp index e7bb861c4..f978e698a 100755 --- a/core/rend/gles/gles.cpp +++ b/core/rend/gles/gles.cpp @@ -1,4 +1,5 @@ #include +#include #include "gles.h" #include "rend/TexCache.h" #include "cfg/cfg.h" @@ -1779,6 +1780,8 @@ bool RenderFrame() #endif } + printf("RTT option: %d", settings.dreamcast.rttOption); + //Clear depth //Color is cleared by the bgp if (settings.rend.WideScreen) diff --git a/core/types.h b/core/types.h index dadb01cab..bc91bea78 100644 --- a/core/types.h +++ b/core/types.h @@ -640,6 +640,7 @@ struct settings_t u32 RTC; u32 region; u32 broadcast; + u32 rttOption; } dreamcast; struct diff --git a/shell/android-studio/reicast/src/main/java/com/reicast/emulator/Emulator.java b/shell/android-studio/reicast/src/main/java/com/reicast/emulator/Emulator.java index 1f005bb76..52c555b53 100644 --- a/shell/android-studio/reicast/src/main/java/com/reicast/emulator/Emulator.java +++ b/shell/android-studio/reicast/src/main/java/com/reicast/emulator/Emulator.java @@ -16,6 +16,7 @@ public class Emulator extends Application { public static final String pref_cable = "dc_cable"; public static final String pref_dcregion = "dc_region"; public static final String pref_broadcast = "dc_broadcast"; + public static final String pref_rtt = "dc_rtt"; public static final String pref_limitfps = "limit_fps"; public static final String pref_nosound = "sound_disabled"; public static final String pref_mipmaps = "use_mipmaps"; @@ -34,6 +35,7 @@ public class Emulator extends Application { public static int cable = 3; public static int dcregion = 3; public static int broadcast = 4; + public static int rtt = 3; public static boolean limitfps = true; public static boolean nobatch = false; public static boolean nosound = false; @@ -57,6 +59,7 @@ public class Emulator extends Application { Emulator.cable = mPrefs.getInt(pref_cable, cable); Emulator.dcregion = mPrefs.getInt(pref_dcregion, dcregion); Emulator.broadcast = mPrefs.getInt(pref_broadcast, broadcast); + Emulator.rtt = mPrefs.getInt(pref_rtt, rtt); Emulator.limitfps = mPrefs.getBoolean(pref_limitfps, limitfps); Emulator.nosound = mPrefs.getBoolean(pref_nosound, nosound); Emulator.mipmaps = mPrefs.getBoolean(pref_mipmaps, mipmaps); @@ -80,6 +83,7 @@ public class Emulator extends Application { JNIdc.cable(Emulator.cable); JNIdc.region(Emulator.dcregion); JNIdc.broadcast(Emulator.broadcast); + JNIdc.rtt(Emulator.rtt); JNIdc.limitfps(Emulator.limitfps ? 1 : 0); JNIdc.nobatch(Emulator.nobatch ? 1 : 0); JNIdc.nosound(Emulator.nosound ? 1 : 0); diff --git a/shell/android-studio/reicast/src/main/java/com/reicast/emulator/config/OptionsFragment.java b/shell/android-studio/reicast/src/main/java/com/reicast/emulator/config/OptionsFragment.java index c5e4c40ed..07e2d1c84 100644 --- a/shell/android-studio/reicast/src/main/java/com/reicast/emulator/config/OptionsFragment.java +++ b/shell/android-studio/reicast/src/main/java/com/reicast/emulator/config/OptionsFragment.java @@ -378,6 +378,24 @@ public class OptionsFragment extends Fragment { } }); + //---------------------------------------- + String[] rtts = getResources().getStringArray(R.array.rtt); + Spinner rtt_spnr = (Spinner) getView().findViewById(R.id.rtt_spinner); + ArrayAdapter rttAdapter = new ArrayAdapter<>( + getActivity(), R.layout.spinner_selected, rtts); + rttAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + rtt_spnr.setAdapter(rttAdapter); + rtt_spnr.setSelection(mPrefs.getInt(Emulator.pref_rtt, Emulator.rtt), true); + rtt_spnr.setOnItemSelectedListener(new OnItemSelectedListener() { + public void onItemSelected(AdapterView parent, View view, int pos, long id) { + mPrefs.edit().putInt(Emulator.pref_rtt, pos).apply(); + } + + public void onNothingSelected(AdapterView arg0) { + } + }); +//---------------------------------------- + OnCheckedChangeListener limitfps_option = new OnCheckedChangeListener() { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { @@ -711,6 +729,7 @@ public class OptionsFragment extends Fragment { mPrefs.edit().remove(Emulator.pref_cable).apply(); mPrefs.edit().remove(Emulator.pref_dcregion).apply(); mPrefs.edit().remove(Emulator.pref_broadcast).apply(); + mPrefs.edit().remove(Emulator.pref_rtt).apply(); mPrefs.edit().remove(Emulator.pref_limitfps).apply(); mPrefs.edit().remove(Emulator.pref_mipmaps).apply(); mPrefs.edit().remove(Emulator.pref_widescreen).apply(); @@ -730,6 +749,7 @@ public class OptionsFragment extends Fragment { Emulator.cable = 3; Emulator.dcregion = 3; Emulator.broadcast = 4; + Emulator.rtt = 3; Emulator.limitfps = true; Emulator.mipmaps = true; Emulator.widescreen = false; diff --git a/shell/android-studio/reicast/src/main/java/com/reicast/emulator/emu/JNIdc.java b/shell/android-studio/reicast/src/main/java/com/reicast/emulator/emu/JNIdc.java index ec8c5604c..d6327069a 100644 --- a/shell/android-studio/reicast/src/main/java/com/reicast/emulator/emu/JNIdc.java +++ b/shell/android-studio/reicast/src/main/java/com/reicast/emulator/emu/JNIdc.java @@ -36,6 +36,7 @@ public final class JNIdc public static native void cable(int cable); public static native void region(int region); public static native void broadcast(int broadcast); + public static native void rtt(int rtt); public static native void limitfps(int limiter); public static native void nobatch(int nobatch); public static native void nosound(int noaudio); diff --git a/shell/android-studio/reicast/src/main/jni/src/Android.cpp b/shell/android-studio/reicast/src/main/jni/src/Android.cpp index de4ef695f..deccebceb 100644 --- a/shell/android-studio/reicast/src/main/jni/src/Android.cpp +++ b/shell/android-studio/reicast/src/main/jni/src/Android.cpp @@ -52,6 +52,7 @@ JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_safemode(JNIEnv *env, JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_cable(JNIEnv *env,jobject obj, jint cable) __attribute__((visibility("default"))); JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_region(JNIEnv *env,jobject obj, jint region) __attribute__((visibility("default"))); JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_broadcast(JNIEnv *env,jobject obj, jint broadcast) __attribute__((visibility("default"))); +JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_rtt(JNIEnv *env,jobject obj, jint rtt) __attribute__((visibility("default"))); JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_limitfps(JNIEnv *env,jobject obj, jint limiter) __attribute__((visibility("default"))); JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_nobatch(JNIEnv *env,jobject obj, jint nobatch) __attribute__((visibility("default"))); JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_nosound(JNIEnv *env,jobject obj, jint noaudio) __attribute__((visibility("default"))); @@ -102,6 +103,12 @@ JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_broadcast(JNIEnv *env settings.dreamcast.broadcast = broadcast; } +JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_rtt(JNIEnv *env,jobject obj, jint rtt) +{ + settings.dreamcast.rttOption = rtt; +} + + JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_limitfps(JNIEnv *env,jobject obj, jint limiter) { settings.aica.LimitFPS = limiter; diff --git a/shell/android-studio/reicast/src/main/res/layout-v14/configure_fragment.xml b/shell/android-studio/reicast/src/main/res/layout-v14/configure_fragment.xml index 866364961..ffa7f2566 100644 --- a/shell/android-studio/reicast/src/main/res/layout-v14/configure_fragment.xml +++ b/shell/android-studio/reicast/src/main/res/layout-v14/configure_fragment.xml @@ -636,6 +636,35 @@ + + + + + + + + + + diff --git a/shell/android-studio/reicast/src/main/res/layout/configure_fragment.xml b/shell/android-studio/reicast/src/main/res/layout/configure_fragment.xml index 715a72899..aa4ec85f1 100644 --- a/shell/android-studio/reicast/src/main/res/layout/configure_fragment.xml +++ b/shell/android-studio/reicast/src/main/res/layout/configure_fragment.xml @@ -636,6 +636,35 @@ + + + + + + + + + + diff --git a/shell/android-studio/reicast/src/main/res/values-pl/strings.xml b/shell/android-studio/reicast/src/main/res/values-pl/strings.xml index 5d5e9bb2a..9007c250f 100644 --- a/shell/android-studio/reicast/src/main/res/values-pl/strings.xml +++ b/shell/android-studio/reicast/src/main/res/values-pl/strings.xml @@ -18,6 +18,7 @@ Opcje Dynarec Niestabilne optymalizacje Region DC + Renderuj do tekstury Limit FPS Użyj Mipmap (fix dla starego SGX540) Tryb Szerokoekranowy diff --git a/shell/android-studio/reicast/src/main/res/values-ru/strings.xml b/shell/android-studio/reicast/src/main/res/values-ru/strings.xml index 65cccc0a7..652383a93 100644 --- a/shell/android-studio/reicast/src/main/res/values-ru/strings.xml +++ b/shell/android-studio/reicast/src/main/res/values-ru/strings.xml @@ -38,6 +38,7 @@ Тип кабеля Регион Dreamcast Система ТВ + Рендеринг текстуры (RTT) Ограничение FPS MIP-карты (откл. для SGX540) Широкоэкранный режим diff --git a/shell/android-studio/reicast/src/main/res/values/donottranslate.xml b/shell/android-studio/reicast/src/main/res/values/donottranslate.xml index 72e64ba77..805954e77 100644 --- a/shell/android-studio/reicast/src/main/res/values/donottranslate.xml +++ b/shell/android-studio/reicast/src/main/res/values/donottranslate.xml @@ -61,6 +61,14 @@ 9 - PAL-E + + Disabled - skip frames + Zeros + Ones + Shadow circle + Full + + J E diff --git a/shell/android-studio/reicast/src/main/res/values/strings.xml b/shell/android-studio/reicast/src/main/res/values/strings.xml index 22620e428..a2eb11513 100644 --- a/shell/android-studio/reicast/src/main/res/values/strings.xml +++ b/shell/android-studio/reicast/src/main/res/values/strings.xml @@ -42,6 +42,7 @@ Cable Type DC Region Broadcast + Render to texture Limit FPS Use Mipmaps (fixes SGX540) Widescreen Mode