Skip to content

alexkid77/ESP32P4DOOM

Repository files navigation

ESP32P4Doom

ESP32-P4 DOOM ESP-IDF

A complete independent bare-metal DOOM port for the ESP32-P4 microcontroller. Unlike other versions, this project is fully decoupled from official vendor BSP components, implementing its own lean hardware abstraction layer for maximum performance and control.

Key Improvements

  • Decoupled Architecture: Removed dependency on esp32_p4_function_ev_board. All hardware drivers (I2C, I2S, SDMMC) are implemented natively in bsp_p4_eval.c.
  • SD Card WAD Loading: Full support for loading .wad files from a MicroSD card. The system automatically searches both internal SPIFFS and the SD card.
  • PPA Hardware Scaling: Internal 320x200 rendering upscaled to 1024x600 MIPI DSI display via the ESP32-P4's Pixel Processing Accelerator, freeing the CPU for game logic.
  • Micro-Mixer Audio: A dedicated 16-bit PCM Software Mixer broadcasting over I2S to the onboard ES8311 codec for high-fidelity SFX.
  • USB HID Support: Direct plug-and-play support for standard USB keyboards.

Features

  • Project Structure: Cleaned and renamed entry point to main.c.
  • Hardware Abstraction: Custom bsp_p4_eval handles:
    • I2C: Touch (GT911) and Audio Codec (ES8311) control.
    • I2S: Standard Philips mode for audio data.
    • SDMMC: High-speed 4-line SD card interface.
  • Bilingual Cleanliness: Codebase refactored with all comments and logs standardized to English.

Game and Mod Loading (WADs)

The engine features an automatic detection system for game files:

  • With SD Card: The system prioritizes reading from the root of a FAT32 MicroSD card. It looks for base games in this order: doom2.wad -> doom.wad -> doom1.wad.
    • Chiquito Mod: If the file chiquito.wad is placed on the SD card alongside a base game, the engine will automatically load it as a PWAD (-file). This replaces the standard audio with the legendary sounds of Spanish comedian "Chiquito de la Calzada".
  • Without SD Card: If no SD card is detected, the engine falls back to the internal SPIFFS memory, loading the default DOOM 1 Shareware (doom1.wad).

Missing Features / To-Do

The following features are currently missing from this port:

  • Network (Multiplayer)
  • Music

Requirements

  • ESP32-P4-Function-EV-Board (or custom P4 hardware with similar pinout).
  • USB Keyboard (connected via USB-H port).

Build and Flashing

  1. WAD Location: Place your .wad files on the SD card or flash them to the spiffs partition.
  2. Compile and Flash:
idf.py build flash monitor

About the Developer

Developed and optimized for the ESP32-P4 by Alejandro Villegas Alonso. If you are interested in embedded systems, ESP-IDF development, or want to discuss professional opportunities, feel free to connect!

Credits and Acknowledgements

License

Licensed under GPLv2.

About

DOOM port for the ESP32-P4

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages