Android: Add CPU overclocking option

This commit is contained in:
Connor McLaughlin 2020-11-03 22:58:13 +10:00
parent 2388662cc5
commit 8816c5048d
3 changed files with 63 additions and 0 deletions

View File

@ -175,6 +175,13 @@ void AndroidHostInterface::LoadAndConvertSettings()
const std::string msaa_str = m_settings_interface.GetStringValue("GPU", "MSAA", "1");
g_settings.gpu_multisamples = std::max<u32>(StringUtil::FromChars<u32>(msaa_str).value_or(1), 1);
g_settings.gpu_per_sample_shading = StringUtil::EndsWith(msaa_str, "-ssaa");
// turn percentage into fraction for overclock
const u32 overclock_percent = static_cast<u32>(std::max(m_settings_interface.GetIntValue("CPU", "Overclock", 100), 1));
Settings::CPUOverclockPercentToFraction(overclock_percent, &g_settings.cpu_overclock_numerator,
&g_settings.cpu_overclock_denominator);
g_settings.cpu_overclock_enable = (overclock_percent != 100);
g_settings.UpdateOverclockActive();
}
void AndroidHostInterface::UpdateInputMap()

View File

@ -339,4 +339,52 @@
<item>9.0</item>
<item>10.0</item>
</string-array>
<string-array name="settings_advanced_cpu_overclock_entries">
<item>25% (8MHz)</item>
<item>50% (16MHz)</item>
<item>75% (24MHz)</item>
<item>100% (33MHz, Default)</item>
<item>125% (41MHz)</item>
<item>150% (49MHz)</item>
<item>175% (57MHz)</item>
<item>200% (66MHz)</item>
<item>225% (74MHz)</item>
<item>250% (82MHz)</item>
<item>275% (90MHz)</item>
<item>300% (99MHz)</item>
<item>350% (115MHz)</item>
<item>400% (132MHz)</item>
<item>450% (148MHz)</item>
<item>500% (165MHz)</item>
<item>500% (165MHz)</item>
<item>600% (198MHz)</item>
<item>700% (231MHz)</item>
<item>800% (264MHz)</item>
<item>900% (297MHz)</item>
<item>1000% (330MHz)</item>
</string-array>
<string-array name="settings_advanced_cpu_overclock_values">
<item>25</item>
<item>50</item>
<item>75</item>
<item>100</item>
<item>125</item>
<item>150</item>
<item>175</item>
<item>200</item>
<item>225</item>
<item>250</item>
<item>275</item>
<item>300</item>
<item>350</item>
<item>400</item>
<item>450</item>
<item>500</item>
<item>500</item>
<item>600</item>
<item>700</item>
<item>800</item>
<item>900</item>
<item>1000</item>
</string-array>
</resources>

View File

@ -16,6 +16,14 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ListPreference
app:key="CPU/Overclock"
app:title="CPU Overclocking"
app:defaultValue="100"
app:entries="@array/settings_advanced_cpu_overclock_entries"
app:entryValues="@array/settings_advanced_cpu_overclock_values"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="CDROM/RegionCheck"
app:title="CD-ROM Region Check"