Skip to content

Launcher features, USB link (console, test control, SD drive, OTA), emulink - #18

Merged
finger563 merged 13 commits into
mainfrom
feat/launcher-features
Nov 13, 2026
Merged

finger563 merged 13 commits into
mainfrom
feat/launcher-features

Conversation

@finger563

@finger563 finger563 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Launcher: games grouped by console, with a console badge; settings are saved, and the last game can be resumed.
  • USB link: the USB-C port is now an espp::UsbDevice composite device.
    • CDC console: the logs, teed to UART0.
    • Vendor interface: framed services.
      • OTA, through a small updater app in ota_1, so the 9 MB image can be replaced over USB.
      • Core dump, system info and reboot (including into the ROM download mode), and a log monitor.
      • The emulator's test control: status, launch and quit, press and hold buttons, save and load states, screenshots, and SD card ls, push, pull, rm and mkdir.
    • MSC: the SD card as a USB drive. It goes to the PC only on request (the launcher's switch, or the link), and comes back once the PC has ejected it.
  • tools/emulink: the Python client (python -m emulink ...) for scripted tests and for getting content onto the card. The same copy is in esp-box-emu.
  • MGS at full speed with USB up. The drive function's buffers take about 8 KB of main SRAM. That pushed psyz's CLUT caches into the P4's slow LP SRAM.
    • psyz (esp-cpp/psyz@f3aebd9) now allocates the caches only from main SRAM or TCM, when the game starts.
    • The SD driver has a permanent 16 KB PSRAM bounce buffer, so reads into unaligned buffers no longer need DMA-capable internal RAM, and they now move 16 KB per command.
    • MGS intro frames at 91 s: 1017–1042 before, 1238–1260 after (1231 without the drive function at all).
  • JK: file staging goes through cache-aligned PSRAM, and card reads use stdio, so a failed read is an error instead of an abort. The menu also loads screenshots with stdio.

espp/usb_device comes from the esp-cpp/espp#898 branch for take_msc_from_ejected_host(). Switch back to the registry once that's released.

Test plan

  • OTA, launch and quit, press, save and load, screenshot, ls, push, pull and rm, drive on and off, and log, all through emulink.
  • Five MGS launch and quit cycles: no internal RAM leak (66.1 KB free in the menu each time), and the same speed every time. Each cycle did a 1 MB SD round trip while the game was running.
  • MGS save and load state.
  • Jedi Knight, Phantom Menace, Minish Cap, Chrono Trigger, Sonic 3 and Doom: each launched and did an SD round trip while playing.
  • Three drive hand-overs: a file the Mac wrote to the drive is read back identically on the device.
  • Box-side changes, in their own esp-box-emu PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY

finger563 and others added 3 commits November 10, 2026 21:04
…sume

- The game list is grouped under a header per console (SNES, Game Boy
  Advance, Genesis, PlayStation, PC, PICO-8), metadata.csv order within one.
- The selected game's console is shown above its boxart, on the launcher
  only: boxart/consoles/<key>.jpg from the SD card if present, else a badge
  drawn from LVGL objects (a generic icon and the name, no logos).
- Settings survive a power cycle in /sdcard/settings.bin (espp
  persistent_data, versioned): volume, mute, brightness, video scaling,
  resume, the last game started (selected again at boot) and the save slot
  last used per game. Written once launcher changes stop, at each launch and
  on the way back from a game (pause-menu changes).
- "Resume last save" (on by default): starting a game loads the slot it was
  last saved to / loaded from, for the emulator cores (Genesis, SNES, GBA,
  PICO-8 after its first second); the native ports start fresh.

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

The USB-C port becomes an espp::UsbDevice with three functions:

- CDC console: the logs (teed to UART0)
- a vendor interface carrying framed services: OTA (through a separate
  updater app in ota_1, so the 9 MB main image can be replaced), the core
  dump, system info / reboot, a log monitor, and the emulator's own test
  control (status, launch / quit, press / hold buttons, save / load states,
  screenshots, and SD card file list / push / pull / rm / mkdir)
- MSC: the SD card as a USB drive, handed to the PC only on request (the
  launcher's switch or the link) and taken back once the PC ejected it

tools/emulink is the Python client (python -m emulink ...), shared with
esp-box-emu, for scripting tests and getting content onto the card.

Also: JK stages files through cache-aligned PSRAM (internal DMA memory is
scarce with USB up) and reads the card with stdio, so a failed read is an
error instead of an abort; the menu loads screenshots with stdio too.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
The USB drive function's buffers take ~8 KB of main SRAM. With that gone,
the rasterizer's per-core CLUT caches landed in the P4's LP SRAM (slow to
read): sprites took 4.7x longer and busy scenes ran ~40% slower.

- psyz: allocate the caches only from main SRAM or TCM, and take them
  when the game starts (Draw_ClutCacheInit()), after the statics reset
- SD card: a permanent 16 KB PSRAM bounce buffer for reads into unaligned
  buffers. The driver otherwise mallocs one from DMA-capable internal RAM
  per call, which failed once the caches had the main SRAM, and moved one
  sector per command

MGS intro, frames drawn 91 s after launch: 1017-1042 before, 1238-1260
now (1231 with no drive function at all). Stress tested: five MGS
launch / quit cycles (no leak, same speed each time), save / load, JK,
TPM, GBA, SNES, Genesis and Doom with 1 MB SD round trips while playing,
and three drive hand-overs with Mac writes verified on the device.

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 11, 2026 22:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved critical issues allow silent transfer data loss, unsafe SD-card handovers, and recovery reboot loops after interrupted updates.

14 open issues
What changed in this PR

This PR expands the launcher and adds a composite USB connection for console access, scripted emulator control, SD-card transfers, and firmware updates through a dedicated updater app.

Changes:

  • Groups games by console and persists launcher settings, last-game selection, and resume slots.
  • Adds USB services and the Python emulink client for device control, diagnostics, file transfers, and OTA updates.
  • Adjusts memory placement and SD buffering to preserve game performance with USB enabled.
File Description
updater/​sdkconfig.defaults Configures the updater’s USB interfaces and rollback support.
updater/​main/​updater.cpp Implements USB OTA service and idle return to the emulator.
updater/​main/​idf_component.yml Declares updater service dependencies.
updater/​main/​CMakeLists.txt Registers updater sources and dependencies.
updater/​CMakeLists.txt Defines the standalone updater project.
tools/​emulink/​emulink/​link.py Implements USB discovery, transport, and request matching.
tools/​emulink/​emulink/​frame.py Adds framed-message encoding and parsing.
tools/​emulink/​emulink/​espp_tools.py Locates external espp host clients.
tools/​emulink/​emulink/​control.py Provides emulator-control and SD-file APIs.
tools/​emulink/​emulink/​cli.py Adds commands for control, transfers, diagnostics, and updates.
tools/​emulink/​emulink/​__main__.py Enables execution with python -m emulink.
tools/​emulink/​emulink/​__init__.py Exports the client API and describes USB services.
sdkconfig.defaults Enables composite USB interfaces and OTA rollback.
partitions.csv Allocates emulator, updater, and OTA metadata partitions.
main/​snes_cart.hpp Enables automatic save-state resume for SNES.
main/​remote_control.hpp Implements remote commands and main-task dispatch.
main/​pico8_cart.hpp Enables delayed save-state resume for PICO-8.
main/​mgs_cart.hpp Exposes MGS frame counts for performance monitoring.
main/​main.cpp Integrates settings, USB services, remote control, and resume.
main/​genesis_cart.hpp Enables automatic save-state resume for Genesis.
main/​gba_cart.hpp Enables automatic save-state resume for GBA.
main/​cart.hpp Adds host save/load, deferred quit, and resume handling.
components/​tab5-emu/​src/​usb_msc.cpp Removes the standalone mass-storage implementation.
components/​tab5-emu/​src/​usb_hid.cpp Explicitly selects the USB host controller.
components/​tab5-emu/​src/​usb_device.cpp Implements composite USB and SD ownership transfers.
components/​tab5-emu/​src/​tab5-emu.cpp Adds PSRAM SD buffering and remote button input.
components/​tab5-emu/​src/​coredump.cpp Retains crash dumps for USB retrieval.
components/​tab5-emu/​linker.lf Places USB software buffers in PSRAM.
components/​tab5-emu/​include/​tab5-emu.hpp Exposes composite USB and remote-input interfaces.
components/​tab5-emu/​idf_component.yml Uses the USB dependency branch supporting explicit take-back.
components/​tab5-emu/​CMakeLists.txt Registers the USB buffer linker fragment.
components/​settings/​src/​settings.cpp Implements settings persistence and save-slot tracking.
components/​settings/​include/​settings.hpp Defines versioned settings and synchronized access.
components/​settings/​idf_component.yml Adds the persistent-data dependency.
components/​settings/​CMakeLists.txt Registers the settings component.
components/​rom_info/​src/​rom_info.cpp Maps games to console groups and display metadata.
components/​rom_info/​include/​rom_info.hpp Defines console identities and badge attributes.
components/​mgs/​src/​mgs.cpp Initializes palette caches during game startup.
components/​menu/​src/​menu.cpp Uses checked stdio reads for screenshots.
components/​jk/​src/​jk.cpp Prefers cache-aligned PSRAM for file staging.
components/​gui/​src/​gui.cpp Adds console grouping, badges, settings, and ownership display.
components/​gui/​src/​console_art.cpp Draws console badges and locates optional artwork.
components/​gui/​include/​gui.hpp Declares launcher state and reload interfaces.
components/​gui/​include/​console_art.hpp Declares console artwork helpers.
components/​gui/​CMakeLists.txt Links the launcher to settings persistence.
components/​devlink/​src/​devlink.cpp Registers USB services and preserves panic details.
components/​devlink/​include/​devlink.hpp Defines service integration and guarded flash operations.
components/​devlink/​idf_component.yml Declares diagnostic and dispatcher dependencies.
components/​devlink/​CMakeLists.txt Registers services and panic-handler wrappers.
CMakeLists.txt Includes settings and device-link components.

Review effort: Balanced

Comment on lines +152 to +154
std::lock_guard<std::recursive_mutex> lk(lvgl_mutex());
std::error_code ec;
if (!usb_device_->set_msc_owner(0, espp::UsbDevice::MscOwner::Host, ec)) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 58eebc9: link file requests hold lvgl_mutex() (the lock both hand-over paths take) and are refused while the PC has the card; a new set_before_sd_handover() hook closes the remote writer under that lock before any hand-over, including the launcher switch. The menu loop's settings save takes the lock and skips while the PC has the card.

Comment thread main/remote_control.hpp Resolved
Comment thread main/remote_control.hpp Resolved
Comment thread tools/emulink/emulink/cli.py Resolved
Comment thread tools/emulink/emulink/control.py Resolved
Comment thread main/remote_control.hpp Resolved
Comment thread main/remote_control.hpp Resolved
Comment thread tools/emulink/emulink/cli.py Resolved
Comment thread tools/emulink/emulink/cli.py Resolved
Comment thread tools/emulink/emulink/control.py Resolved
finger563 and others added 2 commits November 11, 2026 17:30
…console

- The link's SCREENSHOT no longer goes through the SD card: the main loop
  takes the game's frame between two frames and holds the game still
  (Cart::capture_hold() pauses the cores with their own tasks: MGS, JK,
  TPM, PICO-8) while SCREENSHOT_READ reads the pixels, so nothing is
  allocated or copied. emulink converts them with a lookup table: a
  screenshot takes 0.3-1.2 s (JK's 640x480 the longest).
- espp routes only stdout to the CDC console: stderr goes there too now.
- espp/usb_device pinned to the #898 merge commit (the branch is gone).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
For performance and memory tests of any core: frames_presented and
frames_dropped (the BSP's counters: displayed fps for every emulator, not
just the ones that count their own frames), internal_min_free and
psram_min_free.

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

New commits since the PR was opened:

  • Screenshots: read straight from the game's frame buffer while the game is held still (Cart::capture_hold() pauses MGS, JK, TPM and PICO-8). No SD card, no allocation, 0.3–1.2 s.
  • stderr now reaches the USB console too.
  • espp/usb_device is pinned to the feat(usb_device): take_msc_from_ejected_host() for devices that stay attached espp#898 merge commit; the branch was deleted.
  • Link status gains frames_presented, frames_dropped, internal_min_free and psram_min_free.

Sweep on the Tab5 (displayed fps over 10 s):

Game fps
Sonic 2, Sonic 3 59.5–59.7
Minish Cap, Mario Kart SC 53.7–55.5
SNES (SMW, DKC, Doom) 29–33
JK 41.7
TPM 18.3
MGS, intro window 9.6

No resets, and menu internal RAM stays at 63–64 KB throughout. Menu PSRAM drops after MGS (about 0.7 MB) and JK (about 1.6 MB) and then stays there; the Tab5 has PSRAM to spare.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

ESP-IDF Size Report for 'Tab5 Emu'

Metric Base PR Delta
FLASH 0 bytes (0.00%) 0 bytes (0.00%) 0 bytes (0.00%)
DRAM 268,638 bytes (60.87%) 267,842 bytes (60.69%) ⬇️ -796 bytes (-0.18%)
IRAM 0 bytes 0 bytes 0 bytes
RAM (DRAM+IRAM) 268,638 bytes 267,842 bytes ⬇️ -796 bytes (-0.18%)

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 2 commits November 11, 2026 19:47
- FILE_LIST pages like LIST_ROMS (path\0offset, reply "next"), so emulink
  ls lists a whole directory instead of stopping at ~69 entries.
- femto8: cart buffers only while they are needed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
p8_init() made a new one per cart and none were freed (92 B of internal
RAM per launch).

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

Comment thread main/remote_control.hpp Resolved
Comment thread components/gui/src/gui.cpp Resolved
Comment thread tools/emulink/emulink/cli.py Resolved
Comment thread updater/main/updater.cpp Resolved
- Link file requests hold the lock the card is handed over under, and are
  refused while the PC has the card; a file being written is closed before
  any hand-over (also the launcher's drive switch). LAUNCH refuses while the
  PC has the card; the menu loop does not save settings meanwhile.
- FILE_READ fails on a seek or read error, FILE_CLOSE (and an implicit close)
  on a write that did not land; emulink pull fails on a short transfer.
- LIST_ROMS budgets its trailer and status byte; SAVE/LOAD reject slots past
  Menu::MAX_SLOT instead of wrapping to 0.
- emulink: reconnects (ota, drive off) stay on the device first resolved;
  log --until matches across reads; add-rom rejects values metadata.csv
  cannot hold.
- Updater: the idle timeout counts from the last request instead of being
  disabled by any packet, and it restarts only if the emulator verifies.
  The updater is part of the flash set (idf.py flash, flash_args).
- Launcher: a reload keeps the selected game (the rebuilt group's first
  focus no longer overrides it); the drive-mode text says to switch off
  after ejecting (an eject alone does not give the card back).
- The soak-test loop polls the link's main queue.

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

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Critical issues leave published firmware without a usable USB OTA updater, risk overwriting existing game metadata after read failures, and allow screenshot races that can cause invalid memory access.

2 open issues
4 previously missed issues

In code that hasn't changed since last review

High severity Build and package the updater for USB OTA

CMakeLists.txt:93

On a clean CI checkout this condition is false: .github/workflows/build.yml only builds the main project, and its firmware ZIP also omits the updater binary. Consequently, the published firmware defines ota_1 but never installs the app needed by ENTER_UPDATER, so USB OTA is unavailable to users flashing those artifacts. Build the updater before configuring the main project and include its binary in the uploaded firmware package.

High severity Pause background cores during file-backed screenshots

main/​remote_control.hpp:318

The file-backed screenshot path does not pause cores that run on their own tasks. MGS can overwrite the captured buffer during the SD write, and Jedi Knight can resize g_last_rgb565 while video_buffer_rgb565() is converting it, causing torn captures or invalid memory access during a resolution change. Hold the core around this capture, as the in-memory screenshot branch already does.

High severity Preserve metadata when SD reads fail

tools/​emulink/​emulink/​control.py:297

This treats every read failure as a missing metadata file. If an existing metadata.csv suffers an SD read error or a short read, execution continues and overwrites it with only the new entry (or an empty list for remove-rom), losing all existing games. Initialize an empty list only for a confirmed file-not-found result; propagate other read failures before attempting a write.

Medium severity Propagate save/load failures and remember slots only on success

main/​remote_control.hpp:300

SAVE and LOAD report success even when the core rejects the operation: MGS can fail to write a state or reject an existing state with an incompatible layout. The Cart helpers discard those results, so emulink reports success and remembers a slot that was not successfully saved or loaded. Propagate the core's result through both Cart helpers, return an error on failure, and remember the slot only after success.

14 resolved since last review

Review effort: Balanced

- SAVE/LOAD (link and pause menu) report a core that rejected the state
  (MGS, TPM, JK), and only a state that landed becomes the resume slot: the
  base save()/load(), which a failing override skips, records success.
- A file-backed screenshot holds cores that draw on their own tasks (MGS,
  JK).
- LAUNCH prefers an exact path or name over the first substring match.
- CI builds the updater first and packages it (and ota_data_initial.bin);
  the README says to build it before the first flash.
- emulink: add-rom only starts a new metadata.csv if there is none (a
  failed read raises instead of rewriting it); a closed link drops a
  half-parsed reply.

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 3's previously missed issues, fixed in 55c7dd4:

  • Updater in CI: build.yml builds updater/ first, so the root build adds it to flash_args / flasher_args.json at ota_1, and the zip includes it and ota_data_initial.bin; the README says to build it before the first flash.
  • File-backed screenshots: the cart is held (capture_hold) around screenshot(path).
  • metadata.csv on a read failure: stat() returns None only for "does not exist", and add_rom() starts an empty list only then; any other failure raises before a write.
  • SAVE/LOAD results: the base Cart::save()/load() (which MGS / TPM / JK skip on failure) records success; save_from_host()/load_from_host() and the pause menu return / check it, and only remember the slot on success; the link reports the failure.

@finger563
finger563 requested a balanced review from Copilot November 12, 2026 15:45
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

Choose a reason for hiding this comment

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

🟡 Changes recommended

GBA and SNES mark state operations complete before core success is known, causing failed loads or saves to be reported as successful and invalid resume slots to be remembered.

3 open issues

Review effort: Balanced

Comment thread main/cart.hpp

virtual void load() {
logger_.info("Base loading...");
state_done_ = true; // (an override that fails does not get here)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 62a03fa: load_gba/save_gba and load_snes/save_snes now return a result (the save via stdio, failing on a short write or a failed fclose), and both carts call the base load()/save(), which marks the state done, only on success. Genesis and PICO-8 call the base first too, but their cores' save/load cannot report failure today, so they stay as they are.

load_gba/save_gba and load_snes/save_snes return whether the core took the
state (and, for a save, whether the file was fully written and closed), and
the carts call the base load()/save(), which marks the state done, only
then: the link and the pause menu no longer report a failed state as saved
or loaded, or make it the resume slot.

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

finger563 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

Hardware test: Tab5 Emu (ESP32-P4) over the USB link (62a03fa)

I ran this on the Tab5 Emu (ESP32-P4) through the USB link with emulink. The firmware went on with emulink ota, and the updater with emulink reboot --bootloader plus idf.py flash. The screenshots come from emulink screenshot and are the game's own frame buffer.

What the session shows:

  • A 1 MB random file goes up with push and comes back with pull with the same SHA-1.
  • pull of a missing file fails.
  • While drive on has given the card to the PC, ls, pull and launch are refused, and all work again after drive off.
  • save 1 → move on → load 1 comes back to the saved frame.
  • Out-of-range slots are refused, and loading an empty slot reports an error instead of passing.
  • The updater boots back into the emulator about 95 s after it was contacted without an update, and a normal OTA still works.

Save/load (screenshots over the link)

SNES: title (state saved to slot 1) SNES: moved on into the game SNES: load 1, back at the title
GBA: Metroid Fusion Genesis: Sonic 2
emulink session (files, drive hand-over, launch, save/load)
$ emulink mkdir /emulink_demo
$ emulink push ./rand_tab5-emu.bin /emulink_demo/rand.bin
/sdcard/emulink_demo/rand.bin
$ emulink ls /emulink_demo
-    1000000 rand.bin
$ emulink pull /emulink_demo/rand.bin ./back_tab5-emu.bin
./back_tab5-emu.bin
$ shasum sent / received
723f69186a95501367881cc5ad463d88c0255ea6
723f69186a95501367881cc5ad463d88c0255ea6
$ emulink pull /emulink_demo/missing.bin ./missing.bin
emulink: /sdcard/emulink_demo/missing.bin does not exist
(exit 1)
$ emulink drive on
the PC has the SD card (/Volumes/ROMS)
$ emulink ls /
emulink: the PC has the SD card (emulink drive off)
(exit 1)
$ emulink launch /sdcard/gba/metroid_fusion.gba
emulink: the PC has the SD card (emulink drive off)
(exit 1)
$ emulink drive off
the device has the SD card again
$ emulink rm /emulink_demo
$ emulink launch /sdcard/gba/metroid_fusion.gba
/sdcard/gba/metroid_fusion.gba
$ emulink press start
$ emulink press a
$ emulink screenshot -o ./game1_a.png
./game1_a.png
$ emulink save 1
$ emulink press right
$ emulink press start
$ emulink screenshot -o ./game1_b.png
./game1_b.png
$ emulink load 1
$ emulink screenshot -o ./game1_c_loaded.png
./game1_c_loaded.png
$ emulink save 99
emulink: slot 99 out of range (0-5)
(exit 1)
$ emulink load 5
emulink: slot 5 has no state, or the game could not load it
(exit 1)
$ emulink quit
updater: USB flash, idle timeout, OTA
# new updater flashed over USB (no BOOT button): emulink reboot --bootloader, then idf.py flash
$ emulink --serial tab5-emu reboot --bootloader      # ROM download port /dev/cu.usbmodem223101 appears
$ idf.py -p /dev/cu.usbmodem223101 flash
Wrote 7217152 bytes (3978312 compressed) at 0x00243000 in 29.4 seconds (1963.5 kbit/s).
Hash of data verified.
Wrote 498624 bytes (277179 compressed) at 0x00d20000 in 1.9 seconds (2115.2 kbit/s).
Hash of data verified.
(the P4 stays in download mode after the RTS reset: esptool --after watchdog-reset chip-id restarts it)

# updater idle test: enter the updater, contact it once, start no update, leave it alone
  0.0s in Tab5 Emu updater (link open = contact, no update)
 96.5s back in Tab5 Emu: v1.0.0-17-g62a03fa-dirty on ota_0

# a normal OTA through the new updater
$ emulink --serial tab5-emu ota build/tab5-emu.bin
done: the device restarts into the new firmware
up: v1.0.0-17-g62a03fa-dirty (Nov 12 2026 18:04:02, elf 86abc0023) on ota_0

Full files: transcript · console log (captured over the CDC console with emulink log during the session; no errors or panics) · updater

🤖 Generated with Claude Code

https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed because critical findings omitted from the published review identify risks of metadata loss and a USB callback race that can cause crashes.

3 open issues

Review effort: Balanced

The USB link refuses to write or delete the running game's ROM (the GBA
core pages it in as it runs), a folder holding it, or the data folder of
JK, MGS and TPM. Same remote_control.hpp as the box.

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 5: no new inline comments here. The box review found one issue that applies to the shared remote_control.hpp: the link could write or delete files the running game still reads. That's fixed here in dabb0a8. While a game runs, the link now refuses the game's ROM (the GBA core pages it in as it plays), any folder holding it, and the data folders of JK, MGS and TPM. Tested on the Tab5: a push into /mgs with MGS running is refused, and a push into /gba with Metroid Fusion running still works.

The open items in the review overview (SD hand-over serialization, the drive-mode wording, save/load results) are the threads already fixed and answered above.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY

Same remote_control.hpp as the box (ENTER_UPDATER #else, narrower
SCREENSHOT variables, std::transform / std::find_if); Cart::remember_slot()
is const; std::fill for the panic backtrace.

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

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed because unpublished findings identify critical data-loss and crash risks involving SD-card errors, screenshot writes, and startup concurrency.

3 open issues

Review effort: Balanced

@finger563
finger563 merged commit 470feb0 into main Nov 13, 2026
2 checks passed
@finger563
finger563 deleted the feat/launcher-features branch November 13, 2026 04:30
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