Repository navigation
Soak-test fixes: NES input table, SNES buffer, DF fallback, MSX controls and speed, USB link priority - #28
Merged
Merged
Conversation
The launcher and the pause menu are now emu-ui's (components/emu-ui, a new submodule shared with esp-box-emu); gui/ and menu/ keep their APIs and supply the games, the images and the settings: - consoles as tabs along the top, the list with the console's name over each group, the selected game's cover, console, title and Play, over the console's background (an accent, colors and a pattern per console) - settings in a panel from the right (B or the gear), 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) - the keypad: an object flagged LV_OBJ_FLAG_USER_1 gets up / down as keys too (emu-ui's list, rows and picker), not only left / right Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
…flowed 6 KB Opening the settings panel builds its rows inside LVGL's key event, on the Gui task's timer (the esp_timer task), and overflowed its 6 KB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
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
The pause menu held 1.2 MB of PSRAM for its two screenshots while the game ran; Jedi Knight's level load needs every MB. They are allocated (heap_caps_malloc: no throw, no screenshot if there is no room) when the menu opens and freed when it closes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
ALWAYSINTERNAL=256 sent every allocation of 256 bytes or less to internal RAM first (the comment said the opposite): the emu-ui launcher's game titles, every small std::string and map node. With the new launcher that left Metal Gear Solid ~500 bytes of DMA memory and a black screen, and drifted internal RAM down per console shown. As on the box, code that needs internal or DMA memory asks for it explicitly. Launcher: internal free 47 -> 82 KB, DMA-capable 8 -> 43 KB; in MGS 53 / 14 KB (was 17.6 / 0.5 KB); a 19-game soak keeps internal RAM flat. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
A function-local static vector kept 112 KB (up to 478 KB in hi-res) in the middle of the PSRAM heap after the game, cutting its largest free block from 6.4 to 3.7 MB for good. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
nofrendo registered its pads again at every NES start and wrote past its 32-entry input table on the 17th game since boot (a load fault in mmc_peek / retrieve_type). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
…he status Dark Forces' fallback allocations (and the std::string / map template copies other code links from its library) asked for MALLOC_CAP_DEFAULT, internal RAM first. After the fix three DF launches leave internal RAM flat (only the first launch's two mutexes stay, as on the box). 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 soak tests found that are not about the launcher and pause menu (nofrendo's input table, SNES's screenshot buffer, Dark Forces' allocator fallback, emulink's fps status, the MSX controls) go to a separate PR. This one keeps the fixes for what the new UI itself caused: the pause menu's screenshot buffers, plain malloc in PSRAM first (with the new launcher, MGS had no DMA memory left) and emu-ui's tile table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
A function-local static vector kept 112 KB (up to 478 KB in hi-res) in the middle of the PSRAM heap after the game, cutting its largest free block from 6.4 to 3.7 MB for good. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
nofrendo fix/input-register: input_register ran at every NES start with no bounds check, so the 17th NES launch since boot wrote past nes_input[32] and crashed. It now registers each input once and stops at the table's size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
…he status Dark Forces' fallback allocations (and the std::string / map template copies other code links from its library) asked for MALLOC_CAP_DEFAULT, internal RAM first. After the fix three DF launches leave internal RAM flat (only the first launch's two mutexes stay, as on the box). 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 (espp::Task's default, the idle tasks' level), so it got the CPU only when both cores had nothing else to do: while SNES, or GBA's Zelda in play, kept core 0 busy, status and the other requests went unanswered for 15-35 s (the game itself ran on). Priority 5 on core 1, as TinyUSB's task: replies in 0.1-0.2 s during both, and Metal Gear Solid, whose threads are priority 5 on core 0, is unaffected (9.7 fps). 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 (on the Tab5 counting the video task's blits too), 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 (a run now ends in the middle of drawing the next). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
finger563
added a commit
that referenced
this pull request
Nov 20, 2026
main's tree is 91b1772's, which this branch already contains, so the result is this branch's tree; the gui conflicts were the squashed copies of #26's changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
finger563
added a commit
that referenced
this pull request
Nov 20, 2026
README conflicts: the layout block main edited now lives under Development (its menu/ line updated there), and the MSX controls from #28 join the per-game controls after Star Trek. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
ESP-IDF Size Report for 'Tab5 Emu'
FLASH uses app .bin size or json2 flash sum. RAM sums DRAM+IRAM via idf_size. Percentages shown when totals are available. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bugs the soak tests of #26 found that are not about the new UI. Based on
feat/emu-ui(#26); it targetsmainonce that is merged.input_registerran at every NES start with no bounds check and wrote pastnes_input[32].fpsis the frames shown per second (a first version reported the cores' busy-time statistic, 100+ at 60 Hz).Testing
On a Tab5:
Known and unchanged by this PR: JK and ScummVM have no save states (
emulink savefails, as before).🤖 Generated with Claude Code
https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY