Skip to content

Tietoevry-Create/zephyr-doom

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zephyr-Doom

This is a port of Doom (1993) for Zephyr RTOS.

The project is forked from nrf-doom (commit 2d42413), which is forked from Chocolate Doom version 3.0.0. The objective of this internship project is to develop a Zephyr port of the game, making sure it can run on different System-on-Chips (SoCs). This endeavor will be divided into several stages, presented as Minimum Viable Product (MVP) packages.

Zephyr-Doom has only been tested with shareware version of Doom 1.

Game Status Comment
Doom 1 Shareware OK  
Doom 1 Full Version Not Tested  
Doom 2 Not Tested  
Feature Status Comment
Game data in QSPI flash Done  
Doom game engine running Done  
Devkit button control Done  
GPIO ILI9486 display support Done Currently, there is a limitation on the FPS and the picture is rotated by 90 degrees
SPI ILI9341 display support Done FPS got significantly decreased due to the multiple hw/sw limitations
SPI FT810 display support Done FPS matching nrf-doom performance
BLE game controller Done Transition from the original proprietary radio protocol to BLE using the Nordic UART Service (NUS) for data exchange
BLE HID support In progress Replace NUS communication with BLE HID standard to allow control via gamepad (test with Xbox wireless controller) and keyboard (test with BLE keyboard built on RPi 400)
Game data (SD card to flash) In progress Automatically copy game data from SD card to flash during first start (or on demand)
Game save and load Open Enable save and load functionality to store/restore gameplay progress
Pure Zephyr port Open Modify the code to make it compatible with any Zephyr device that meets the resource requirements by removing nrfx/ncs elements
Basic CI Open Build the code for target platform(s) in GitHub actions
Static analysis Open  
Simulation on PC Open native_posix target
Gamepad calibration Open  
Touchscreen controls Open Use dedicated area of display to control movement and fire
Sound Open  
Multiplayer Open  
Music Open  
Item Version Comment
nRF5340 dev kit 2.0.1 N/A
3,5" ILI9486 display N/A N/A
2.8" ILI9341 SPI display N/A N/A
4.3" FT810 SPI IPS display N/A N/A
micro:bit v2 2.x N/A
joystick v2 2 N/A
Xbox controller model 1914 N/A
keyboard RPi 400 N/A
Item Version Comment
Windows 11 Enterprise 10.0.22631 N/A
Visual Studio Code 1.98.2 N/A
nRF Connect SDK v2.6.2 N/A
nRF Connect for VS Code 2025.1.127 Can be downloaded using the Toolchain Manager found in nRF Connect for Desktop. Alternatively, it can be downloaded directly from inside Visual Studio Code.
Item Version MVP1 MVP2 MVP3 MVP4 MVP5
nRF5340 dev kit 2.0.1 X X X X X
3,5" ILI9486 display N/A X X -- -- --
2.8" ILI9341 SPI display N/A -- -- X -- --
4.3" SPI IPS display N/A -- -- -- X X
micro:bit v2 2.x -- X X X --
joystick v2 2 -- X X X --
Xbox controller model 1914 -- -- -- -- X
keyboard RPi 400 -- -- -- -- X

-- means not supported, X means supported

  1. Install the Visual Studio Code.
  2. Install the nRF Connect for VS Code.
  3. Install the nRF Connect SDK.

Game

  • VS Code -> nRF Connect extension -> Add Folder as Application -> select zephyrdoom folder.
  • VS Code -> nRF Connect extension -> APPLICATIONS -> Add build configuration -> select board target nrf5340dk_nrf5340_cpuapp -> Build Configuration.

Gamepad

  • VS Code -> nRF Connect extension -> Add Folder as Application -> select gamepad\microbit folder.
  • VS Code -> nRF Connect extension -> APPLICATIONS -> Add build configuration -> select board target bbc_microbit_v2 -> Build Configuration.

Game

  1. Connect Nordic Semiconductor nRF5340 dev kit.

  2. Flash data (contains WAD file) to external flash:

    nrfjprog --family nrf53 --qspicustominit --program qspi.hex --verify
    
  3. Select game app. VS Code -> nRF Connect extension -> APPLICATIONS -> Select zephyrdoom.

  4. Flash the game. VS Code -> nRF Connect extension -> ACTIONS -> Flash.

Gamepad

  1. Connect micro:bit v2.
  2. Select gamepad app. VS Code -> nRF Connect extension -> APPLICATIONS -> Select microbit.
  3. Copy file gamepad/microbit/build/zephyr/zephyr.hex to micro:bit (acting as a removable usb device).
  • VS Code -> nRF Connect extension -> CONNECTED DEVICES -> VCOM1 -> Connect to Serial Port.
  • Goal - Port nrf-doom to nRF Connect SDK and get it up and running, with display and basic control using dev kit buttons, under Zephyr RTOS (still with dependency on nRF Connect SDK).
  • Features:
  • QSPI flash
  • Doom engine running
  • Basic display support
  • Nordic Semiconductor nRF5340 dev kit button control
  • Required Hardware
  • Pin mapping
