From 832570c6584961a0ce541f376162647c35d8d8ef Mon Sep 17 00:00:00 2001 From: Martino Fontana Date: Sat, 26 Apr 2025 19:42:11 +0200 Subject: Core: Add VBI Frequency Override This feature allows overriding the frequency of the Vertical Blank Interrupt. For many games, this means that their gameplay speed will change without affecting audio, which would be useful by itself (e.g. grinding in RPGs). However, there are games that use delta time for their game logic, which allows them to be played at >60 FPS at the same gameplay speed! Some games aren't dynamic though, and require a patch to adjust their game speed variable. --- .../features/settings/model/BooleanSetting.kt | 6 ++++++ .../features/settings/model/FloatSetting.kt | 1 + .../settings/ui/SettingsFragmentPresenter.kt | 21 +++++++++++++++++++++ 3 files changed, 28 insertions(+) (limited to 'Source/Android/app/src/main/java') diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/BooleanSetting.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/BooleanSetting.kt index afe48b86d7..d074c16fff 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/BooleanSetting.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/BooleanSetting.kt @@ -100,6 +100,12 @@ enum class BooleanSetting( "OverclockEnable", false ), + MAIN_VI_OVERCLOCK_ENABLE( + Settings.FILE_DOLPHIN, + Settings.SECTION_INI_CORE, + "VIOverclockEnable", + false + ), MAIN_RAM_OVERRIDE_ENABLE( Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/FloatSetting.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/FloatSetting.kt index ec5bda11cc..d6e6be05c4 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/FloatSetting.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/FloatSetting.kt @@ -11,6 +11,7 @@ enum class FloatSetting( // These entries have the same names and order as in C++, just for consistency. MAIN_EMULATION_SPEED(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "EmulationSpeed", 1.0f), MAIN_OVERCLOCK(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "Overclock", 1.0f), + MAIN_VI_OVERCLOCK(Settings.FILE_DOLPHIN, Settings.SECTION_INI_CORE, "VIOverclock", 1.0f), GFX_CC_GAME_GAMMA(Settings.FILE_GFX, Settings.SECTION_GFX_COLOR_CORRECTION, "GameGamma", 2.35f); override val isOverridden: Boolean diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.kt index e584e0a2ff..73a94cb66e 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.kt @@ -1027,6 +1027,27 @@ class SettingsFragmentPresenter( false ) ) + sl.add( + SwitchSetting( + context, + BooleanSetting.MAIN_VI_OVERCLOCK_ENABLE, + R.string.vi_overclock_enable, + R.string.vi_overclock_enable_description + ) + ) + sl.add( + PercentSliderSetting( + context, + FloatSetting.MAIN_VI_OVERCLOCK, + R.string.vi_overclock_title, + R.string.vi_overclock_title_description, + 0f, + 500f, + "%", + 1f, + false + ) + ) val mem1Size = ScaledIntSetting(1024 * 1024, IntSetting.MAIN_MEM1_SIZE) val mem2Size = ScaledIntSetting(1024 * 1024, IntSetting.MAIN_MEM2_SIZE) -- cgit v1.2.3