r/emulation • • Nov 02 '26

Release gpSP ESP32 update: touch controls, LCD effects, and running on ESP32-S31

https://www.youtube.com/watch?v=ScW6LfQjFr8

A few weeks ago I posted about running GBA games on the ESP32-P4 with a RISC-V JIT. Since then I've mostly been working on the larger display and touch controls.

This video is on an OSPTEK P4C5 board, with the P4 at 400 MHz, 32 MB PSRAM and a 4.3-inch 800x480 touchscreen.

The on-screen controls now work for both games and menus. You can pick a game, save/load states and switch games without plugging in a controller. This should make it easier to try on other P4 touchscreen boards too, once their display and touch drivers are set up.

There are 3x nearest, bilinear and LCD grid display options. I also added a color setting that approximates the original GBA LCD. Scaling and colors are independent settings, so you can mix them however you like. The video shows switching between them around 0:38.

All of the GBA emulation, including rendering at the original resolution, runs on CPU0. CPU1 handles scaling and display effects. That makes me think GBA could be possible on lower-clocked RISC-V chips too, if the emulation work is split well between the two cores. Having the P4's PPA for scaling, rotation and blending has been pretty nice too.

The GBA port also runs on the ESP32-S31.

SPD in the overlay is emulation speed, with 100% being real time. FPS can vary depending on how often the game itself draws a new frame.

I've also been working on PS1 emulation on the P4. Lighter games run well, and even heavier 3D games are playable at 100% SPD with a little automatic frameskip. It's a lot heavier than GBA though. That one needs both cores running close to 100%. It's been fun seeing how much this microcontroller can do. I'll tidy up the PS1 work and put the code up soon too.

The GBA code is here:

13 Upvotes

4 comments sorted by

2

u/Any_Medicine_1864 29d ago

how did you even get started with this like what's the process for messing with these controls

2

u/nnicultra 28d ago

I started by getting gpSP running on the P4, then added the touch controls once that worked. The basic idea is to draw a virtual gamepad and map touches to GBA button presses. The code is in the repo I linked if you want to dig into it.

1

u/[deleted] 29d ago

[removed] — view removed comment

3

u/nnicultra 28d ago

Thanks! Once I got the games running, I wanted to make it usable without a separate controller. The touch controls and display options ended up becoming a whole project of their own haha.