From d73726b0a701c6cb56765b311662f51b4c0ae52c Mon Sep 17 00:00:00 2001 From: Callan Barrett Date: Mon, 31 Aug 2026 10:16:31 +0800 Subject: [PATCH] fix(zaparoo): restore menu static background --- support/zaparoo/alt_launcher.cpp | 11 +++++++++++ support/zaparoo/alt_launcher.h | 2 ++ user_io.cpp | 1 + 3 files changed, 14 insertions(+) diff --git a/support/zaparoo/alt_launcher.cpp b/support/zaparoo/alt_launcher.cpp index 892b99671..746d22647 100644 --- a/support/zaparoo/alt_launcher.cpp +++ b/support/zaparoo/alt_launcher.cpp @@ -297,6 +297,14 @@ static void zero_native_crt_words(void) shmem_unmap(p, map_size); } +// The menu core's native video reader activates on any non-zero control word +// at 0x3A000000 and that core no longer clears DDR on startup, so a previous +// core's leftovers make it scan out garbage instead of its noise background. +void zaparoo_native_video_release(void) +{ + zero_native_crt_words(); +} + static void clear_launcher_tty(void) { int tty_fd = open(s_tty_path, O_WRONLY | O_CLOEXEC); @@ -1015,6 +1023,9 @@ void alt_launcher_poll(void) void alt_launcher_shutdown(void) { fflush(stdout); + // Every FPGA reconfiguration passes through here, so the incoming core + // cannot inherit a stale native video control block. + zero_native_crt_words(); if (!s_pid) { if (alt_launcher_configured()) kill_stale_frontends(); diff --git a/support/zaparoo/alt_launcher.h b/support/zaparoo/alt_launcher.h index 13485ce13..4333956ac 100644 --- a/support/zaparoo/alt_launcher.h +++ b/support/zaparoo/alt_launcher.h @@ -44,3 +44,5 @@ bool zaparoo_is_native_core(void); void zaparoo_alt_launcher_init_for_core(void); void zaparoo_alt_launcher_init_for_menu(void); void zaparoo_alt_launcher_start_for_menu(void); +// Parks the menu core on its own background until a writer publishes frames. +void zaparoo_native_video_release(void); diff --git a/user_io.cpp b/user_io.cpp index a897b7b8e..a7f9d05b4 100644 --- a/user_io.cpp +++ b/user_io.cpp @@ -1573,6 +1573,7 @@ void user_io_init(const char *path, const char *xml) else if (is_menu()) { user_io_status_set("[4]", (cfg.menu_pal) ? 1 : 0); + zaparoo_native_video_release(); if (alt_launcher_configured()) { if (rbf_path[0] || !zaparoo_is_native_core()) zaparoo_alt_launcher_init_for_menu();