Skip to content

Manic EMU is an all-in-one retro game emulator for iOS. It packs powerful features while keeping a clean, sleek UI and delivering buttery-smooth gameplay.

Swift

Re-fix the flycast jitless speed issue

Daiuno1fe0cf9982a5
diff --git a/Dependencies/Libretro b/Dependencies/Libretro
index 0cf1033a..ca529bc7 160000
--- a/Dependencies/Libretro
+++ b/Dependencies/Libretro
@@ -1 +1 @@
-Subproject commit 0cf1033ae6c1cea50fba00d00cea6a67ca91bc56
+Subproject commit ca529bc7d0180a4f9202198d53dde0f68ff845c8
diff --git a/ManicEmu/ManicEmu/Sources/Business/GameInfo/Models/SpecialCoreOption.swift b/ManicEmu/ManicEmu/Sources/Business/GameInfo/Models/SpecialCoreOption.swift
index 14f2c366..90c07172 100644
--- a/ManicEmu/ManicEmu/Sources/Business/GameInfo/Models/SpecialCoreOption.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/GameInfo/Models/SpecialCoreOption.swift
@@ -123,6 +123,7 @@ enum SpecialCoreOption: String {
case reicast_renderer
case reicast_threaded_rendering
case reicast_dynamic_cpu_ratio
+ case reicast_sh4clock
//arcade
case mame_cheats_enable
//isAzahar3DS
diff --git a/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift b/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift
index 4a7447a8..7f5aa4f1 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift
@@ -2213,7 +2213,11 @@ extension PlayViewController {
updateLibretroCoreConfigs(core: .Flycast, configs: [
.reicast_language : R.Strings.DCConsoleLanguage[manicGame.region],
.reicast_threaded_rendering: isJitlessFlycast ? "disabled" : "enabled",
- .reicast_dynamic_cpu_ratio: "disabled"
+ .reicast_dynamic_cpu_ratio: "disabled",
+ // Jitless starves the guest CPU, so it skips rendering and packs 2-3 guest
+ // frames into one retro_run. Overclocking buys the guest enough cycles to
+ // present every frame, which keeps the frontend's pacing quantum at 1.
+ .reicast_sh4clock: isJitlessFlycast ? "300" : "200"
])
LibretroCore.sharedInstance().setLibretroLogMonitor(true)
if manicGame.gameType == .arcade {
@@ -2349,8 +2353,7 @@ extension PlayViewController {
// Jitless Flycast underruns below 90ms; 90 is the floor that still boots smoothly.
"audio_latency": isJitlessFlycast ? "90" : "200",
"audio_sync": "true",
- "input_auto_game_focus": "1",
- "vrr_runloop_enable": isJitlessFlycast ? "true" : "false"
+ "input_auto_game_focus": "1"
])
if manicGame.isN64ParaLLEl {
LibretroCore.sharedInstance().setReloadDelay(1)
@@ -3055,7 +3058,6 @@ extension PlayViewController {
}
self.updateDualScreenViews()
LibretroCore.sharedInstance().setCustomSaveExtension(customSaveExtension)
- applyLibretroFrontendRuntimeConfigs()
if self.manicGame.isNDSHomeMenuGame || self.manicGame.isDSiHomeMenuGame || self.manicGame.isDOSHomeMenuGame {
LibretroCore.sharedInstance().loadWithoutContent(corePath)
} else {
@@ -4359,16 +4361,6 @@ extension PlayViewController {
})
}
- /// Apply frontend pacing before loadGame so this session (not just the next) picks them up.
- /// Jitless Flycast needs VRR on iOS; latency below 90ms underruns during boot.
- private func applyLibretroFrontendRuntimeConfigs() {
- LibretroCore.sharedInstance().updateRuningLibretroConfigs([
- "audio_latency": isJitlessFlycast ? "90" : "200",
- "audio_sync": "true",
- "vrr_runloop_enable": isJitlessFlycast ? "true" : "false"
- ])
- }
-
private func updateLibretroCoreConfigs(core: EmulationCore,
configs: [SpecialCoreOption: String],
reload: Bool = false,