diff --git a/support/zaparoo/alt_launcher.cpp b/support/zaparoo/alt_launcher.cpp index 352537246..db3d28e5f 100644 --- a/support/zaparoo/alt_launcher.cpp +++ b/support/zaparoo/alt_launcher.cpp @@ -620,6 +620,17 @@ bool alt_launcher_scheduler_sleep_enabled(void) return s_pid || s_init_pending || s_respawn_timer || s_tty_deadline || s_native_crt_finish_timer || s_native_fb_mode_timer || s_hdmi_fb_reassert_timer || s_hdmi_edid_retry_timer; } +bool alt_launcher_handle_video_fb_config(void) +{ + if (s_native_crt || (!s_pid && !s_init_pending && !s_respawn_timer)) return false; + + // Own HDMI fb configuration from queued initialization through the live + // child. This prevents pre-spawn module writes from landing after the + // frontend's vmode, and publishes its geometry against later output changes. + video_fb_reassert(); + return true; +} + bool alt_launcher_native_crt(void) { return s_native_crt && s_pid != 0; diff --git a/support/zaparoo/alt_launcher.h b/support/zaparoo/alt_launcher.h index 1107e574b..96e4cdf0a 100644 --- a/support/zaparoo/alt_launcher.h +++ b/support/zaparoo/alt_launcher.h @@ -19,6 +19,8 @@ bool alt_launcher_native_crt_persisted(void); // Flips the persisted native CRT state and respawns the launcher to apply it. void alt_launcher_toggle_native_crt(void); bool alt_launcher_scheduler_sleep_enabled(void); +// Preserves HDMI launcher fb0 across queued startup and live mode changes. +bool alt_launcher_handle_video_fb_config(void); void alt_launcher_cfg_apply(void); uint16_t alt_launcher_fb_terminal_key(uint32_t mask, bool osd_button); diff --git a/video.cpp b/video.cpp index 1fe23bce3..00ff3503f 100644 --- a/video.cpp +++ b/video.cpp @@ -30,6 +30,7 @@ #include "support.h" #include "support/arcade/mra_loader.h" +#include "support/zaparoo/alt_launcher.h" #include "lib/imlib2/Imlib2.h" #include "lib/md5/md5.h" @@ -3536,6 +3537,8 @@ static void video_fb_config() { PROFILE_FUNCTION(); + if (alt_launcher_handle_video_fb_config()) return; + int fb_scale = cfg.fb_size; if (fb_scale <= 1)