A bare-metal Quake 2 port for the ESP32-P4 microcontroller. Features hardware PPA upscaling, PIE SIMD optimizations, USB HID, and Ethernet multiplayer. Based on the portable quake2generic engine by ozkl.
C
7
6 commits
updated Sep 28, 2026
A full Quake 2 port for the ESP32-P4 microcontroller, built on the
portable quake2generic engine with
its software renderer (ref_soft). The classic first-person shooter
runs on a single chip: the game logic, the software 3D renderer and the audio
mixer all run bare-metal on the P4 while the hardware handles the heavy lifting
— Pixel-Processing-Accelerator upscaling and DMA audio.
This port targets the ESP32-P4-Function-EV-Board (with HMI-SubBoard), but
is designed to be easily portable to other ESP32-P4 boards: the P4-specific
logic lives in main/ (display, audio, input, network) behind a thin
hardware-abstraction layer, while the engine in components/quake2 is
board-agnostic — only the OSPI flash/PSRAM config in sdkconfig.defaults and
the BSP calls in main/ need adapting.
320x240 (8bpp
paletted) and is upscaled to 1024x600 on the MIPI-DSI panel via the
ESP32-P4's Pixel Processing Accelerator, freeing the CPU for game logic.
The 8bpp → RGB565 conversion runs on core 1 while the game runs on core 0.p4_memcpy / p4_memset components that
leverage the P4's RISC-V PIE SIMD instructions, applied across the render
hot paths, 2D/model buffers, audio mixing and entity handling.22050 Hz, 16-bit stereo.baseq2/pak0.pak, pak1.pak and pak2.pak from the card.
quake task (engine + software renderer,
producing the 8bpp framebuffer); Core 1 runs the draw task (8bpp → RGB565
conversion + PPA scale → MIPI-DSI panel).vid.colormap/alphamap and the frame
buffer live in internal SRAM for the hottest pixel paths.The engine requires the base game data files, which are not included (they are copyrighted by id Software). You need either the full retail game or the first demo:
Get a copy of pak0.pak, pak1.pak and pak2.pak from the original
Quake 2 (or the demo).
Don't own Quake 2? The shareware demo (
q2-314-demo-x86.exe, freely available online) ships with abaseq2folder containing a playablepak0.pak— just extract it and follow the steps below.
Create a baseq2 folder on the root of a FAT32 MicroSD card and place
the paks inside:
/sdcard/baseq2/pak0.pak
/sdcard/baseq2/pak1.pak
/sdcard/baseq2/pak2.pak
Insert the SD card into the board.
Multiplayer is supported over Ethernet using Quake 2's UDP net code.
map base1).` and type connect <server-ip>.baseq2 paks.idf.py build flash monitor
Contributions are welcome! If you have ideas for improvements, optimizations, bug fixes or new features, feel free to open an issue or submit a pull request.
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!
mem_cpy/memset routines in components/p4_memcpy (original code by BitsForPeople).components/p4_memcpy routines.This project is based on quake2generic by ozkl, licensed under the GNU General Public License v2.0. This port adds ESP32-P4 support, custom hardware integration, platform-specific code and performance optimizations. Please retain the original attribution and license when creating forks or derivative projects.
Licensed under the GNU General Public License v2.0. See the LICENSE file.
The engine is based on quake2generic
(Quake II source by id Software, GPL-2.0). Note: the PIE SIMD routines in
components/p4_memcpy originate from the
esp32p4_memcpy_pie_benchmark
project (code by BitsForPeople), which publishes no explicit license — check
with the original author before reusing that code outside this project.
C
99.1%
A bare-metal Quake 2 port for the ESP32-P4 microcontroller. Features hardware PPA upscaling, PIE SIMD optimizations, USB HID, and Ethernet multiplayer. Based on the portable quake2generic engine by ozkl.
C
7
6 commits
updated Sep 28, 2026
A full Quake 2 port for the ESP32-P4 microcontroller, built on the
portable quake2generic engine with
its software renderer (ref_soft). The classic first-person shooter
runs on a single chip: the game logic, the software 3D renderer and the audio
mixer all run bare-metal on the P4 while the hardware handles the heavy lifting
— Pixel-Processing-Accelerator upscaling and DMA audio.
This port targets the ESP32-P4-Function-EV-Board (with HMI-SubBoard), but
is designed to be easily portable to other ESP32-P4 boards: the P4-specific
logic lives in main/ (display, audio, input, network) behind a thin
hardware-abstraction layer, while the engine in components/quake2 is
board-agnostic — only the OSPI flash/PSRAM config in sdkconfig.defaults and
the BSP calls in main/ need adapting.
320x240 (8bpp
paletted) and is upscaled to 1024x600 on the MIPI-DSI panel via the
ESP32-P4's Pixel Processing Accelerator, freeing the CPU for game logic.
The 8bpp → RGB565 conversion runs on core 1 while the game runs on core 0.p4_memcpy / p4_memset components that
leverage the P4's RISC-V PIE SIMD instructions, applied across the render
hot paths, 2D/model buffers, audio mixing and entity handling.22050 Hz, 16-bit stereo.baseq2/pak0.pak, pak1.pak and pak2.pak from the card.
quake task (engine + software renderer,
producing the 8bpp framebuffer); Core 1 runs the draw task (8bpp → RGB565
conversion + PPA scale → MIPI-DSI panel).vid.colormap/alphamap and the frame
buffer live in internal SRAM for the hottest pixel paths.The engine requires the base game data files, which are not included (they are copyrighted by id Software). You need either the full retail game or the first demo:
Get a copy of pak0.pak, pak1.pak and pak2.pak from the original
Quake 2 (or the demo).
Don't own Quake 2? The shareware demo (
q2-314-demo-x86.exe, freely available online) ships with abaseq2folder containing a playablepak0.pak— just extract it and follow the steps below.
Create a baseq2 folder on the root of a FAT32 MicroSD card and place
the paks inside:
/sdcard/baseq2/pak0.pak
/sdcard/baseq2/pak1.pak
/sdcard/baseq2/pak2.pak
Insert the SD card into the board.
Multiplayer is supported over Ethernet using Quake 2's UDP net code.
map base1).` and type connect <server-ip>.baseq2 paks.idf.py build flash monitor
Contributions are welcome! If you have ideas for improvements, optimizations, bug fixes or new features, feel free to open an issue or submit a pull request.
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!
mem_cpy/memset routines in components/p4_memcpy (original code by BitsForPeople).components/p4_memcpy routines.This project is based on quake2generic by ozkl, licensed under the GNU General Public License v2.0. This port adds ESP32-P4 support, custom hardware integration, platform-specific code and performance optimizations. Please retain the original attribution and license when creating forks or derivative projects.
Licensed under the GNU General Public License v2.0. See the LICENSE file.
The engine is based on quake2generic
(Quake II source by id Software, GPL-2.0). Note: the PIE SIMD routines in
components/p4_memcpy originate from the
esp32p4_memcpy_pie_benchmark
project (code by BitsForPeople), which publishes no explicit license — check
with the original author before reusing that code outside this project.
C
99.1%