Skip to content

Commit 6d10cc2

Browse files
authored
Merge pull request #4 from ZaparooProject/feat/zaparoo-frontend-rename
Rename Zaparoo launcher UI to Frontend
2 parents 62c913b + 8687a85 commit 6d10cc2

8 files changed

Lines changed: 50 additions & 50 deletions

File tree

ZAPAROO_FORK.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@ non-blocking spawn) are intentionally omitted.
2020

2121
| # | Cluster | Purpose | Where it lives |
2222
|---|---------|---------|----------------|
23-
| 1 | **External launcher process management** | Spawn `zaparoo/launcher` via `agetty` on tty2; SIGTERM/SIGKILL on shutdown; bounded `waitpid`; respawn timer; 3-strike crash give-up | `support/zaparoo/alt_launcher.cpp` (`spawn`, `kill_launcher`, `alt_launcher_poll`, `return_to_normal_mode`) |
24-
| 2 | **Process discovery & gating** | `alt_launcher_configured()` = file exists at `zaparoo/launcher` (cached, with sticky escape bit); `alt_launcher_active()` = process running | `support/zaparoo/alt_launcher.cpp:34-43,329-332` |
23+
| 1 | **External frontend process management** | Spawn `zaparoo/frontend` via `agetty` on tty2; SIGTERM/SIGKILL on shutdown; bounded `waitpid`; respawn timer; 3-strike crash give-up | `support/zaparoo/alt_launcher.cpp` (`spawn`, `kill_launcher`, `alt_launcher_poll`, `return_to_normal_mode`) |
24+
| 2 | **Process discovery & gating** | `alt_launcher_configured()` = file exists at `zaparoo/frontend` (cached, with sticky escape bit); `alt_launcher_active()` = process running | `support/zaparoo/alt_launcher.cpp:34-43,329-332` |
2525
| 3 | **Custom menu RBF discovery** | `menu_rbf_name()` / `is_menu_rbf()` so a Zaparoo build can ship its own renamed menu RBF and the file_io / fpga_io / user_io paths still recognize it | `support/zaparoo/menu_rbf.cpp/.h`; consumers in `file_io.cpp`, `fpga_io.cpp`, `user_io.cpp` |
2626
| 4 | **Forced cfg overrides** | `alt_launcher_cfg_apply()` forces `cfg.fb_terminal = 1; cfg.recents = 1` after INI parse. Original `ALT_LAUNCHER` / `MENU_RBF` INI knobs were dropped in favor of file-existence detection | `cfg.cpp:614`, `support/zaparoo/alt_launcher.cpp:24-30` |
2727
| 5 | **Polling integration** | `alt_launcher_poll()` driven by main scheduler tick | `scheduler.cpp:36`, `support/zaparoo/alt_launcher.cpp:365` |
28-
| 6 | **TTY / framebuffer hygiene** | Clear/reset tty2 around launcher lifecycle; toggle `video_fb_enable` and `video_chvt` only on respawn paths; don't touch them on plain shutdown | `support/zaparoo/alt_launcher.cpp` (`clear_launcher_tty`, `reset_launcher_tty`) |
29-
| 7 | **Joypad routing into launcher** | `alt_launcher_fb_terminal_key()` translates `JOY_L2/R2/OSD` to `KEY_F1/BACKSPACE/MENU`; `joy_digital()` short-circuits to `uinp_send_key` when launcher active | `input.cpp:2475-2484`, `support/zaparoo/alt_launcher.cpp:45-62` |
30-
| 8 | **Native CRT rendering path** | Launcher running in CRT mode: kernel framebuffer at 320×240 RGBA8888, FPGA scans separate region at `0x3A000000`, `status[9]=1` gates it; pre-spawn blank wipes the prior frame | `support/zaparoo/alt_launcher.cpp` (`enable_native_crt_path`, `disable_native_crt_path`, `blank_native_crt_fb`); paired with `Menu_MiSTer/rtl/native_video_*.sv` |
28+
| 6 | **TTY / framebuffer hygiene** | Clear/reset tty2 around frontend lifecycle; toggle `video_fb_enable` and `video_chvt` only on respawn paths; don't touch them on plain shutdown | `support/zaparoo/alt_launcher.cpp` (`clear_launcher_tty`, `reset_launcher_tty`) |
29+
| 7 | **Joypad routing into frontend** | `alt_launcher_fb_terminal_key()` translates `JOY_L2/R2/OSD` to `KEY_F1/BACKSPACE/MENU`; `joy_digital()` short-circuits to `uinp_send_key` when frontend active | `input.cpp:2475-2484`, `support/zaparoo/alt_launcher.cpp:45-62` |
30+
| 8 | **Native CRT rendering path** | Frontend running in CRT mode: kernel framebuffer at 320×240 RGBA8888, FPGA scans separate region at `0x3A000000`, `status[9]=1` gates it; pre-spawn blank wipes the prior frame | `support/zaparoo/alt_launcher.cpp` (`enable_native_crt_path`, `disable_native_crt_path`, `blank_native_crt_fb`); paired with `Menu_MiSTer/rtl/native_video_*.sv` |
3131
| 9 | **CRT mode persistence** | 1-byte `zaparoo_launcher_crt.bin` via `FileSaveConfig` / `FileLoadConfig`; loaded at menu init, applied on spawn | `support/zaparoo/alt_launcher.cpp:76-89,344,499` |
3232
| 10 | **Native-core auto-init** | `zaparoo_is_native_core()` matches core name `"Zaparoo Launcher"`; `zaparoo_alt_launcher_init_for_core()` auto-spawns when the FPGA loads that core | `support/zaparoo/alt_launcher.cpp:480-495`, `user_io.cpp:1543` |
33-
| 11 | **In-core "Launcher" OSD entry** | Adds row 31 (`ALT_LAUNCHER_MENUSUB`) to MENU_COMMON1 marked with `reboot_req` when activated | `menu.cpp:2831,2845-2849,3088-3091` |
34-
| 12 | **OSD/F12 overlay over running launcher** | F12 / `KEY_MENU` reaches the OSD even with launcher running; on menu core opens System Settings directly (skip file picker); F1/F9 disabled when launcher active; `vga_nag` suppressed; auto-open suppressed in CRT mode | `menu.cpp:843-852,1289,1304-1311,1334,1583,1604-1611,6727,6739,6816,6901`, `user_io.cpp:4162-4171` |
33+
| 11 | **In-core "Frontend" OSD entry** | Adds row 31 (`ALT_LAUNCHER_MENUSUB`) to MENU_COMMON1 marked with `reboot_req` when activated | `menu.cpp:2831,2845-2849,3088-3091` |
34+
| 12 | **OSD/F12 overlay over running frontend** | F12 / `KEY_MENU` reaches the OSD even with frontend running; on menu core opens System Settings directly (skip file picker); F1/F9 disabled when frontend active; `vga_nag` suppressed; auto-open suppressed in CRT mode | `menu.cpp:843-852,1289,1304-1311,1334,1583,1604-1611,6727,6739,6816,6901`, `user_io.cpp:4162-4171` |
3535
| 13 | **Trimmed System Settings render** | `alt_launcher_render_system_menu()` overrides MENU_SYSTEM1 body for the alt-launcher path; `alt_launcher_translate_system_select()` maps trimmed menusub indices (Remap, Define joy, Scripts, Reboot, Exit) to upstream dispatch slots | `support/zaparoo/alt_launcher_menu.cpp`, `menu.cpp:6739-6745,6816-6821` |
36-
| 14 | **Right-side Zaparoo Launcher pages (two-page)** | Right-arrow from System Settings enters `MENU_ZAPAROO_LAUNCHER1/2` (top page: Video, Exit). Selecting Video enters `MENU_ZAPAROO_VIDEO1/2` (sub-page: CRT mode, H Offset, V Offset, Exit) where left/right adjust values and `±` also work. Both pages live in one helper file with split renderers / select handlers per page | `support/zaparoo/launcher_pages.cpp/.h` (`launcher_page_*`, `video_page_*`), `support/zaparoo/alt_launcher.cpp` (offset state + setters), `menu.cpp` `MENU_ZAPAROO_LAUNCHER*` and `MENU_ZAPAROO_VIDEO*` cases |
36+
| 14 | **Right-side Zaparoo Frontend pages (two-page)** | Right-arrow from System Settings enters `MENU_ZAPAROO_LAUNCHER1/2` (top page: Video, Exit). Selecting Video enters `MENU_ZAPAROO_VIDEO1/2` (sub-page: CRT mode, H Offset, V Offset, Exit) where left/right adjust values and `±` also work. Both pages live in one helper file with split renderers / select handlers per page | `support/zaparoo/launcher_pages.cpp/.h` (`launcher_page_*`, `video_page_*`), `support/zaparoo/alt_launcher.cpp` (offset state + setters), `menu.cpp` `MENU_ZAPAROO_LAUNCHER*` and `MENU_ZAPAROO_VIDEO*` cases |
3737
| 15 | **H/V offset persistence and push** | 2-byte `zaparoo_video_offsets.bin` via `FileSaveConfig` / `FileLoadConfig`; loaded at menu init alongside the CRT byte; values pushed to FPGA via `user_io_status_set("[13:10]" / "[17:14]")` so the change takes effect immediately | `support/zaparoo/alt_launcher.cpp` (`load_persisted_offsets`, `save_persisted_offsets`, `alt_launcher_set_h_offset`/`_v_offset`, `zaparoo_alt_launcher_init_for_menu`) |
38-
| 16 | **OSD auto-dismiss on launcher spawn** | `spawn()` calls `MenuHide()` after fork so an OSD still up from CRT toggle / Reboot doesn't trap input once the launcher grabs the input device | `support/zaparoo/alt_launcher.cpp` (end of `spawn`) |
39-
| 17 | **CRT-mode-on-exit safety** | If the launcher exits while in CRT mode (clean or crashed), drop back to HDMI / normal mode for the rest of this session instead of respawning into CRT — avoids a UX trap where the user just left CRT but the launcher would respawn into it. Persisted preference is left untouched so next reboot honors it | `support/zaparoo/alt_launcher.cpp` `alt_launcher_poll()` post-`waitpid` branch |
38+
| 16 | **OSD auto-dismiss on frontend spawn** | `spawn()` calls `MenuHide()` after fork so an OSD still up from CRT toggle / Reboot doesn't trap input once the frontend grabs the input device | `support/zaparoo/alt_launcher.cpp` (end of `spawn`) |
39+
| 17 | **CRT-mode-on-exit safety** | If the frontend exits while in CRT mode (clean or crashed), drop back to HDMI / normal mode for the rest of this session instead of respawning into CRT — avoids a UX trap where the user just left CRT but the frontend would respawn into it. Persisted preference is left untouched so next reboot honors it | `support/zaparoo/alt_launcher.cpp` `alt_launcher_poll()` post-`waitpid` branch |
4040
| 18 | **Escape-to-stock semantics** | Sticky `s_escaped` flag makes `alt_launcher_configured()` return `false` after a clean exit, so the rest of the session reverts to stock OSD; reboot resets it | `support/zaparoo/alt_launcher.cpp:32,38-43,229-241` |
4141
| 19 | **CI / build infrastructure** | Docker container build; binary named `MiSTer_Zaparoo`; "Z"-suffixed version; release / unstable CI; sync-upstream workflow; deploy script | `docker-build.sh`, `stable-build.sh`, `unstable-build.sh`, `deploy-zaparoo.sh`, `.github/build_*.sh`, `.github/workflows/*.yml` |
4242
| 20 | **Build-time defaults flipped** | `cfg.recents` and `LOG_FILE_ENTRY` default to enabled in Zaparoo builds | `cfg.cpp` (defaults) |
@@ -66,13 +66,13 @@ interchangeably without a documented rule. Current de-facto convention:
6666

6767
| Predicate | Meaning | Used to gate |
6868
|-----------|---------|--------------|
69-
| `_configured` | binary file exists, sticky off after escape | **render paths** (System Settings body, MENU_SYSTEM1 entry, vga_nag, file-picker entry, "Launcher" row visibility, right-arrow gate) |
70-
| `_active` | PID alive | **input handling** (F1/F9 disable, joypad-to-launcher routing, OSD overlay, menu auto-open suppression) |
69+
| `_configured` | binary file exists, sticky off after escape | **render paths** (System Settings body, MENU_SYSTEM1 entry, vga_nag, file-picker entry, "Frontend" row visibility, right-arrow gate) |
70+
| `_active` | PID alive | **input handling** (F1/F9 disable, joypad-to-frontend routing, OSD overlay, menu auto-open suppression) |
7171
| `_native_crt` | PID alive AND CRT mode on | **internal video state machine** (`disable_native_crt_path`, status timer) |
7272

7373
The split is mostly principled but leaks at `MENU_SYSTEM1`, which uses
7474
`_configured` for both the gate AND the body delegation while `MENU_NONE2`
75-
auto-open uses `_active`. A user with the launcher binary present but not yet
75+
auto-open uses `_active`. A user with the frontend binary present but not yet
7676
running sees different OSD behavior than a user without the binary at all —
7777
worth either a comment or a unified helper.
7878

@@ -103,7 +103,7 @@ Cost: a one-shot migration on existing installs (read legacy `crt.bin` if
103103
new file is missing; never write the legacy file again).
104104

105105
### 2.4 Hardcoded paths scattered across modules
106-
- Launcher path: `zaparoo/launcher` in `alt_launcher.cpp:22`
106+
- Frontend path: `zaparoo/frontend` in `alt_launcher.cpp:22`
107107
- Menu RBF name(s): hardcoded in `support/zaparoo/menu_rbf.cpp`
108108
- Persistence files: hardcoded in `alt_launcher.cpp`
109109

@@ -132,7 +132,7 @@ It can shrink to one line:
132132

133133
```c
134134
// F12/KEY_MENU bypasses alt_launcher_active() so the user can open
135-
// the OSD on top of a running launcher.
135+
// the OSD on top of a running frontend.
136136
```
137137

138138
### 2.7 Trimmed-menu dispatcher has a dead branch
@@ -172,21 +172,21 @@ the right-side surface is now two pages, `MENU_ZAPAROO_LAUNCHER*` (top) and
172172
`video_page_*` both living in `support/zaparoo/launcher_pages.{cpp,h}`.
173173
File name and symbols agree. ✅
174174
175-
### 2.11 Two ways to dismiss the OSD on launcher spawn
176-
The launcher's `spawn()` calls `MenuHide()` to drop a still-open OSD before
177-
the launcher grabs input, which is the new safety net (entry 16 in the
175+
### 2.11 Two ways to dismiss the OSD on frontend spawn
176+
The frontend's `spawn()` calls `MenuHide()` to drop a still-open OSD before
177+
the frontend grabs input, which is the new safety net (entry 16 in the
178178
table). Independently, `MENU_SYSTEM2`'s F12 handler also forces
179179
`MENU_NONE1` when `alt_launcher_configured()` is true. Both are needed —
180180
spawn-side handles the "Reboot from System Settings" path, F12-side
181181
handles the "user opens and closes OSD without spawning" path — but the
182182
overlap is implicit. Worth a code comment naming each owner.
183183
184-
### 2.12 CRT-mode-on-exit drops launcher entirely
185-
Entry 17 in the table: if the launcher exits while in CRT mode, the fork
184+
### 2.12 CRT-mode-on-exit drops frontend entirely
185+
Entry 17 in the table: if the frontend exits while in CRT mode, the fork
186186
permanently drops back to HDMI for the session, even on a clean exit (not
187187
just crashes). That's intentional UX to avoid a trap, but it means a user
188-
who exits the launcher in CRT mode and wants to come back has to reboot.
189-
Worth documenting in the launcher's own README, or relaxing the rule for
188+
who exits the frontend in CRT mode and wants to come back has to reboot.
189+
Worth documenting in the frontend's own README, or relaxing the rule for
190190
clean exits if respawn-into-CRT turns out to be valuable.
191191
192192
---

menu.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ enum MENU
8787
MENU_MISC2,
8888

8989
// Right-side companion to System Settings on the alt-launcher menu core.
90-
// Top "Zaparoo Launcher" page lists sub-pages (Video) and an exit row;
90+
// Top "Zaparoo Frontend" page lists sub-pages (Video) and an exit row;
9191
// the Video sub-page hosts CRT mode + H/V centering offsets and binds
9292
// left/right arrows to value adjustment.
9393
MENU_ZAPAROO_LAUNCHER1,
@@ -858,7 +858,7 @@ static void vga_nag()
858858
{
859859
// With an alt launcher configured the user has fb_terminal on by design
860860
// and the CRT is fed directly by the menu core (snow pattern when status[9]=0,
861-
// or the launcher's framebuffer when status[9]=1). The "fix MiSTer.ini"
861+
// or the frontend's framebuffer when status[9]=1). The "fix MiSTer.ini"
862862
// nag is not appropriate — just leave the OSD off without the warning.
863863
if (video_fb_state() && !alt_launcher_configured())
864864
{
@@ -1589,7 +1589,7 @@ void HandleUI(void)
15891589
}
15901590
// On the menu core without an alt launcher, the menu *is* the screen —
15911591
// keep auto-opening the OSD whenever fb_terminal is off. With an alt
1592-
// launcher running, that rule would re-open System Settings the moment
1592+
// frontend running, that rule would re-open System Settings the moment
15931593
// the user closes it (in CRT mode video_fb_state is false), so the OSD
15941594
// could never actually close. Suppress the auto-open in that case;
15951595
// explicit F12/MENU presses still open and close it normally.
@@ -2858,7 +2858,7 @@ void HandleUI(void)
28582858
if (alt_launcher_configured())
28592859
{
28602860
menumask |= (1ULL << ALT_LAUNCHER_MENUSUB);
2861-
MenuWrite(n++, " Launcher", menusub == ALT_LAUNCHER_MENUSUB, 0);
2861+
MenuWrite(n++, " Frontend", menusub == ALT_LAUNCHER_MENUSUB, 0);
28622862
}
28632863

28642864
MenuWrite(n++, " Core \x16", menusub == 0, 0);
@@ -6738,7 +6738,7 @@ void HandleUI(void)
67386738
// Without an alt launcher, the wallpaper / fb_terminal flow can't coexist
67396739
// with this menu — bail out so vga_nag can show the MiSTer.ini warning.
67406740
// With an alt launcher the OSD overlay is exactly what we want on top of
6741-
// the running launcher, so let it render through.
6741+
// the running frontend, so let it render through.
67426742
if (video_fb_state() && !alt_launcher_configured())
67436743
{
67446744
menustate = MENU_NONE1;
@@ -6923,7 +6923,7 @@ void HandleUI(void)
69236923
break;
69246924

69256925
/******************************************************************/
6926-
/* zaparoo launcher pages (right-side sibling of System) */
6926+
/* zaparoo frontend pages (right-side sibling of System) */
69276927
/******************************************************************/
69286928
case MENU_ZAPAROO_LAUNCHER1:
69296929
if (!alt_launcher_configured())

support/zaparoo/alt_launcher.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
#include "user_io.h"
2121
#include "video.h"
2222

23-
static const char s_launcher_path[] = "zaparoo/launcher";
23+
static const char s_launcher_path[] = "zaparoo/frontend";
2424

2525
void alt_launcher_cfg_apply(void)
2626
{
2727
// Override any user ini values: this fork is single-purpose and the
28-
// launcher needs both flags on to render.
28+
// frontend needs both flags on to render.
2929
cfg.fb_terminal = 1;
3030
cfg.recents = 1;
3131
}
@@ -136,12 +136,12 @@ static void set_native_crt_fb_mode(bool log = true)
136136

137137
static void blank_native_crt_fb(void)
138138
{
139-
// CRT path doesn't read /dev/fb0 (kernel FB at 0x22000000). The launcher
139+
// CRT path doesn't read /dev/fb0 (kernel FB at 0x22000000). The frontend
140140
// runs a worker that copies the top-left 320x240 from /dev/fb0 into a
141141
// separate FPGA-mapped region at 0x3A000000 (control word + two 320x240
142142
// RGBA buffers). The FPGA scans out from that region. Nothing zeros it
143-
// across launcher restarts or software reboots, so the previous session's
144-
// last frame ghosts in until the launcher's writer thread starts.
143+
// across frontend restarts or software reboots, so the previous session's
144+
// last frame ghosts in until the frontend's writer thread starts.
145145
const uint32_t native_addr = 0x3A000000u;
146146
const uint32_t native_size = 0x000A0000u;
147147
void *p = shmem_map(native_addr, native_size);
@@ -226,7 +226,7 @@ static void enable_native_crt_path(void)
226226
video_fb_enable(0);
227227

228228
// Double-write with a settle window so the kernel module's 320x240 layout
229-
// is live before status[9] flips. Without this, the launcher renders for
229+
// is live before status[9] flips. Without this, the frontend renders for
230230
// up to a second under stale dims (the post-fork retry timer used to be
231231
// what eventually fixed the picture).
232232
set_native_crt_fb_mode(false);
@@ -351,7 +351,7 @@ static void spawn(void)
351351
user_io_status_set("[9]", 1);
352352
}
353353

354-
// The launcher grabs input as soon as it starts. If the OSD is still
354+
// The frontend grabs input as soon as it starts. If the OSD is still
355355
// up (e.g. user toggled CRT mode or hit Reboot from System Settings),
356356
// it would trap input with no way to dismiss it — drop it now.
357357
if (menu_present()) MenuHide();
@@ -402,8 +402,8 @@ void alt_launcher_toggle_crt(void)
402402
printf("alt_launcher: toggle CRT path %d -> %d\n", current_crt, target_crt);
403403

404404
// Shutdown drops status[9], releases the FB mode and restores HPS framebuffer
405-
// state regardless of whether the launcher was running. After it returns we
406-
// always have a clean slate to spawn the next launcher invocation.
405+
// state regardless of whether the frontend was running. After it returns we
406+
// always have a clean slate to spawn the next frontend invocation.
407407
alt_launcher_shutdown();
408408
alt_launcher_init(target_crt);
409409
}
@@ -445,7 +445,7 @@ void alt_launcher_poll(void)
445445
int sig = WIFSIGNALED(status) ? WTERMSIG(status) : 0;
446446
bool escaped = (exited && exit_status == 0) || sig == SIGTERM || sig == SIGINT;
447447
bool crashed = !escaped && (sig != 0 || (exited && exit_status != 0));
448-
// Any exit while in CRT mode drops back to HDMI / no launcher
448+
// Any exit while in CRT mode drops back to HDMI / no frontend
449449
// for the rest of this session — respawning into CRT after the
450450
// user already left it is a UX trap. The persisted CRT
451451
// preference is intentionally untouched (return_to_normal_mode
@@ -566,7 +566,7 @@ void zaparoo_alt_launcher_init_for_menu(void)
566566
{
567567
bool crt = load_persisted_native_crt();
568568
load_persisted_offsets();
569-
printf("alt_launcher: initializing menu launcher (persisted crt=%d, h=%d, v=%d)\n",
569+
printf("alt_launcher: initializing menu frontend (persisted crt=%d, h=%d, v=%d)\n",
570570
crt, s_h_offset, s_v_offset);
571571
// Push the persisted offsets to the FPGA now that the menu RBF is loaded.
572572
user_io_status_set("[13:10]", (uint32_t)((uint8_t)s_h_offset & 0xF));

0 commit comments

Comments
 (0)