Add SuperFX overclock multiplier setting.

Our speed isn't nearly correct, so letting the users adjust it is OK.
This commit is contained in:
Brandon Wright 2018-05-07 17:03:06 -05:00
parent 39601dd174
commit fdae8cc72f
6 changed files with 63 additions and 3 deletions

View File

@ -329,7 +329,7 @@ void S9xSuperFXExec (void)
{ {
if ((Memory.FillRAM[0x3000 + GSU_SFR] & FLG_G) && (Memory.FillRAM[0x3000 + GSU_SCMR] & 0x18) == 0x18) if ((Memory.FillRAM[0x3000 + GSU_SFR] & FLG_G) && (Memory.FillRAM[0x3000 + GSU_SCMR] & 0x18) == 0x18)
{ {
FxEmulate((Memory.FillRAM[0x3000 + GSU_CLSR] & 1) ? SuperFX.speedPerLine * 2 : SuperFX.speedPerLine); FxEmulate(((Memory.FillRAM[0x3000 + GSU_CLSR] & 1) ? SuperFX.speedPerLine * 2 : SuperFX.speedPerLine) * Settings.SuperFXClockMultiplier / 100);
uint16 GSUStatus = Memory.FillRAM[0x3000 + GSU_SFR] | (Memory.FillRAM[0x3000 + GSU_SFR + 1] << 8); uint16 GSUStatus = Memory.FillRAM[0x3000 + GSU_SFR] | (Memory.FillRAM[0x3000 + GSU_SFR + 1] << 8);
if ((GSUStatus & (FLG_G | FLG_IRQ)) == FLG_IRQ) if ((GSUStatus & (FLG_G | FLG_IRQ)) == FLG_IRQ)

View File

@ -256,6 +256,7 @@ Snes9xConfig::load_defaults (void)
Settings.DynamicRateControl = FALSE; Settings.DynamicRateControl = FALSE;
Settings.DynamicRateLimit = 5; Settings.DynamicRateLimit = 5;
Settings.HDMATimingHack = 100; Settings.HDMATimingHack = 100;
Settings.SuperFXClockMultiplier = 100;
#ifdef NETPLAY_SUPPORT #ifdef NETPLAY_SUPPORT
Settings.NetPlay = FALSE; Settings.NetPlay = FALSE;
@ -415,6 +416,7 @@ Snes9xConfig::save_config_file (void)
xml_out_int (xml, "reverse_stereo", Settings.ReverseStereo); xml_out_int (xml, "reverse_stereo", Settings.ReverseStereo);
xml_out_int (xml, "playback_rate", gui_config->sound_playback_rate); xml_out_int (xml, "playback_rate", gui_config->sound_playback_rate);
xml_out_int (xml, "block_invalid_vram_access", Settings.BlockInvalidVRAMAccessMaster); xml_out_int (xml, "block_invalid_vram_access", Settings.BlockInvalidVRAMAccessMaster);
xml_out_int (xml, "superfx_clock_multiplier", Settings.SuperFXClockMultiplier);
xml_out_int (xml, "upanddown", Settings.UpAndDown); xml_out_int (xml, "upanddown", Settings.UpAndDown);
xmlTextWriterEndElement (xml); /* preferences */ xmlTextWriterEndElement (xml); /* preferences */
@ -695,6 +697,11 @@ Snes9xConfig::set_option (const char *name, const char *value)
{ {
/* Deprecated */ /* Deprecated */
} }
else if (!strcasecmp (name, "superfx_clock_multiplier"))
{
Settings.SuperFXClockMultiplier = atoi (value);
Settings.SuperFXClockMultiplier = CLAMP (Settings.SuperFXClockMultiplier, 50, 400);
}
else if (!strcasecmp (name, "speedhacks")) else if (!strcasecmp (name, "speedhacks"))
{ {
} }

View File

@ -704,6 +704,7 @@ Snes9xPreferences::move_settings_to_dialog (void)
set_spin ("dynamic_rate_limit", Settings.DynamicRateLimit / 1000.0); set_spin ("dynamic_rate_limit", Settings.DynamicRateLimit / 1000.0);
set_spin ("rewind_buffer_size", config->rewind_buffer_size); set_spin ("rewind_buffer_size", config->rewind_buffer_size);
set_spin ("rewind_granularity", config->rewind_granularity); set_spin ("rewind_granularity", config->rewind_granularity);
set_spin ("superfx_multiplier", Settings.SuperFXClockMultiplier);
int num_sound_drivers = 0; int num_sound_drivers = 0;
#ifdef USE_PORTAUDIO #ifdef USE_PORTAUDIO
@ -843,6 +844,7 @@ Snes9xPreferences::get_settings_from_dialog (void)
Settings.SkipFrames = get_combo ("frameskip_combo"); Settings.SkipFrames = get_combo ("frameskip_combo");
Settings.BlockInvalidVRAMAccessMaster = get_check ("block_invalid_vram_access"); Settings.BlockInvalidVRAMAccessMaster = get_check ("block_invalid_vram_access");
Settings.UpAndDown = get_check ("upanddown"); Settings.UpAndDown = get_check ("upanddown");
Settings.SuperFXClockMultiplier = get_spin ("superfx_multiplier");
config->sound_driver = get_combo ("sound_driver"); config->sound_driver = get_combo ("sound_driver");
Settings.Stereo = get_check ("stereo_check"); Settings.Stereo = get_check ("stereo_check");
config->sound_playback_rate = 7 - (get_combo ("playback_combo")); config->sound_playback_rate = 7 - (get_combo ("playback_combo"));

View File

@ -157,6 +157,13 @@
<property name="step_increment">0.001</property> <property name="step_increment">0.001</property>
<property name="page_increment">0.010</property> <property name="page_increment">0.010</property>
</object> </object>
<object class="GtkAdjustment" id="superfx_multiplier_adjustment">
<property name="lower">50</property>
<property name="upper">400</property>
<property name="value">100</property>
<property name="step_increment">10</property>
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment13"> <object class="GtkAdjustment" id="adjustment13">
<property name="lower">-1</property> <property name="lower">-1</property>
<property name="upper">1</property> <property name="upper">1</property>
@ -4508,6 +4515,48 @@
<property name="position">2</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkHBox" id="superfx_multiplier_hbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">10</property>
<child>
<object class="GtkLabel" id="superfx_multiplier_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">SuperFX clock speed %:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="superfx_multiplier">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
<property name="adjustment">superfx_multiplier_adjustment</property>
<property name="snap_to_ticks">True</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
<child> <child>
<object class="GtkHBox" id="rewind_buffer_hbox"> <object class="GtkHBox" id="rewind_buffer_hbox">
<property name="visible">True</property> <property name="visible">True</property>
@ -4547,7 +4596,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
<property name="position">3</property> <property name="position">4</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -4589,7 +4638,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
<property name="position">4</property> <property name="position">5</property>
</packing> </packing>
</child> </child>
</object> </object>

View File

@ -484,6 +484,7 @@ void S9xLoadConfigFiles (char **argv, int argc)
parse_crosshair_spec(X_JUSTIFIER2, conf.GetString("Controls::Justifier2Crosshair")); parse_crosshair_spec(X_JUSTIFIER2, conf.GetString("Controls::Justifier2Crosshair"));
// Hack // Hack
Settings.SuperFXClockMultiplier = conf.GetUInt("Hack::SuperFXClockMultiplier", 100);
Settings.DisableGameSpecificHacks = !conf.GetBool("Hack::EnableGameSpecificHacks", true); Settings.DisableGameSpecificHacks = !conf.GetBool("Hack::EnableGameSpecificHacks", true);
Settings.BlockInvalidVRAMAccessMaster = !conf.GetBool("Hack::AllowInvalidVRAMAccess", false); Settings.BlockInvalidVRAMAccessMaster = !conf.GetBool("Hack::AllowInvalidVRAMAccess", false);

View File

@ -467,6 +467,7 @@ struct SSettings
bool8 UpAndDown; bool8 UpAndDown;
bool8 OpenGLEnable; bool8 OpenGLEnable;
uint32 SuperFXClockMultiplier;
}; };
struct SSNESGameFixes struct SSNESGameFixes