Qt: More overclock options.

This commit is contained in:
BearOso 2023-09-02 16:07:16 -05:00
parent 6555feecda
commit cf49325555
5 changed files with 65 additions and 28 deletions

View File

@ -278,7 +278,7 @@ bool EmuConfig::setDefaults(int section)
allow_invalid_vram_access = false; allow_invalid_vram_access = false;
allow_opposing_dpad_directions = false; allow_opposing_dpad_directions = false;
overclock = false; overclock = eNoOverclock;
remove_sprite_limit = false; remove_sprite_limit = false;
enable_shadow_buffer = false; enable_shadow_buffer = false;
superfx_clock_multiplier = 100; superfx_clock_multiplier = 100;
@ -489,7 +489,7 @@ void EmuConfig::config(std::string filename, bool write)
Int("RewindFrameInterval", rewind_frame_interval); Int("RewindFrameInterval", rewind_frame_interval);
Bool("AllowInvalidVRAMAccess", allow_invalid_vram_access); Bool("AllowInvalidVRAMAccess", allow_invalid_vram_access);
Bool("AllowOpposingDpadDirections", allow_opposing_dpad_directions); Bool("AllowOpposingDpadDirections", allow_opposing_dpad_directions);
Bool("Overclock", overclock); Int("Overclock", overclock);
Bool("RemoveSpriteLimit", remove_sprite_limit); Bool("RemoveSpriteLimit", remove_sprite_limit);
Bool("EnableShadowBuffer", enable_shadow_buffer); Bool("EnableShadowBuffer", enable_shadow_buffer);
Int("SuperFXClockMultiplier", superfx_clock_multiplier); Int("SuperFXClockMultiplier", superfx_clock_multiplier);

View File

@ -116,7 +116,14 @@ struct EmuConfig
bool allow_invalid_vram_access; bool allow_invalid_vram_access;
bool allow_opposing_dpad_directions; bool allow_opposing_dpad_directions;
bool overclock; enum Overclock
{
eNoOverclock = 0,
eAutoFastROM = 1,
eLow = 2,
eHigh = 3
};
int overclock;
bool remove_sprite_limit; bool remove_sprite_limit;
bool enable_shadow_buffer; bool enable_shadow_buffer;
int superfx_clock_multiplier; int superfx_clock_multiplier;

View File

@ -36,7 +36,7 @@ EmulationPanel::EmulationPanel(EmuApplication *app_)
connect_checkbox(checkBox_allow_invalid_vram_access, &app->config->allow_invalid_vram_access); connect_checkbox(checkBox_allow_invalid_vram_access, &app->config->allow_invalid_vram_access);
connect_checkbox(checkBox_allow_opposing_dpad_directions, &app->config->allow_opposing_dpad_directions); connect_checkbox(checkBox_allow_opposing_dpad_directions, &app->config->allow_opposing_dpad_directions);
connect_checkbox(checkBox_overclock, &app->config->overclock); connect_combo(comboBox_overclock, &app->config->overclock);
connect_checkbox(checkBox_remove_sprite_limit, &app->config->remove_sprite_limit); connect_checkbox(checkBox_remove_sprite_limit, &app->config->remove_sprite_limit);
connect_checkbox(checkBox_use_shadow_echo_buffer, &app->config->enable_shadow_buffer); connect_checkbox(checkBox_use_shadow_echo_buffer, &app->config->enable_shadow_buffer);
connect_spin(spinBox_superfx_clock_speed, &app->config->superfx_clock_multiplier); connect_spin(spinBox_superfx_clock_speed, &app->config->superfx_clock_multiplier);
@ -59,7 +59,7 @@ void EmulationPanel::showEvent(QShowEvent *event)
checkBox_allow_invalid_vram_access->setChecked(config->allow_invalid_vram_access); checkBox_allow_invalid_vram_access->setChecked(config->allow_invalid_vram_access);
checkBox_allow_opposing_dpad_directions->setChecked(config->allow_opposing_dpad_directions); checkBox_allow_opposing_dpad_directions->setChecked(config->allow_opposing_dpad_directions);
checkBox_overclock->setChecked(config->overclock); comboBox_overclock->setCurrentIndex(config->overclock);
checkBox_remove_sprite_limit->setChecked(config->remove_sprite_limit); checkBox_remove_sprite_limit->setChecked(config->remove_sprite_limit);
checkBox_use_shadow_echo_buffer->setChecked(config->enable_shadow_buffer); checkBox_use_shadow_echo_buffer->setChecked(config->enable_shadow_buffer);
spinBox_superfx_clock_speed->setValue(config->superfx_clock_multiplier); spinBox_superfx_clock_speed->setValue(config->superfx_clock_multiplier);

View File

@ -248,16 +248,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkBox_overclock">
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Decrease the time it takes for the CPU to perform operations, making it faster. This can remove slowdown, but can also cause glitches in many games.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Overclock the CPU</string>
</property>
</widget>
</item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QCheckBox" name="checkBox_use_shadow_echo_buffer"> <widget class="QCheckBox" name="checkBox_use_shadow_echo_buffer">
<property name="whatsThis"> <property name="whatsThis">
@ -278,7 +268,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="2" column="1">
<widget class="QCheckBox" name="checkBox_remove_sprite_limit"> <widget class="QCheckBox" name="checkBox_remove_sprite_limit">
<property name="whatsThis"> <property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Allows more sprites to be displayed on the screen in an attempt to remove flickering.&lt;/p&gt;&lt;p&gt;Some games take advantage of this limit and use it to hide glitches, and removing the limit will make those visible.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Allows more sprites to be displayed on the screen in an attempt to remove flickering.&lt;/p&gt;&lt;p&gt;Some games take advantage of this limit and use it to hide glitches, and removing the limit will make those visible.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
@ -392,6 +382,54 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label_9">
<property name="text">
<string>Overclock:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_overclock">
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>Auto-FastROM</string>
</property>
</item>
<item>
<property name="text">
<string>Low</string>
</property>
</item>
<item>
<property name="text">
<string>High</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>

View File

@ -174,18 +174,10 @@ void Snes9xController::updateSettings(const EmuConfig * const config)
else else
Settings.MaxSpriteTilesPerLine = 34; Settings.MaxSpriteTilesPerLine = 34;
if (!config->overclock) const int overclock_cycles[4][2] = { { 6, 8 }, { 6, 6 }, { 3, 4 }, { 1, 1 } };
{ Settings.OneClockCycle = overclock_cycles[config->overclock][0];
Settings.OneClockCycle = 6; Settings.OneSlowClockCycle = overclock_cycles[config->overclock][1];
Settings.OneSlowClockCycle = 8; Settings.TwoClockCycles = overclock_cycles[config->overclock][0] * 2;
Settings.TwoClockCycles = 12;
}
else
{
Settings.OneClockCycle = 2;
Settings.OneSlowClockCycle = 3;
Settings.TwoClockCycles = 4;
}
Settings.ShowOverscan = config->show_overscan; Settings.ShowOverscan = config->show_overscan;