nuttx-apps/games/NXDoom
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
..
pcsound games/NXDoom: Initial port of Chocolate DOOM to NuttX. 2026-06-30 15:22:55 -03:00
src games/NXDoom: draw in the pixel format of the frame buffer 2026-07-31 01:07:59 +08:00
textscreen games/NXDoom: Fix build warnings 2026-07-02 09:08:46 -03:00
.gitignore games/NXDoom: Initial port of Chocolate DOOM to NuttX. 2026-06-30 15:22:55 -03:00
AUTHORS apps/games/NXDoom: Original Chocolate DOOM source 2026-06-30 15:22:55 -03:00
COPYING.md apps/games/NXDoom: Original Chocolate DOOM source 2026-06-30 15:22:55 -03:00
Kconfig games/NXDoom: draw in the pixel format of the frame buffer 2026-07-31 01:07:59 +08:00
Make.defs games/NXDoom: Initial port of Chocolate DOOM to NuttX. 2026-06-30 15:22:55 -03:00
Makefile apps/games/NXDoom: Add support for RTTTL DOOM theme 2026-07-27 13:24:25 -03:00