nuttx-apps/games
Jorge Guzman 07c1234372 games/NXDoom: draw in the pixel format of the frame buffer
The blit assumed a 32-bit frame buffer:  it wrote a uint32_t per pixel
and converted the palette with ARGBTO32 as it went, so the image came
out wrong anywhere else.  It also drew at the origin, leaving the image
in a corner of a display it does not fill, and indexed the source by the
output column, which costs a division for every pixel of every frame.

Convert the palette once per palette change into the format the frame
buffer actually uses, map output columns to source columns through a
table built at startup, and centre the result.  Output rows that come
from the same source row are copied rather than converted again.

Four options are added, all off by default, so that a board can trade
memory for speed where it pays:

  GAMES_NXDOOM_FB_CMAP blits palette indices and lets a frame buffer
  that has a colour map do the conversion in hardware.

  GAMES_NXDOOM_FILLSCREEN stretches the image over the whole display
  rather than scaling it by a whole number.

  GAMES_NXDOOM_ROWSTAGE builds each row in a staging buffer so that the
  frame buffer only sees burst-friendly copies.

  GAMES_NXDOOM_STATIC_SCRNBUF places the render target in .bss, which
  keeps it out of external memory on a board whose heap is mostly that.

On an STM32H753 driving a 1024x600 panel from SDRAM, the last two are
worth 2.7x together.

Also open the frame buffer with O_CLOEXEC.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-07-31 01:07:59 +08:00
..
brickmatch games/brickmatch: Add led matrix output option 2025-02-26 11:31:02 -03:00
cgol game: Aligned Cmake with Make 2025-11-14 22:40:17 +08:00
match4 games/match4: Add new match4 game 2025-07-12 08:38:32 -03:00
NXDoom games/NXDoom: draw in the pixel format of the frame buffer 2026-07-31 01:07:59 +08:00
snake games/snake: Change consolekey magic numbers with ASCII macros 2025-07-16 10:32:16 +08:00
.gitignore apps/games: Add shift game 2022-07-31 13:41:43 +03:00
CMakeLists.txt game: Aligned Cmake with Make 2025-11-14 22:40:17 +08:00
Make.defs games: migrate to SPDX identifier 2024-12-19 15:25:28 +08:00
Makefile games: migrate to SPDX identifier 2024-12-19 15:25:28 +08:00