NES on ESP32-P4 with MIPI-DSI

tangstone
Posts: 2
Joined: Thu Aug 06, 2026 6:28 pm

NES on ESP32-P4 with MIPI-DSI

Postby tangstone » Thu Aug 06, 2026 6:43 pm

https://github.com/tangstoney/esp32p4-n ... ADME_CN.md

https://youtu.be/vCaPCH94INk?si=UREuSRQMkMkgFjyC

A proof-of-concept NES emulator running on the ESP32-P4 Function EV Board driving a 7-inch 1024 x 600 MIPI-DSI panel. The emulator core is nofrendo; everything below it — video output, input and audio — is a new OSD (glue) layer written against ESP-IDF v6.0 and the esp_lvgl_adapter component.

Three things make this port different from the classic ESP32 nofrendo examples:

Video does not go through LVGL rendering. The LVGL adapter is put into dummy-draw mode, and the emulator blits its own RGB565 frames straight into the DSI frame buffer. LVGL stays initialized and can take the screen back at any time.
Input is an on-screen virtual gamepad drawn into the letterbox bars beside the 4:3 game picture — no extra hardware, no wiring, multi-touch (you can hold a direction and press A/B at the same time).
The audio clock paces the emulator. The blocking I²S write is the only frame limiter in the system: 16 kHz / 60 fps = 266 samples per frame, so when the I²S DMA queue is full the emulator task simply blocks. No vTaskDelay, no timer, no drift between picture and sound.
Because the LVGL v9 + esp_lvgl_adapter stack is left fully intact, this project also works as a worked example of how to hand a display over to a CPU-driven renderer without tearing LVGL down.

Status: POC. Stages 0–3 (build, video, touch, audio) are all verified on real hardware — picture, buttons and sound all work. Stage 4 has not started; see Project Status.

The main goal is to revamp Espressif's old NES emulator demo and fill the gap online for ESP32-P4 compatibility. It's already 2026, and I hope everyone has a blast playing retro games on touchscreens
p4-ev-board.jpg
p4-ev-board.jpg (914.22 KiB) Viewed 2 times
p4-ev-nes-demo.jpg
p4-ev-nes-demo.jpg (3.68 MiB) Viewed 2 times

Who is online

Users browsing this forum: No registered users and 0 guests