Skip to content

Launcher: console filter and quick console navigation - #134

Merged
finger563 merged 8 commits into
mainfrom
feat/console-filter
Nov 14, 2026
Merged

finger563 merged 8 commits into
mainfrom
feat/console-filter

Conversation

@finger563

@finger563 finger563 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #133: the console banner in the launcher's header is now interactive.

  • Jump between consoles: Left / Right on the game list go to the previous / next console's first game.
  • Filter to one console: tapping the console in the header, or pressing X, opens a console picker. It lists "All consoles" plus every console on the card with its number of games. Up / Down choose, A picks, and B or a tap beside the list closes it.
  • While filtered: the list shows only that console's games, the console in the header is outlined, and Left / Right move the filter to the next console. Launching a game the filter hides (for example with emulink launch) shows all consoles again. The filter stays across games but not across a reboot.
  • USB link (protocol 3):
    • CONSOLE_FILTER (emulink filter <console|all>), with the current filter in status;
    • emulink screenshot with no game running now returns the launcher's screen, drawn with lv_snapshot into a copy. CONFIG_LV_USE_SNAPSHOT is now enabled.

Graphics: I checked the launcher with every console filtered (screenshots below) and fixed what I found:

  • A short filtered list wrapped round and showed its games twice, so the roller no longer wraps while filtered.
  • The Game Gear badge was nearly invisible on the dark header; its color is lighter now.

No console has SD card art (boxart/consoles/<key>.jpg) on this card, so these are all the firmware's badges.

Tested on the box: picker by X / Down / A, Left / Right stepping, filters for all 9 consoles, a launch that lifts the filter, and the filter kept across a game.

Screenshots (emulink screenshot of the launcher)

All consoles Console picker (X) Picked: Game Boy only Right: on to the next console

The last one was taken with all consoles showing: Right jumped from a Game Boy game to the first Game Boy Color game.

