PGC: Settings that should be per-game exclusive

This commit is contained in:
Ender's Games 2018-08-27 06:09:53 -04:00
parent cbe7238986
commit 25919cce78
5 changed files with 5 additions and 207 deletions

View File

@ -289,7 +289,6 @@ void LoadSettings()
settings.dynarec.Enable = cfgLoadInt("config", "Dynarec.Enabled", 1) != 0;
settings.dynarec.idleskip = cfgLoadInt("config", "Dynarec.idleskip", 1) != 0;
settings.dynarec.unstable_opt = cfgLoadInt("config", "Dynarec.unstable-opt", 0);
settings.dynarec.safemode = cfgLoadInt("config", "Dynarec.safemode", 0);
//disable_nvmem can't be loaded, because nvmem init is before cfg load
settings.dreamcast.cable = cfgLoadInt("config", "Dreamcast.Cable", 3);
settings.dreamcast.RTC = cfgLoadInt("config", "Dreamcast.RTC", GetRTC_now());
@ -298,10 +297,8 @@ void LoadSettings()
settings.aica.LimitFPS = cfgLoadInt("config", "aica.LimitFPS", 1);
settings.aica.NoBatch = cfgLoadInt("config", "aica.NoBatch", 0);
settings.aica.NoSound = cfgLoadInt("config", "aica.NoSound", 0);
settings.aica.DelayInterrupt = cfgLoadInt("config", "aica.DelayInterrupt", 0);
settings.rend.UseMipmaps = cfgLoadInt("config", "rend.UseMipmaps", 1);
settings.rend.WideScreen = cfgLoadInt("config", "rend.WideScreen", 0);
settings.rend.ModifierVolumes = cfgLoadInt("config", "rend.ModifierVolumes", 1);
settings.rend.Clipping = cfgLoadInt("config", "rend.Clipping", 1);
settings.pvr.subdivide_transp = cfgLoadInt("config", "pvr.Subdivide", 0);
@ -318,6 +315,11 @@ void LoadSettings()
settings.reios.ElfFile = cfgLoadStr("reios", "ElfFile", "");
settings.validate.OpenGlChecks = cfgLoadInt("validate", "OpenGlChecks", 0) != 0;
// Configured on a per-game basis
settings.dynarec.safemode = 0;
settings.aica.DelayInterrupt = 0;
settings.rend.ModifierVolumes = 1;
#endif
settings.pvr.HashLogFile = cfgLoadStr("testing", "ta.HashLogFile", "");

View File

@ -58,19 +58,16 @@ public class Emulator extends Application {
public void getConfigurationPrefs(SharedPreferences mPrefs) {
Emulator.dynarecopt = mPrefs.getBoolean(pref_dynarecopt, dynarecopt);
Emulator.unstableopt = mPrefs.getBoolean(pref_unstable, unstableopt);
Emulator.dynsafemode = mPrefs.getBoolean(pref_dynsafemode, dynsafemode);
Emulator.cable = mPrefs.getInt(pref_cable, cable);
Emulator.dcregion = mPrefs.getInt(pref_dcregion, dcregion);
Emulator.broadcast = mPrefs.getInt(pref_broadcast, broadcast);
Emulator.limitfps = mPrefs.getBoolean(pref_limitfps, limitfps);
Emulator.nosound = mPrefs.getBoolean(pref_nosound, nosound);
Emulator.interrupt = mPrefs.getBoolean(pref_interrupt, interrupt);
Emulator.mipmaps = mPrefs.getBoolean(pref_mipmaps, mipmaps);
Emulator.widescreen = mPrefs.getBoolean(pref_widescreen, widescreen);
Emulator.frameskip = mPrefs.getInt(pref_frameskip, frameskip);
Emulator.pvrrender = mPrefs.getBoolean(pref_pvrrender, pvrrender);
Emulator.syncedrender = mPrefs.getBoolean(pref_syncedrender, syncedrender);
Emulator.modvols = mPrefs.getBoolean(pref_modvols, modvols);
Emulator.bootdisk = mPrefs.getString(pref_bootdisk, bootdisk);
Emulator.usereios = mPrefs.getBoolean(pref_usereios, usereios);
Emulator.nativeact = mPrefs.getBoolean(pref_nativeact, nativeact);

View File

@ -284,17 +284,6 @@ public class OptionsFragment extends Fragment {
unstable_opt.setChecked(mPrefs.getBoolean(Emulator.pref_unstable, Emulator.unstableopt));
unstable_opt.setOnCheckedChangeListener(unstable_option);
OnCheckedChangeListener safemode_option = new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
mPrefs.edit().putBoolean(Emulator.pref_dynsafemode, isChecked).apply();
}
};
CompoundButton safemode_opt = (CompoundButton) getView().findViewById(R.id.dynarec_safemode);
safemode_opt.setChecked(mPrefs.getBoolean(Emulator.pref_dynsafemode, Emulator.dynsafemode));
safemode_opt.setOnCheckedChangeListener(safemode_option);
String[] cables = getResources().getStringArray(R.array.cable);
Spinner cable_spnr = (Spinner) getView().findViewById(R.id.cable_spinner);
ArrayAdapter<String> cableAdapter = new ArrayAdapter<String>(
@ -455,26 +444,6 @@ public class OptionsFragment extends Fragment {
synced_render.setChecked(mPrefs.getBoolean(Emulator.pref_syncedrender, Emulator.syncedrender));
synced_render.setOnCheckedChangeListener(synchronous);
OnCheckedChangeListener mod_volumes = new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mPrefs.edit().putBoolean(Emulator.pref_modvols, isChecked).apply();
}
};
CompoundButton modifier_volumes = (CompoundButton) getView().findViewById(R.id.modvols_option);
modifier_volumes.setChecked(mPrefs.getBoolean(Emulator.pref_modvols, Emulator.modvols));
modifier_volumes.setOnCheckedChangeListener(mod_volumes);
CompoundButton interrupt_opt = (CompoundButton) getView().findViewById(R.id.interrupt_option);
OnCheckedChangeListener delayinterrupt = new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mPrefs.edit().putBoolean(Emulator.pref_interrupt, isChecked).apply();
}
};
interrupt_opt.setChecked(mPrefs.getBoolean(Emulator.pref_interrupt, false));
interrupt_opt.setOnCheckedChangeListener(delayinterrupt);
// final EditText bootdiskEdit = (EditText) getView().findViewById(R.id.boot_disk);
// String disk = Emulator.bootdisk;
// if (disk != null && disk.contains("/")) {
@ -709,7 +678,6 @@ public class OptionsFragment extends Fragment {
mPrefs.edit().remove(Emulator.pref_nativeact).apply();
mPrefs.edit().remove(Emulator.pref_dynarecopt).apply();
mPrefs.edit().remove(Emulator.pref_unstable).apply();
mPrefs.edit().remove(Emulator.pref_dynsafemode).apply();
mPrefs.edit().remove(Emulator.pref_cable).apply();
mPrefs.edit().remove(Emulator.pref_dcregion).apply();
mPrefs.edit().remove(Emulator.pref_broadcast).apply();
@ -719,7 +687,6 @@ public class OptionsFragment extends Fragment {
mPrefs.edit().remove(Emulator.pref_frameskip).apply();
mPrefs.edit().remove(Emulator.pref_pvrrender).apply();
mPrefs.edit().remove(Emulator.pref_syncedrender).apply();
mPrefs.edit().remove(Emulator.pref_modvols).apply();
// mPrefs.edit().remove(Emulator.pref_bootdisk).apply();
mPrefs.edit().remove(Config.pref_showfps).apply();
mPrefs.edit().remove(Config.pref_rendertype).apply();

View File

@ -547,34 +547,6 @@
android:focusable="true" />
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >
<TextView
android:id="@+id/safemode_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:gravity="center_vertical|left"
android:text="@string/select_safemode" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical" >
<Switch
android:id="@+id/dynarec_safemode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="10dp"
@ -747,62 +719,6 @@
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >
<TextView
android:id="@+id/modvols_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:gravity="center_vertical|left"
android:text="@string/select_modvols" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical" >
<Switch
android:id="@+id/modvols_option"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >
<TextView
android:id="@+id/interrupt_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:gravity="center_vertical|left"
android:text="@string/select_interrupt" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical" >
<Switch
android:id="@+id/interrupt_option"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->

View File

@ -547,34 +547,6 @@
android:focusable="true" />
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >
<TextView
android:id="@+id/safemode_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:gravity="center_vertical|left"
android:text="@string/select_safemode" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical" >
<Checkbox
android:id="@+id/dynarec_safemode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="10dp"
@ -747,62 +719,6 @@
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >
<TextView
android:id="@+id/modvols_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:gravity="center_vertical|left"
android:text="@string/select_modvols" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical" >
<Checkbox
android:id="@+id/modvols_option"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >
<TextView
android:id="@+id/interrupt_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:gravity="center_vertical|left"
android:text="@string/select_interrupt" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical" >
<Checkbox
android:id="@+id/interrupt_option"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->