mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
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> |
||
|---|---|---|
| .. | ||
| brickmatch | ||
| cgol | ||
| match4 | ||
| NXDoom | ||
| snake | ||
| .gitignore | ||
| CMakeLists.txt | ||
| Make.defs | ||
| Makefile | ||