Peripheral Function nRF5340 Pin
Buttons Button 1 P0.23
Buttons Button 2 P0.24
Buttons Button 3 P0.8
Buttons Button 4 P0.9
LEDs LED 1 P0.28
LEDs LED 2 P0.29
LEDs LED 3 P0.30
LEDs LED 4 P0.31
SPI/SD card SS P1.12
SPI/SD card DI P1.13
SPI/SD card DO P1.14
SPI/SD card SCK P1.15
QSPI Memory SCK P0.17
QSPI Memory CSN P0.18
QSPI Memory IO0 P0.13
QSPI Memory IO1 P0.14
QSPI Memory IO2 P0.15
QSPI Memory IO3 P0.16
LCD Bit 1-2 P1.10 - P1.11
LCD Bit 3-8 P1.04 - P1.09
LCD RST P0.25
LCD CS P0.07
LCD RS P0.06
LCD WR P0.05
LCD RD P0.04
  • Goal - Integrate a Bluetooth Low Energy (BLE) game controller to enable game control through a micro:bit-based gamepad. This addition will enhance the gaming experience by allowing players to utilize the micro:bit as a game controller via wireless connectivity.
  • Features:
  • BLE game controller
  • Required Hardware
  • Pin mapping
Peripheral Function nRF5340 Pin
Buttons Button 1 P0.23
Buttons Button 2 P0.24
Buttons Button 3 P0.8
Buttons Button 4 P0.9
LEDs LED 1 P0.28
LEDs LED 2 P0.29
LEDs LED 3 P0.30
LEDs LED 4 P0.31
SPI/SD card SS P1.12
SPI/SD card DI P1.13
SPI/SD card DO P1.14
SPI/SD card SCK P1.15
QSPI Memory SCK P0.17
QSPI Memory CSN P0.18
QSPI Memory IO0 P0.13
QSPI Memory IO1 P0.14
QSPI Memory IO2 P0.15
QSPI Memory IO3 P0.16
LCD Bit 1-2 P1.10 - P1.11
LCD Bit 3-8 P1.04 - P1.09
LCD RST P0.25
LCD CS P0.07
LCD RS P0.06
LCD WR P0.05
LCD RD P0.04
  • Goal - Migrate from current display (connected via GPIO) to SPI one. Support full screen.
  • Features:
  • New display
  • Full screen
  • Required Hardware
  • Pin mapping
Peripheral Function nRF5340 Pin
Buttons Button 1 P0.23
Buttons Button 2 P0.24
Buttons Button 3 P0.8
Buttons Button 4 P0.9
LEDs LED 1 P0.28
LEDs LED 2 P0.29
LEDs LED 3 P0.30
LEDs LED 4 P0.31
QSPI Memory SCK P0.17
QSPI Memory CSN P0.18
QSPI Memory IO0 P0.13
QSPI Memory IO1 P0.14
QSPI Memory IO2 P0.15
QSPI Memory IO3 P0.16
SPI/ILI9341 SCK P1.15
SPI/ILI9341 MOSI P1.13
SPI/ILI9341 MISO P1.14
SPI/ILI9341 CS P1.12
  • Display supporting > 30FPS
  • Full screen
  • Required Hardware
  • Pin mapping
Peripheral Function nRF5340 Pin
Buttons Button 1 P0.23
Buttons Button 2 P0.24
Buttons Button 3 P0.8
Buttons Button 4 P0.9
LEDs LED 1 P0.28
LEDs LED 2 P0.29
LEDs LED 3 P0.30
LEDs LED 4 P0.31
QSPI Memory SCK P0.17
QSPI Memory CSN P0.18
QSPI Memory IO0 P0.13
QSPI Memory IO1 P0.14
QSPI Memory IO2 P0.15
QSPI Memory IO3 P0.16
SPI/FT810 Display SCK P0.06
SPI/FT810 Display MISO P0.05
SPI/FT810 Display MOSI P0.25
SPI/FT810 Display CS_N P0.07
SPI/FT810 Display PD_N P0.26
  • Goal - Add option to connect BLE gamepad (Xbox wireless controller) and ideally BLE keyboard (built on RPi 400). This step will enable full game control (i.e. all the options).
  • Features:
  • If using BLE gamepad - TBD.
  • If using BLE keayborad - full-fledged game control per original manual (inc. cheats).
  • Required Hardware
  • Pin mapping
Peripheral Function nRF5340 Pin
Buttons Button 1 P0.23
Buttons Button 2 P0.24
Buttons Button 3 P0.8
Buttons Button 4 P0.9
LEDs LED 1 P0.28
LEDs LED 2 P0.29
LEDs LED 3 P0.30
LEDs LED 4 P0.31
QSPI Memory SCK P0.17
QSPI Memory CSN P0.18
QSPI Memory IO0 P0.13
QSPI Memory IO1 P0.14
QSPI Memory IO2 P0.15
QSPI Memory IO3 P0.16
SPI/FT810 Display SCK P0.06
SPI/FT810 Display MISO P0.05
SPI/FT810 Display MOSI P0.25
SPI/FT810 Display CS_N P0.07
SPI/FT810 Display PD_N P0.26

N/A

N/A

MVP1

  • N/A

MVP2

  • FPS increase.
  • Moved from proprietary radio com between gamepad and game to BLE com.

MVP3

  • N/A

MVP4

MVP1

  • Low FPS (~8).
  • Picture is rotated by 90 degrees. Plus, we are not using full display area.

MVP2

  • Low FPS (~14).
  • Picture is rotated by 90 degrees. Plus, we are not using full display area.
  • BLE game controller requires manual setting of offsets (hard-coded) to eliminate drift. Calibration procedure could help to address this issue.

MVP3

  • Low FPS (~5).

MVP4

  • N/A

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 99.8%
  • CMake 0.2%