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
GPi Case 2W - Retroflag
Game Boy inspired Raspberry Pi case. As a homage to the 8-bit handheld game console, Game Boy, not only does it carry the same looks, it also includes additional features like X/Y buttons Compatible with Raspberry Pi ZERO, ZERO Wretroflag.com
Adam Nelson
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!
uxnrpi - A bare-metal port of the UXN virtual machine for the Raspberry Pi 3/4
git.badd10de.devAdam Nelson
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!
GitHub - rsta2/circle: A C++ bare metal environment for Raspberry Pi with USB (32 and 64 bit)
GitHubAdam Nelson
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!
Devine Lu Linvega
in reply to Adam Nelson • • •Adam Nelson
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.
Devine Lu Linvega
in reply to Adam Nelson • • •