Repository navigation
boards/spresense: Add the nxdoom configuration. - #20774
Conversation
|
Updated the dependencies: the screen wipe PR (#3870) is closed in favour of apache/nuttx-apps#3860. This needs #3860 and apache/nuttx-apps#3869 merged first. |
|
|
Awesome! Was super cool to see you get this working at Community over Code! |
|
@wwlapaki310 please run |
Document GAMES_NXDOOM_UARTKBD, which lets a board without a keyboard driver read the keys from a serial terminal, with the key bindings and the 250 ms release of each key. The option is added to nuttx-apps by a separate pull request. Assisted-by: Claude:claude-sonnet-5-5 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: satoru akita <wwlap24@gmail.com>
Add a configuration that plays NXDoom on a Spresense with an ILI9340 display attached to the extension board, and describe it in the board documentation. * The display is used as a frame buffer through LCD_FRAMEBUFFER, at 320x240 in landscape. * The keys are read from the serial console (GAMES_NXDOOM_UARTKBD). * The WAD file lives in the on-board SPI flash, which is mounted at /mnt/spif and filled over the console with rz. * The board has 1.5 MB of RAM, so the screen wipe is disabled and the render buffer is placed in .bss. * The console UART receive buffer is raised from 256 bytes to 8 KB, because the default overruns while rz writes to the flash. The board page describes the whole procedure: getting a WAD file, sending it with rz, checking its size and starting the game. This depends on the GAMES_NXDOOM_UARTKBD option added to nuttx-apps by a separate pull request. GAMES_NXDOOM_NOWIPE is already in nuttx-apps. Tested with the one-level Squashware IWAD. Assisted-by: Claude:claude-sonnet-5-5 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: satoru akita <wwlap24@gmail.com>
26b39ee
600334b to
26b39ee
Compare
|
@xiaoxiang781216 Ran it: no diff with apache/nuttx-apps#3869 applied. Without it only |
|
Thanks for the review! Updated as above. |
🔗 Cross-repo PR dependenciesThe read-only Build run reported the following dependent PR(s) and fetched head SHA(s): CI run: https://github.com/apache/nuttx/actions/runs/39269037885 |
Summary
Add a configuration that plays NXDoom on a Spresense with an ILI9340 display attached to the extension board, and document it.
Depends-On: apache/nuttx-apps/pull/3869
Please merge apache/nuttx-apps#3869 first. This configuration uses the option it adds (
CONFIG_GAMES_NXDOOM_UARTKBD); without it the option is silently ignored and the game cannot be controlled.Getting NXDoom to run on the Spresense took three steps:
CONFIG_LCD_FRAMEBUFFERat 320x240 in landscape;up_fbinitialize()already callsboard_lcd_initialize(), so no driver code is needed. The WAD file is kept in the on-board SPI flash (/mnt/spif) and sent over the console withrz.CONFIG_GAMES_NXDOOM_UARTKBD, added to nuttx-apps by a separate pull request).CONFIG_GAMES_NXDOOM_NOWIPE, added by the memory improvements in games/NXDoom: memory improvements nuttx-apps#3860, a separate pull request by another author that is already merged).Other boards that play NXDoom, for example
linum-stm32h753bi, have a keyboard driver and enough RAM, so they did not need steps 2 and 3.The configuration is
spresense:lcdplus the NXDoom settings, with the screen wipe disabled, the render buffer in.bss, andrzenabled. The console UART receive buffer is raised from 256 bytes to 8 KB, because the default overruns whilerzwrites to the flash. Therzerror limit, buffer sizes and connect time were raised together with it when the transfer failed; I did not test which of these changes are strictly needed.Documentation is in two commits: the serial terminal keys option on the NXDoom page, and the procedure (getting a WAD, sending it, starting the game) on the Spresense page.
Related nuttx-apps pull requests: serial terminal keys (apache/nuttx-apps#3869, not merged yet) and the memory improvements with the screen wipe option (apache/nuttx-apps#3860, merged). Reviews of the configuration and the documentation are welcome while #3869 waits to be merged.
Impact
nxdoomsection; the NXDoom page describes the new serial terminal keys option.Testing
Result: the game starts on a Spresense, is shown on the display and is played with keys sent over the serial console, at about 19 to 20 frames per second. Demo video: https://youtu.be/ikh1EEGco8Q
Host: Windows 11, build in a Docker container (Ubuntu 24.04),
arm-none-eabi-gcc13.2.1, on the current nuttx and nuttx-apps master (which includes apache/nuttx-apps#3860) with apache/nuttx-apps#3869 applied.Board: Spresense main board with the extension board and an ILI9340 display, with the Sony loader v3.4.3 installed.
Built from scratch with
./tools/configure.sh spresense:nxdoom && make, flashed withflash_writer, and the one-level Squashware IWAD (672906 bytes) sent withrz -p /mnt/spif:The game is shown on the display. From keys sent over the console, a new game was started, and the player could move, turn, fire and use. The frame rate was about 19 to 20 frames per second while playing, measured with a temporary counter. The documentation was built with Sphinx and the new sections render.
The flash area that holds the WAD is 4 MB, so the shareware
DOOM1.WAD(about 4.2 MB) does not fit in it; only the one-level Squashware IWAD was tried.PR verification Self-Check