WIP Running DOOM on Zephyr
The goal is to make a port of next-hack's port of GBADoom for his nRF52840 board, to my Raspberry Pi Pico (T-Pico shop, repo) and ESP32 (T-Display shop, repo) boards using the Zephyr RTOS.
I found these boards on AliExpress form LYLGO and decided that it would be cool to try this, given that they come with a 1.14 inch 135x240 ST7789V display. It is important to point out that I have the 16MB flash variants because I would like to make the whole game playable on them with some controller over Bluetooth (maybe a BLE mouse or I write my own gamepad app with Kotlin?). Additionally, the ESP32 doesn't have a lot of RAM, further optimizations will be needed in order to play more complex levels in addition to the BLE stack on top of all this. The Pico doesn't have any RF capabilities, but the board does have an ESP32C3 on the other side so some "transport layer" between both will be needed (I2C, UART?).
- make it run on
esp32_devkitc_wroom
- fix all the prohibited loads from pointer dereferencing to FLASH
- optimize for RAM to fit levels and BLE stack
- make it run on
native_sim
- add some sort of controller support via BLE
- make audio work
- stream audio via BLE (would require custom implementation) ?
- optimize and cleanup the code
Firstly, you will have to get the Zephyr SDK on your system (Getting Started guide). After you can successfully compile, say their hello_world example, you can build this project by doing the following in your terminal:
for the rpi_pico target:
west build -p=always -b rpi_pico
for the esp32_devkitc_wroom target:
west build -p=always -b esp32_devkitc_wroom/esp32/procpu
for the native_sim target:
west build -p=always -b native_sim
By default west
uses a J-LINK debugger for the rpi_pico
and for the esp32_devkitc_wroom
- the on-board USB to UART converter. You can, of course use whatever method you like with the -r
argument.
west flash
Use the supplied shareware wad, since it includes modifications from the MCUDoomWadUtil
tool in next-hack
's port.
For the rpi_pico
target, the wad is expected at flash offset 0xa3000
, and for
the esp32_devkitc_wroom
target - at offset 0xc2000
The native_sim
target uses the SDL2 library for display drawing and can be ran using:
west build -t run
Ammo shows FPS * 10.