alexkid77/openlara_esp32p4

A high-performance port of the classic Tomb Raider engine (OpenLara) for the ESP32-P4. Delivers 30 FPS via software rendering with fully integrated audio.

0

stars

2

commits

C

primary language

Sep 6, 2026

updated

embedded
esp32
esp32-p4
openlara
port
retro-game
retro-gaming
retrogaming
software-render
software-renderer
software-rendering
tomb-raider
tombraider

README

OpenLara ESP32-P4

A port of OpenLara to the ESP32-P4-Function-EV-Board. Runs the classic Tomb Raider 1 engine with software rendering, audio, and USB HID keyboard input on Espressif's latest RISC-V SoC.

Author: Alejandro Villegas Alonso

Features

  • Software RGB565 renderer at 320x240, hardware-scaled to 1024x600 via the PPA (Pixel Processing Accelerator)
  • 44.1 kHz stereo audio via I2S + ES8311 codec
  • USB HID keyboard input (boot protocol)
  • GT911 capacitive touch (I2C)
  • MicroSD card (SDMMC 4-bit) for game data
  • MP3 (minimp3), OGG (stb_vorbis) and zlib (tinf) decode support
  • On-screen FPS counter (F12 toggle)
  • Custom health/oxygen HUD overlay

Demo

OpenLara ESP32-P4 Demo

Hardware Requirements

ComponentDetails
BoardESP32-P4-Function-EV-Board
SoCESP32-P4, RISC-V dual-core @ 400 MHz (chip rev < 3.0)
Flash16 MB
PSRAM32 MB (SPIRAM, HEX mode, 200 MHz)
Display1024x600 MIPI DSI LCD (EK79007)
TouchGT911 capacitive (I2C)
AudioES8311 codec via I2S
StorageMicroSD card (SDMMC 4-bit)
InputUSB HID keyboard (required)

Building

Prerequisites

  • ESP-IDF v5.4+ (tested with v5.4.4 / v5.5.5)
  • riscv32-esp-elf toolchain

Build & Flash

# Set up ESP-IDF environment
. $IDF_PATH/export.sh

# Build
idf.py build

# Flash (adjust port as needed)
idf.py -p /dev/ttyUSB0 flash monitor

Game Data

You must provide your own Tomb Raider 1 data files (.PHD levels, .PCX images, cutscenes) inside a data folder on the MicroSD card. The game will not run without them.

Controls

A USB keyboard must be connected to the board.

KeyAction
Arrow keysMovement / Camera
CtrlAction (draw weapon, grab, interact)
ShiftWalk
AltStep / Look
SpaceJump
F12Toggle FPS counter

Technical Notes

  • Software rendering is based on the MS-DOS flavor of OpenLara (not the GL renderer), using the header-only gapi/sw.h engine compiled as C++11
  • Near-plane clipping patch applied for the software renderer
  • FreeRTOS dual-core with a 1000 Hz tick; the audio pump task runs on core 0
  • All game memory is allocated from PSRAM; internal SRAM is reserved for DMA and task stacks
  • Saves and cache are written to the SD card

Credits

License

OpenLara is licensed under the GPL-3.0.

Contributors

alexkid77

2 commits

alexkid77/openlara_esp32p4

A high-performance port of the classic Tomb Raider engine (OpenLara) for the ESP32-P4. Delivers 30 FPS via software rendering with fully integrated audio.

0

stars

2

commits

C

primary language

Sep 6, 2026

updated

embedded
esp32
esp32-p4
openlara
port
retro-game
retro-gaming
retrogaming
software-render
software-renderer
software-rendering
tomb-raider
tombraider

README

OpenLara ESP32-P4

A port of OpenLara to the ESP32-P4-Function-EV-Board. Runs the classic Tomb Raider 1 engine with software rendering, audio, and USB HID keyboard input on Espressif's latest RISC-V SoC.

Author: Alejandro Villegas Alonso

Features

  • Software RGB565 renderer at 320x240, hardware-scaled to 1024x600 via the PPA (Pixel Processing Accelerator)
  • 44.1 kHz stereo audio via I2S + ES8311 codec
  • USB HID keyboard input (boot protocol)
  • GT911 capacitive touch (I2C)
  • MicroSD card (SDMMC 4-bit) for game data
  • MP3 (minimp3), OGG (stb_vorbis) and zlib (tinf) decode support
  • On-screen FPS counter (F12 toggle)
  • Custom health/oxygen HUD overlay

Demo

OpenLara ESP32-P4 Demo

Hardware Requirements

ComponentDetails
BoardESP32-P4-Function-EV-Board
SoCESP32-P4, RISC-V dual-core @ 400 MHz (chip rev < 3.0)
Flash16 MB
PSRAM32 MB (SPIRAM, HEX mode, 200 MHz)
Display1024x600 MIPI DSI LCD (EK79007)
TouchGT911 capacitive (I2C)
AudioES8311 codec via I2S
StorageMicroSD card (SDMMC 4-bit)
InputUSB HID keyboard (required)

Building

Prerequisites

  • ESP-IDF v5.4+ (tested with v5.4.4 / v5.5.5)
  • riscv32-esp-elf toolchain

Build & Flash

# Set up ESP-IDF environment
. $IDF_PATH/export.sh

# Build
idf.py build

# Flash (adjust port as needed)
idf.py -p /dev/ttyUSB0 flash monitor

Game Data

You must provide your own Tomb Raider 1 data files (.PHD levels, .PCX images, cutscenes) inside a data folder on the MicroSD card. The game will not run without them.

Controls

A USB keyboard must be connected to the board.

KeyAction
Arrow keysMovement / Camera
CtrlAction (draw weapon, grab, interact)
ShiftWalk
AltStep / Look
SpaceJump
F12Toggle FPS counter

Technical Notes

  • Software rendering is based on the MS-DOS flavor of OpenLara (not the GL renderer), using the header-only gapi/sw.h engine compiled as C++11
  • Near-plane clipping patch applied for the software renderer
  • FreeRTOS dual-core with a 1000 Hz tick; the audio pump task runs on core 0
  • All game memory is allocated from PSRAM; internal SRAM is reserved for DMA and task stacks
  • Saves and cache are written to the SD card

Credits

License

OpenLara is licensed under the GPL-3.0.

Contributors

alexkid77

2 commits

Languages

C

71.7%

C++

28.2%