Skip to content

Soak-test fixes: NES input table, DF fallback, MSX controls and speed, USB link priority - #143

Merged
finger563 merged 13 commits into
mainfrom
fix/soak-fixes
Nov 20, 2026
Merged

finger563 merged 13 commits into
mainfrom
fix/soak-fixes

Conversation

@finger563

Copy link
Copy Markdown
Contributor

Summary

The fixes from tab5-emu's soak tests (esp-cpp/tab5-emu#28) that apply to the box, separate from the UI change. Based on feat/emu-ui (#141); it targets main once that is merged.

Testing

On an ESP32-S3-BOX-3:

  • Two-round soak over emulink: NES, GB, GBC, SMS, GG, Genesis, MSX, Doom, Dark Forces and PICO-8, each launched, played, paused, saved and loaded. Every launch ran, with no panics; internal RAM was flat after Dark Forces' first launch (192 B, its one-time mutexes).
  • 20 NES launches in a row.
  • On the final build: status replies in 0.07-0.12 s in game, and fps reads 29-30.
  • MSX: the start + select chord opens the pause menu without toggling the on-screen keyboard.
  • Settings left as found.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY

gh pr create --repo esp-cpp/esp-box-emu --base feat/emu-ui --head fix/soak-fixes --title "Soak-test fixes: NES input table, DF fallback, MSX controls and speed, USB link priority" --body-file /private/tmp/claude-501/-Users-bob-esp-cpp/454dd7c9-c655-4549-a18a-01e037bd44c9/scratchpad/pr-box-fixes.md 2>&1 | tail -1

finger563 and others added 12 commits November 18, 2026 22:59
The launcher and the pause menu are now emu-ui's (components/emu-ui, a
new submodule shared with tab5-emu) instead of SquareLine exports; gui/
and menu/ keep their APIs and supply the games, the images and the
settings:

- a 24 px status bar (the console chip, the battery), the cover with its
  title, an eight-row list with the console's name over each group, over
  the console's background (an accent, colors and a pattern per console)
- settings on B as one list (with the haptic and Genesis CPU rows), the
  console picker as a grid of tiles (X), button hints along the bottom
- the pause menu: the paused frame, the slot with its screenshot, the
  actions and the settings in one list, over the game's console
- rom_info's ConsoleInfo keeps name, short name and key; the colors and
  the icon are emu-ui's (console_style)
- Montserrat 12 and 16 next to 14

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
The Gui counts the save states in Cart::save_dir() (emu_ui::count_saves)
on each reload and each return from a game, rebuilding the list when
the counts changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
…i tile table, emulink fps

- nofrendo registered its pads again at every NES start and wrote past its
  32-entry input table on the 17th game since boot (a crash on the Tab5)
- Dark Forces' fallback allocations asked for MALLOC_CAP_DEFAULT (internal
  RAM first), not the PSRAM heap its comments describe
- emu-ui: a fixed pattern tile table instead of a std::map
- emulink: the game's frame rate in the status

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
…keys

fmsx feat/start-key:
- Start was fMSX's own menu, which halts emulation. It is now the MSX's F1
  (pause in Konami's games), and Y opens fMSX's menu. Start + select (the
  pause-menu chord) no longer also toggles the on-screen keyboard.
- A frame is an emulated frame, not a drawn one (every other with -skip
  50): muted, MSX games ran at twice their speed, and the fps was per pair
  of frames.
- The on-screen keyboard's F1-F8, Insert, Delete and Stop indexed past
  fMSX's key table; they press the right keys now.

The README describes the MSX controls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
The fixes the Tab5's soak tests found that are not about the launcher and
pause menu (nofrendo's input table, Dark Forces' allocator fallback,
emulink's fps status, the MSX controls) go to a separate PR. emu-ui's tile
table stays here: it is part of the new UI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
…nk fps

- nofrendo fix/input-register-box (cherry-picked onto the box's nofrendo):
  input_register ran at every NES start with no bounds check, so the 17th
  NES launch since boot wrote past nes_input[32] (found on the Tab5, where
  it crashed). It now registers each input once and stops at the table's
  size.
- TheForceEngine fix/psram-fallback: the allocator's fallback is PSRAM
  first, as documented.
- emulink feat/fps-status: status includes the game's frame rate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
…keys

fmsx feat/start-key:
- Start was fMSX's own menu, which halts emulation. It is now the MSX's F1
  (pause in Konami's games), and Y opens fMSX's menu. Start + select (the
  pause-menu chord) no longer also toggles the on-screen keyboard.
- A frame is an emulated frame, not a drawn one (every other with -skip
  50): muted, MSX games ran at twice their speed, and the fps was per pair
  of frames.
- The on-screen keyboard's F1-F8, Insert, Delete and Stop indexed past
  fMSX's key table; they press the right keys now.

The README describes the MSX controls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
emulink fix/devlink-priority: devlink's task ran at priority 0, unpinned
(the idle tasks' level), so it got the CPU only when both cores had nothing
else to do: on the Tab5, while SNES kept core 0 busy, requests went
unanswered for 15-35 s. Priority 5 on core 1, where the display and audio
tasks mostly wait.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
emulink fix/devlink-priority: the status's fps field reported get_fps(),
frames per second of busy time, which reads 100+ for a game paced at 60 Hz.
It is now the frames shown per second over at least a second, restarted for
each game.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
…rame

fmsx feat/start-key: a start + select chord that did not land in one poll
briefly sent F1 or toggled the on-screen keyboard; select now acts on
release unless start joined it, and start is F1 only after 3 polls without
select. The pause image and slot thumbnails come from the last frame handed
to the display.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
Base automatically changed from feat/emu-ui to main November 20, 2026 18:54
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
@github-actions

Copy link
Copy Markdown

✅Static analysis result - no issues found! ✅

@github-actions

Copy link
Copy Markdown

ESP-IDF Size Report for 'Esp Box Emu'

Metric Base PR Delta
FLASH 4,231,728 bytes (67.26%) 4,232,328 bytes (67.27%) 🔺 +600 bytes (+0.01%)
DRAM 170,069 bytes (49.76%) 170,069 bytes (49.76%) 0 bytes (0.00%)
IRAM 0 bytes 0 bytes 0 bytes
RAM (DRAM+IRAM) 170,069 bytes 170,069 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
finger563 merged commit bd47abd into main Nov 20, 2026
3 checks passed
@finger563
finger563 deleted the fix/soak-fixes branch November 20, 2026 19:28
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.

1 participant