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>
This fixes all the warnings in the i_pcsound module caused when enabling
the sound feature Kconfig option. This warnings would prevent CI from
passing.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
NuttX has dirent, so the glob implementation can be used. This removes
the warning for no native glob implementation.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This commit resolves all of the build warnings that were preventing
NXDoom from compiling in CI runs.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This commit includes a (highly) modified version of Chocolate DOOM which
can run on NuttX. The majority of the modifications were made to pass
the NuttX style check. Some small modifications have been added to
support keyboard input, render graphics to frame buffers and directly
use the POSIX interfaces NuttX supplies, stripping out Windows/Mac stuff
and any references to SDL.
NOTE: Sound is currently not supported in any capacity, nor is the
networking stuff. A lot of Chocolate DOOM code was stripped out since it
was unused. If there is a need/desire to add it back later, the original
Chocolate DOOM source can be used as a reference.
WARNING: The NuttX keyboard codec is incredibly non-standard and so
there are problems translating from X11 keys to NuttX ones to play DOOM.
Right now, the CTRL key for firing doesn't work because the NuttX codec
has no concept of it. The NuttX codec should be modified (and other
input devices supported), but at the time of this port I am not
sufficiently comfortable doing so since I am afraid of breaking other
things in the kernel.
NOTE: This port (and likely the original DOOM) seems to be written with
32-bit computers in mind. As such, most things are given the type of
natural `int`, even when a single byte might do. There are significant
size optimizations that could be made to make this more suited to
embedded devices that NuttX typically runs on.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This commit adds the original Chocolate DOOM source which forms a basis
for the NuttX port of DOOM.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
This commit introduces a new application, Conway's Game of Life (or
`cgol`). It is a simple frame buffer rendering application that makes
for an interesting, animated visual.
Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>