Each console filtered (emulink filter <key>; the badges are the firmware's own, since no console art is on the card):

NES Game Boy Game Boy Color
Master System Game Gear Genesis
MSX PC PICO-8

🤖 Generated with Claude Code

https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY

- Left / right on the game list jump to the previous / next console.
- The console in the header opens a console picker (tap it, or X): all
  consoles, or only one console's games. The console is outlined while
  the list is filtered, and left / right then move the filter. Launching
  a game the filter hides lifts it.
- USB link (protocol 3): CONSOLE_FILTER (emulink filter <console|all>),
  the filter in STATUS, and SCREENSHOT of the launcher's screen when no
  game runs (lv_snapshot, now enabled).
- Graphics: a filtered roller does not wrap (a short list showed twice),
  and the Game Gear badge is lighter (it vanished on the dark header).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
Copilot AI balanced review requested due to automatic review settings November 13, 2026 05:42
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

✅Static analysis result - no issues found! ✅

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Programmatic launches can leave keypad input controlling games behind the visible console picker, and filtered game lists still wrap upward but not downward.

2 open issues
What changed in this PR

Extends the grouped launcher introduced in #133 with console filtering and quick navigation, plus USB controls for filtering and launcher screenshots.

Changes:

  • Adds a console picker, Left/Right console navigation, and filter indicators.
  • Updates USB protocol 3 and emulink to support console filters and launcher screenshots.
  • Uses non-wrapping filtered lists and brightens the Game Gear badge.
File Description
tools/​emulink/​emulink/​control.py Adds the console-filter API and documents launcher captures.
tools/​emulink/​emulink/​cli.py Adds the filter command and updates screenshot help.
sdkconfig.defaults Enables LVGL snapshots for launcher captures.
README.md Documents console navigation and filtering.
main/​remote_control.hpp Adds protocol 3 filtering, filter status, and launcher captures.
components/​rom_info/​src/​rom_info.cpp Lightens the Game Gear badge color.
components/​gui/​src/​gui.cpp Implements filtering, picker controls, console navigation, and snapshots.
components/​gui/​include/​gui.hpp Declares filter and snapshot APIs, picker state, and X-button handling.

Review effort: Balanced

Comment thread components/gui/src/gui.cpp Resolved
Comment thread components/gui/src/gui.cpp Resolved
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

ESP-IDF Size Report for 'Esp Box Emu'

Metric Base PR Delta
FLASH 4,212,328 bytes (66.95%) 4,217,960 bytes (67.04%) 🔺 +5,632 bytes (+0.09%)
DRAM 170,405 bytes (49.86%) 170,405 bytes (49.86%) 0 bytes (0.00%)
IRAM 0 bytes 0 bytes 0 bytes
RAM (DRAM+IRAM) 170,405 bytes 170,405 bytes 0 bytes (0.00%)

FLASH uses app .bin size or json2 flash sum. RAM sums DRAM+IRAM via idf_size. Percentages shown when totals are available.
DRAM/IRAM usage does not include memory used by the heap allocator at runtime.
This report was generated by esp-idf-size-delta.

finger563 and others added 4 commits November 13, 2026 09:00
esp_tinyusb 3.0.1 (TinyUSB 0.21.0~6, the DWC2 SETUP-DMA erratum
workaround) corrupts the PSRAM heap on esp-box-emu while a Genesis game
runs: the link task's next allocation hits a tlsf assert or an MMU entry
fault. With 3.0.0 the same firmware is fine (checked on the box with the
same commit built both ways). A fresh build resolves '>=3.0.0' to 3.0.1,
so CI would have shipped it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
The heap corruption seen with Sonic 2 on the box turned out to be
intermittent: the same builds that failed also pass repeated trials, so
the runs that blamed esp_tinyusb 3.0.1 were not evidence of a cause. The
corruption is tracked separately; no pin until it is understood.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
…picker

- With a console filter on, Up from the first game lands on the header,
  which now moves on to that first game (the filtered roller stops at both
  ends, as Down does on the last game) instead of wrapping to the last.
- Selecting a game or setting the filter from the link closes the console
  picker first: a game started from there left the picker over the list
  with the list's keypad group restored after the game.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
@finger563
finger563 requested a balanced review from Copilot November 14, 2026 03:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

6 open issues

Review effort: Lite

Comment thread components/gui/src/gui.cpp Resolved
Comment thread main/remote_control.hpp Resolved
Comment thread sdkconfig.defaults Resolved
Comment thread tools/emulink/emulink/control.py Resolved
… one pass

- CONSOLE_FILTER with an empty payload now returns {filter, consoles}
  without touching the launcher ("all" clears the filter, as before), and
  emulink filter with no console sends that query instead of re-setting
  the current filter (which rebuilt the list and could undo a newer pick).
- The picker counts each console's games in one pass over the grouped list.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

A critical launch race can cause the wrong game to start, and metadata reloads leave the console picker with stale choices and counts.

2 open issues
2 previously missed issues

In code that hasn't changed since last review

High severity Prevent console filter changes while a launch is pending

main/​remote_control.hpp:492

CONSOLE_FILTER can replace the selected ROM after a launch is accepted but before main.cpp:185 reads it, causing a different game to start. Run mutations through on_main() and reject them while a launch is pending (ready_to_play() with no current cart). Hold the shared GUI mutex across that check and mutation to keep controller input from racing with it.

Medium severity Refresh the open console picker after metadata reload

components/​gui/​src/​gui.cpp:108

Reloading metadata leaves an open console picker with outdated choices and counts. Removed consoles remain selectable even though set_console_filter() rejects them, and newly added consoles are missing. Close the picker before rebuilding the roller so reopening it reflects the current catalog.

4 resolved since last review

Review effort: Balanced

…he picker

- CONSOLE_FILTER (set) runs on the main loop under the GUI lock, like
  LAUNCH, and is refused while a launch the loop has taken has not
  started its cart yet: the new filter could change the game it starts.
- Re-reading metadata.csv closes an open console picker, whose consoles
  and counts are the old list's.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
@finger563

Copy link
Copy Markdown
Contributor Author

Copilot round 2 (review of 3f9a022) raised two issues in its summary, both fixed in 2968e88:

  • Console filter changes while a launch is pending: CONSOLE_FILTER (set) now runs on the main loop under the GUI lock, like LAUNCH, and is refused ("a game is starting") while the loop has taken a launch whose cart hasn't started yet. A query (empty payload) still answers directly, since it changes nothing.
  • Stale picker after a metadata reload: update_rom_list() closes an open console picker before rebuilding, so its consoles and counts can't go stale.

The two "open issues" it lists are the first-round threads, fixed in c303823 (see the replies there).

…larifyCondition)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
@finger563
finger563 merged commit 1f12bd6 into main Nov 14, 2026
3 checks passed
@finger563
finger563 deleted the feat/console-filter branch November 14, 2026 05:47
finger563 added a commit that referenced this pull request Nov 14, 2026
main's tree is feat/console-filter's tip (8a0cd6c), already merged here, so
this branch's tree is kept as is.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants