/Doom-MCX

Port of popular Doom game to run on NXP MCX microcontrollers.

Primary LanguageCGNU General Public License v2.0GPL-2.0

Doom-MCX

MCX-Doom

A port of prBoom to NXP MCXN MCU running Zephyr RTOS

Hardware

FRDM-MCXN947 LCD-PAR-S035
FRDM Development Board for MCX N947 LCD-PAR-S035 480x320 IPS LCD

Optional Joystick shield on FRDM-MCXN947 Arduino Header

Getting Started

Before getting started, make sure you have a proper Zephyr development environment. Follow the official Zephyr Getting Started Guide.

Initialization

The first step is to initialize the DOOM-MCX Zephyr workspace folder (doom-mcx-workspace) where doom-mcx and all Zephyr modules will be cloned. Run the following command:

# initialize  for the example-application (main branch)
west init -m https://github.com/nxphovergames/doom-mcx --mr main doom-mcx-workspace
# update Zephyr modules
cd doom-mcx-workspace
west update

Building

To build the application, run the following command:

cd doom-mcx
west build -p always -b frdm_mcxn947/mcxn947/cpu0

Flashing

Note

NXP Linkserver v1.5.30 or newer has to be installed.

To flash the application to the FRDM-MCXN947 board. Connect a USB-C cable to the "MCU-Link" USB-C port and run the following command:

west flash

Doom-MCX Controls

Doom-MCX supports 2 types of control either through touchscreen or the Joystick shield.

Touchscreen controls

Open doors/start: Tap "Use Area"
Fire: Tap "Fire Area"
Wake & Strafe Tap and drag in the "Virtual Joystick Area"

Doom-MXC Touch screen layout

Caution

When using the Funduino shield make sure the switch is in 3V3 mode, otherwise you will damage the board.

Joytick Shield controls

Fire: D
Use: C
Walk: Joystick Y-axis
Strafe: Joystick X-axis
Menu: A

Simulation on PC

Zephyr RTOS also provides a native_posix target

To compile as native type:

west build -p always -b native_posix_64

To run type

cd doom-mcx
./build/zephyr/zephyr.elf

native_posix controls

Fire: CTRL
Use: Spacebar
Walk: Up-arrow & Down-arrow
Strafe: Left-arrow & Right-arrow
Menu: ESC

MCX-Doom Native