Commit graph

27 commits

Author SHA1 Message Date
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
Matteo Golin
b42589e8e7 games/NXDoom: Fix warnings in i_pcsound module
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>
2026-07-27 13:24:25 -03:00
Matteo Golin
a5c0e9c188 apps/games/NXDoom: Add support for RTTTL DOOM theme
Implements and RTTTL player music module to play the DOOM theme song
over RTTTL.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-27 13:24:25 -03:00
Matteo Golin
26c5dd8305 games/NXDoom: Use dirent for glob implementation
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>
2026-07-09 01:51:54 +02:00
Matteo Golin
3f04a28cbd games/NXDoom: Add LIBC_LOCALE dependency
The locale functions of libc are necessary for some parts of NXDoom.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-09 01:51:54 +02:00
Matteo Golin
c91abf2c8d games/NXDoom: Fix build warnings
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>
2026-07-02 09:08:46 -03:00
Matteo Golin
53bc21feb8 apps/games/NXDoom: Style ignores
Ignore some style/spelling errors in the DOOM port that cannot be fixed.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-06-30 15:22:55 -03:00
Matteo Golin
073188b50d games/NXDoom: Initial port of Chocolate DOOM to NuttX.
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>
2026-06-30 15:22:55 -03:00
Matteo Golin
53ca441b32 apps/games/NXDoom: Original Chocolate DOOM source
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>
2026-06-30 15:22:55 -03:00
simbit18
c7ac717167 game: Aligned Cmake with Make
- Conway's Game of Life #3210

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-11-14 22:40:17 +08:00
Matteo Golin
31d567e880 games/cgol: Add Conway's Game of Life
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>
2025-11-14 14:20:58 +08:00
Eren Terzioglu
f3e1985b1e games/snake: Change consolekey magic numbers with ASCII macros
Change consolekey magic numbers with ascii values to make it more understandable

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-16 10:32:16 +08:00
Eren Terzioglu
9ea3fc6995 games/snake: Fix terminal issue after returning back from snake game
Fix terminal issue after returning back from game

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-16 10:32:16 +08:00
Eren Terzioglu
8b121eb138 games/match4: Add new match4 game
Add match4 game support

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-12 08:38:32 -03:00
Eren Terzioglu
ecd7b84871 games/snake: Enchacements for snake game
Add high score feature into snake game

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-02 10:16:04 -03:00
Eren Terzioglu
60e4052f81 games/snake: Add snake game
Add snake game support to have more demo games to show

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-03-18 17:16:39 -03:00
Eren Terzioglu
8fcff3e88c games/brickmatch: Add led matrix output option
Add led matrix output option for brickmatch game example

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-02-26 11:31:02 -03:00
Eren Terzioglu
9c7e298097 games/brickmatch: Add GPIO input option
Add gpio input option for brickmatch example

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-02-26 11:31:02 -03:00
Alin Jerpelea
f59c5da915 games: migrate to SPDX identifier
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>
2024-12-19 15:25:28 +08:00
Alan Carvalho de Assis
dfea0aad48 apps/games: Rename Shift game to Brickmatch 2023-10-24 13:53:51 +08:00
chao an
4d79a5cbaf add initial cmake build system
Co-authored-by: Daniel Agar <daniel@agar.ca>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-08 13:52:02 +08:00
Xiang Xiao
aa99d267b7 Change the private default signal number to 32
and remove the unused private signal number macro

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-05 03:38:24 -07:00
Nathan Hartman
8e77b79f78 Kconfig: Make indent consistent with TABS 2023-02-10 14:11:48 +08:00
Xiang Xiao
76fece26a2 Fix Error: shift_main.c:763:7: error: variable 'score' set but not used [-Werror,-Wunused-but-set-variable]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-31 06:28:17 +01:00
Xiang Xiao
893387b2c5 Fix the minor style issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 19:07:16 +02:00
Xiang Xiao
4941182cc6 Make.defs: Change "ifeq ($(XXX),y)" to "ifneq ($(XXX),)
to support the tristate option correctly and unify the usage

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 14:59:08 +02:00
Alan Carvalho de Assis
8a177cd797 apps/games: Add shift game 2022-07-31 13:41:43 +03:00