P4 Launcher Turns ESP32 Display Boards Into Retrogaming Devices

P4 Launcher Turns ESP32 Display Boards Into Retrogaming Devices

P4 Launcher home screen with app folders on the 7-inch boardThe usual way to host many large programs on an ESP32 is one firmware image per program, flashed into OTA slots, with a reboot to switch. Every new game meant a reflash.

P4 Launcher offers an alternative. Developed by Gil Tal, it is an open source application platform that brings a PC-like experience to ESP32-P4 boards: the launcher stays in flash, and applications are .papp files on an SD card. Pick one from the home screen and it is loaded into PSRAM, relocated, linked to the launcher's services and started. No reflashing, no reboot, no flash wear.

What is P4 Launcher?

Published as ESP32_P4_Launcher on GitHub, the project grew out of Gil Tal's RetroESP32-P4 retro gaming platform. The core idea is the PAPP format, where PAPP stands for PSRAM App: the ESP32-P4 can execute code from PSRAM, so a program doesn't have to live in flash. The launcher treats PSRAM the way a desktop OS treats RAM, and the SD card the way it treats a disk.

Think of a .papp file as a DLL with a main():

  • It is relocatable. It has no fixed load address. The loader patches it to wherever memory is available.
  • It imports services by name. The app declares that it needs, for example, the display interface. The loader checks the launcher provides it and fills in a table of function pointers.
  • It never touches hardware. Apps include no ESP-IDF headers and know nothing about the board. Display, audio, input, files, threads and UI all go through the launcher's versioned interfaces.
  • It can't leave the system broken. Memory, files, threads and surfaces are tracked per app and reclaimed on exit. A hung app can be force-stopped, and a crash is reported with symbols instead of becoming a mysterious reboot.

Twenty-one applications run this way today, including emulators for NES, Game Boy, Game Boy Color, Master System, Game Gear, ColecoVision, PC Engine, Genesis, SNES, Neo Geo, Atari 2600, Atari 7800, Atari 800, Atari Lynx and ZX Spectrum, plus Doom, Quake, Duke Nukem 3D, OpenTyrian, and utility apps for a clock and a file browser.

The same launcher runs on three boards, and the same .papp files and SD card work on all of them:

  • Guition ESP32-P4 4.3" (800x480 MIPI-DSI)
  • Guition JC1060P470C 7" (1024x600 MIPI-DSI)
  • M5Stack Tab5 (1280x720 MIPI-DSI)

Coverage: Adafruit on the PAPP v2 loader and TechEnclave on installable apps and retro games.

What's in the box

The launcher itself is a full application platform, not just a menu:

  • LVGL home screen with app icons, folders that have their own icons, a clock, SD card status and settings, laid out for each board's screen size
  • Compositor: an app draws a surface of any size, and the launcher scales and rotates it with the PPA, tear-free
  • Audio engine: up to 8 streams at any rate from 4 to 192 kHz, resampled and mixed
  • Input manager: USB HID gamepads and keyboards for up to 4 players, with per-controller remapping and a shared mapping database
  • Content browser: All, Favorites and Recent tabs with live search, and per-ROM Run/Resume/Restart/Delete save
  • DevLink: a USB protocol to upload, run, log, screenshot, inject input and read crash reports from the PC
  • Self-update from the SD card or GitHub Releases, with automatic rollback if a new version doesn't start
  • App catalogue: Settings installs and updates published apps over Wi-Fi, checked with SHA-256
  • Wi-Fi and network time through the on-board ESP32-C6, a PIN-protected web file manager for the SD card, a real-time clock where the board has one, and battery level in the system bar

Every emulator gets the same launcher-drawn game menu (Resume, Save, Load, Restart, Delete save, Volume, Exit), and the HOME button pauses any game under that menu. The project's original code is MIT licensed; the emulator cores keep their own licenses.

Performance

All of this runs on an ESP32-P4: dual RISC-V cores at 360 MHz with 32 MB of PSRAM at 200 MHz and 16 MB of flash. Measured results from the project's docs, with FPS meaning finished frames reaching the display:

  • NES-era systems (Game Boy, SMS, Game Gear, ColecoVision, PC Engine, Lynx, Atari 800): full speed at about 60 fps
  • Atari 2600: 60 fps full speed
  • Genesis: about 54 fps, SNES: about 35 fps, Neo Geo: about 32 fps (Metal Slug loads in about 11 seconds)
  • Doom: about 33 fps, Duke Nukem 3D: about 41 fps, Quake: about 20 fps, all on software renderers
  • SD reads: about 11.5 MB/s, and Quake loads in about 70 ms (read 50 ms, relocate 20 ms for 2,332 relocations)

For a microcontroller with no dedicated GPU, that is a long way from "blink an LED."

Compatible hardware in stock at ameridroid.com

The three boards P4 Launcher officially supports (Guition ESP32-P4 4.3", Guition JC1060P470C 7", M5Stack Tab5) are not currently in our store, but can be purchased from their vendors: Guition and M5Stack. In the meantime, the same ESP32-P4 silicon (dual RISC-V, up to 400 MHz, 32 MB PSRAM, 16 MB flash, MIPI-DSI/CSI, USB 2.0 HS) powers several boards we do stock. If you are exploring the ESP32-P4 ecosystem, these are in stock right now:

LILYGO T-Display P4 - $159.95

A handheld ESP32-P4 board with a 4.1" AMOLED touchscreen (568x1232), ESP32-C6 co-processor for Wi-Fi 6 and Bluetooth 5 LE, SX1262 LoRa (915 MHz), rear 2MP camera, GPS, 9-axis IMU, audio, and a companion keyboard. A serious multimedia and edge-AI platform on the same chip family.

LILYGO T-Display P4, 4.1 inch AMOLED ESP32-P4 handheld board

LILYGO T-HaLow-P4 - $41.95

ESP32-P4 with an ESP32-C6-MINI co-processor (Wi-Fi 6 + Bluetooth 5.3) and a TX-AH Wi-Fi HaLow (802.11ah) radio in the 915 MHz band. MIPI-DSI display and MIPI-CSI camera interfaces, H.264/JPEG hardware video. A budget-friendly way to get into the P4.

LILYGO T-HaLow-P4 ESP32-P4 Wi-Fi HaLow development board

CrowPanel Advanced 10.1" ESP32-P4 HMI AI Display - $59.95

A 10.1" 1024x600 IPS touchscreen driven by the ESP32-P4, with Wi-Fi 6, dual speakers, microphone, and an included 2MP MIPI-CSI camera. If you want to see the P4's display pipeline driving a big panel, this is the board.

CrowPanel Advanced 10.1 inch ESP32-P4 HMI AI display

See it in action

The GitHub repo includes real screenshots taken from the running boards, plus the full docs, porting guide and test results:

Bottom line

P4 Launcher is an outstanding software layer for the ESP32-P4 handheld: flash it once on one of the supported boards, drop ROMs on an SD card, and a microcontroller display board becomes a real device with a home screen, fifteen emulators and 3D shooters running from a card. The officially supported boards are available from Guition and M5Stack, and the same-SoC hardware is in stock at ameridroid.com.

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.