Skip to main content


My company had a Pi Day Hackathon, and the project I decided on was to run Uxn on a Pi Zero 2W. Specifically, on this Game Boy-style case, with graphics and controls working: https://retroflag.com/gpi_case_2w.html

It was harder than I expected, and it's still not done!

You'd think it'd be as easy as installing the default Uxn emulator on the Pi, since it already runs Linux. But the GPi Case has a unique driver for its screen, and only a few "retro gaming" distros support it.

#Uxn #RaspberryPi #PiDay

in reply to Adam Nelson

Only Recalbox actually worked out of the box, and it's very difficult to add new apps or libretro cores to it. I could get Batocera to display its splash screen if I copied some overlays and config.txt settings over from the Recalbox SD card.

So I tried something new: get @bd's uxnrpi (https://git.badd10de.dev/uxnrpi) working on the GPi Case. Surprisingly, just using my modified Batocera SD card and replacing its Linux kernel with uxnrpi's kernel8.img worked on the first try!

in reply to Adam Nelson

But uxnrpi doesn't support any input devices, and its ROM is hardcoded. So the next step is to add controller support.

The GPi Case's buttons are connected via USB, as a simulated Xbox controller. On Linux, that's convenient... on bare metal, it's impossible. One forum result suggested that bare metal USB is a "1-2 man-year project".

Luckily, there's a library for that. https://github.com/rsta2/circle is a C++ library for bare metal RPi binaries that includes USB controller drivers!

in reply to Adam Nelson

I have a build that can interact with the controller and the filesystem, but only then did I realize that uxnrpi is 3 years out of date and the Uxn specification has changed. So it can't run any modern ROMs. 🫠

I'll still try to update it this weekend though, maybe I can get it working.

This is it trying it run catclock.rom in Qemu; the sprites are all garbage. Qemu was actually harder to get working than the real hardware!

in reply to Adam Nelson

3 years ago the screen device was pretty early in its development, I'd be happy to help if you wanna bring it up to specs 😀
in reply to Devine Lu Linvega

@neauoire Thanks! Currently I'm replacing the uxnrpi code with the latest uxn code from sourcehut, in the screenshot I was still using the screen functions from uxnrpi.

I'm going to try refactoring uxn.c and uxnemu.c into a C++ class that calls virtual methods on another class for all device interactions; I can get it working with the same SDL setup as the reference interpreter, then swap out the SDL impl for a raspi+circle impl.

in reply to Adam Nelson

that's a good approach it's what I would do too 😀 Let me know if you have questions about how to connect the screen device codebase.

Lo, thar be cookies on this site to keep track of your login. By clicking 'okay', you are CONSENTING to this.