Skip to content

Commit 54fbded

Browse files
committed
feat(zaparoo): restore exit-launcher escape-to-stock behavior
When the alt launcher exits cleanly the OSD reverts to stock menu items for the rest of the session (until reboot, which still routes back to the Zaparoo menu RBF). Adds an s_escaped latch in alt_launcher_configured() and gates the cores-picker root in SelectFile() on is_menu() so the populated cores list works while the Zaparoo menu RBF (in zaparoo/) is still loaded.
1 parent 09a7467 commit 54fbded

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

menu.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,8 @@ void SelectFile(const char* path, const char* pFileExt, int Options, unsigned ch
413413

414414
if (Options & SCANO_CORES)
415415
{
416-
strcpy(selPath, get_rbf_dir());
417-
if (strlen(get_rbf_name()))
416+
strcpy(selPath, is_menu() ? "" : get_rbf_dir());
417+
if (!is_menu() && strlen(get_rbf_name()))
418418
{
419419
if(strlen(selPath)) strcat(selPath, "/");
420420
strcat(selPath, get_rbf_name());

support/zaparoo/alt_launcher.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,14 @@ void alt_launcher_cfg_apply(void)
2929
cfg.recents = 1;
3030
}
3131

32+
static bool s_escaped = false;
33+
3234
bool alt_launcher_configured(void)
3335
{
36+
// After a clean exit / give-up, masquerade as not-configured so the rest
37+
// of the OSD reverts to stock menu behavior for the rest of this session.
38+
// Reboot re-execs MiSTer and resets this back to the file-existence cache.
39+
if (s_escaped) return false;
3440
static int cached = -1;
3541
if (cached < 0) cached = FileExists(s_launcher_path, 0) ? 1 : 0;
3642
return cached != 0;
@@ -231,6 +237,7 @@ static void return_to_normal_mode(void)
231237
s_respawn_timer = 0;
232238
s_crash_count = 0;
233239
s_gave_up = true;
240+
s_escaped = true;
234241
}
235242

236243
static void reset_launcher_state(void)
@@ -240,6 +247,7 @@ static void reset_launcher_state(void)
240247
s_crash_count = 0;
241248
s_gave_up = false;
242249
s_init_pending = false;
250+
s_escaped = false;
243251
}
244252

245253
static void kill_launcher(pid_t pid, int sig)

0 commit comments

Comments
 (0)