mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-27 18:52:11 -04:00
launcher: add Turbo loads toggle (Settings, default off)
Exposes turbo-through-loads as a launcher Settings option instead of a game.toml-only knob. Turbo runs the guest unpaced + mutes audio while the CD data stream is active (faster loads, but a brief audio cut/fade). Now defaults OFF so loads play at natural 60fps with continuous audio (disc_speed=instant already keeps data delivery fast); users opt into turbo via the launcher. Wired through the full settings chain, mirroring auto_skip_fmv: UserSettings turbo_loads/has_turbo_loads, settings.toml read+write, runtime override/seed/ apply over game.toml [runtime] turbo_loads, launcher data-model + toggle event, and the RML row. Runtime/launcher only — no regen, codegen unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -757,6 +757,9 @@ UserSettings load_user_settings(const fs::path& path) {
|
||||
if (v.contains("auto_skip_fmv")) try_get([&]{
|
||||
s.auto_skip_fmv = toml::find<bool>(v, "auto_skip_fmv"); s.has_auto_skip_fmv = true;
|
||||
});
|
||||
if (v.contains("turbo_loads")) try_get([&]{
|
||||
s.turbo_loads = toml::find<bool>(v, "turbo_loads"); s.has_turbo_loads = true;
|
||||
});
|
||||
if (v.contains("low_latency_input")) try_get([&]{
|
||||
s.low_latency_input = toml::find<bool>(v, "low_latency_input");
|
||||
s.has_low_latency_input = true;
|
||||
@@ -900,6 +903,8 @@ bool save_user_settings(const fs::path& path, const UserSettings& s) {
|
||||
}
|
||||
if (s.has_auto_skip_fmv)
|
||||
f << "auto_skip_fmv = " << (s.auto_skip_fmv ? "true" : "false") << "\n";
|
||||
if (s.has_turbo_loads)
|
||||
f << "turbo_loads = " << (s.turbo_loads ? "true" : "false") << "\n";
|
||||
if (s.has_low_latency_input)
|
||||
f << "low_latency_input = " << (s.low_latency_input ? "true" : "false") << "\n";
|
||||
if (s.has_vsync)
|
||||
|
||||
@@ -381,6 +381,11 @@ struct UserSettings {
|
||||
bool has_texture_filter = false; int texture_filter = 0; // 0=nearest,1=bilinear
|
||||
bool has_screen_kind = false; int screen_kind = 0; // 0..3 (ScreenKind)
|
||||
bool has_auto_skip_fmv = false; bool auto_skip_fmv = false; // skip FMVs
|
||||
// Turbo through in-game load screens: run the guest unpaced (host speed) +
|
||||
// mute audio while the CD data stream is active. Faster loads, but the audio
|
||||
// briefly cuts/fades. Ships OFF (default) so loads play at natural speed with
|
||||
// continuous audio (disc_speed=instant already keeps the data delivery fast).
|
||||
bool has_turbo_loads = false; bool turbo_loads = false;
|
||||
// Low-latency present knobs. low_latency_input re-samples the pad after the
|
||||
// wall-clock pacer (just before present) so the next CPU frame reads fresh
|
||||
// input instead of input ~one frame stale (the dominant input->photon cost
|
||||
|
||||
@@ -340,6 +340,9 @@ button:hover { background-color: #232d3c; }
|
||||
<button class="toggle" data-event-click="cycle_crt"><span class="value">{{crt_label}}</span></button></span></div>
|
||||
<div class="set-row"><span class="set-lbl">Skip FMVs</span><span class="set-ctl">
|
||||
<button class="toggle" data-event-click="toggle_skip_fmv"><span class="value" data-if="auto_skip_fmv">On</span><span class="value" data-if="auto_skip_fmv == false">Off</span></button></span></div>
|
||||
<div class="set-row"><span class="set-lbl">Turbo loads</span><span class="set-ctl">
|
||||
<button class="toggle" data-event-click="toggle_turbo_loads"><span class="value" data-if="turbo_loads">On</span><span class="value" data-if="turbo_loads == false">Off</span></button>
|
||||
<span class="ws-hint" data-if="turbo_loads">faster loading, briefly mutes audio</span></span></div>
|
||||
<div class="set-row" data-if="ws_eligible"><span class="set-lbl">Widescreen <span class="exp-tag">EXPERIMENTAL</span></span><span class="set-ctl">
|
||||
<button class="toggle" data-event-click="toggle_widescreen"><span class="value" data-if="widescreen">On</span><span class="value" data-if="widescreen == false">Off</span></button>
|
||||
<span class="ws-hint" data-if="widescreen">16:9 native field-of-view</span></span></div>
|
||||
|
||||
@@ -99,6 +99,7 @@ struct LauncherModel {
|
||||
int texture_filter = 0; // 0=nearest, 1=bilinear
|
||||
int crt = 0; // 0=raw,1=crt,2=composite,3=trinitron
|
||||
bool auto_skip_fmv = false; // skip FMVs via the game's own skip
|
||||
bool turbo_loads = false; // speed through load screens (mutes audio); default off
|
||||
bool spu_hq = false;
|
||||
int aspect_index = 0; // index into kAspects (0 = 4:3 native)
|
||||
int window_width = 1280; // window size (height = width*den/num per aspect)
|
||||
@@ -647,6 +648,7 @@ Result run(SDL_Window* window, void* gl_context,
|
||||
m.texture_filter = io.texture_filter;
|
||||
m.crt = io.screen_kind;
|
||||
m.auto_skip_fmv = io.auto_skip_fmv;
|
||||
m.turbo_loads = io.turbo_loads;
|
||||
m.spu_hq = io.spu_hq;
|
||||
m.aspect_index = io.has_aspect_ratio ? aspect_index_for(io.aspect_num, io.aspect_den) : 0;
|
||||
m.window_width = kWinWidths[winsize_index(io.has_window_width ? io.window_width : 1280)];
|
||||
@@ -691,6 +693,7 @@ Result run(SDL_Window* window, void* gl_context,
|
||||
c.Bind("supersampling", &m.supersampling);
|
||||
c.Bind("antialiasing", &m.antialiasing);
|
||||
c.Bind("auto_skip_fmv", &m.auto_skip_fmv);
|
||||
c.Bind("turbo_loads", &m.turbo_loads);
|
||||
c.Bind("spu_hq", &m.spu_hq);
|
||||
c.Bind("renderer_label", &m.renderer_label);
|
||||
c.Bind("crt_label", &m.crt_label);
|
||||
@@ -804,6 +807,11 @@ Result run(SDL_Window* window, void* gl_context,
|
||||
m.auto_skip_fmv = !m.auto_skip_fmv;
|
||||
handle.DirtyVariable("auto_skip_fmv");
|
||||
});
|
||||
c.BindEventCallback("toggle_turbo_loads",
|
||||
[&m, handle](Rml::DataModelHandle, Rml::Event&, const Rml::VariantList&) mutable {
|
||||
m.turbo_loads = !m.turbo_loads;
|
||||
handle.DirtyVariable("turbo_loads");
|
||||
});
|
||||
c.BindEventCallback("browse_bios",
|
||||
[&m, window, handle](Rml::DataModelHandle, Rml::Event&, const Rml::VariantList&) mutable {
|
||||
std::string p = win_pick_file(window, "Select PlayStation BIOS",
|
||||
@@ -990,6 +998,7 @@ Result run(SDL_Window* window, void* gl_context,
|
||||
io.texture_filter = m.texture_filter; io.has_texture_filter = true;
|
||||
io.screen_kind = m.crt; io.has_screen_kind = true;
|
||||
io.auto_skip_fmv = m.auto_skip_fmv; io.has_auto_skip_fmv = true;
|
||||
io.turbo_loads = m.turbo_loads; io.has_turbo_loads = true;
|
||||
io.spu_hq = m.spu_hq; io.has_spu_hq = true;
|
||||
io.aspect_num = kAspects[m.aspect_index][0];
|
||||
io.aspect_den = kAspects[m.aspect_index][1];
|
||||
|
||||
@@ -1936,6 +1936,7 @@ int main(int argc, char** argv) {
|
||||
if (us.has_texture_filter) g_video_texfilter = us.texture_filter;
|
||||
if (us.has_screen_kind) g_video_screen = us.screen_kind;
|
||||
if (us.has_auto_skip_fmv) g_auto_skip_fmv = us.auto_skip_fmv ? 1 : 0;
|
||||
if (us.has_turbo_loads) g_turbo_loads_enabled = us.turbo_loads ? 1 : 0;
|
||||
if (us.has_aspect_ratio) {
|
||||
g_video_aspect_num = us.aspect_num;
|
||||
g_video_aspect_den = us.aspect_den;
|
||||
@@ -2032,6 +2033,7 @@ int main(int argc, char** argv) {
|
||||
seed.texture_filter = g_video_texfilter; seed.has_texture_filter = true;
|
||||
seed.screen_kind = g_video_screen; seed.has_screen_kind = true;
|
||||
seed.auto_skip_fmv = (g_auto_skip_fmv != 0); seed.has_auto_skip_fmv = true;
|
||||
seed.turbo_loads = (g_turbo_loads_enabled != 0); seed.has_turbo_loads = true;
|
||||
seed.aspect_num = g_video_aspect_num;
|
||||
seed.aspect_den = g_video_aspect_den; seed.has_aspect_ratio = true;
|
||||
seed.spu_hq = g_audio_spu_hq; seed.has_spu_hq = true;
|
||||
@@ -2099,6 +2101,7 @@ int main(int argc, char** argv) {
|
||||
g_video_texfilter = seed.texture_filter;
|
||||
g_video_screen = seed.screen_kind;
|
||||
g_auto_skip_fmv = seed.auto_skip_fmv ? 1 : 0;
|
||||
g_turbo_loads_enabled = seed.turbo_loads ? 1 : 0;
|
||||
g_video_aspect_num = seed.aspect_num;
|
||||
g_video_aspect_den = seed.aspect_den;
|
||||
g_audio_spu_hq = seed.spu_hq;
|
||||
|
||||
Reference in New Issue
Block a user