Once I saw all the cool stuff people were doing with the Raspberry Pi Zero I decided I had to get in on the action. The Zero was only available in the Netherlands for rediculous prices, until Kiwi electronics got stock for a decent price.
Now I’m a big Nintendo fan and I absolutely love the old purple Game Boy advance, so I figured I might as well combine the two! Here it is!
Fully intended for gaming, it uses RetroPie as OS and loads games from systems like NES, SNES, Megadrive and Playstation. N64 is already getting too heavy for the Zero, so keep that retro to old-retro!
It doesn’t have any battery, but I didn’t intend it to. I have no issues playing games close to a power socket.
Work in Progress
I ordered a Raspberry Pi zero and the PiTFT plus 2.8″ screen from Adafruit, as I calculated that it would exactly fit the GBA shell. I didn’t want to destroy my old GBA, so I also ordered a cheap shell from AliExpress.
Installing the PiTFT already takes a bit of effort, but it’s not rocktet science. Unfortunately, the Pi Zero does not have WiFi, so I needed a cheap USB WiFi dongle to get everything up and running. The new model Pi Zero W does have wireless, so I would pick that one for a future project as it makes your life a whole lot easier. Time for some testing!
As usual, I didn’t read the description of the PiTFT very carefully and only found out it came fully assembled upon arrival. Not a very big problem, but the standard header they use is huge and would never fit the GBA case. I also wouldn’t need the passthrough header, so in the end I just chopped everything off. I wasn’t comfortable enough with desoldering the entire thing, as the header is very close to the screen and I can’t imagine anything good will happen when heating a TFT.
Benefit of the whole operation would also be that I wouldn’t be using the full header of the Pi if I only wired the pins that the TFT actually used.
Which GPIO pins does the PiTFT use?
However, figuring out which pins the header actually used wasn’t very simple. Luckily I stumbled upon this great site in the end, which has a ton of hats with their pinout listed! Some more snooping turned out that wasn’t everything, as apparently the sneaky ID_SC and ID_SD are also used while not listed. So I finally ended up wiring 1, 2, 12, 18, 19, 20 (as ground), 21, 22, 23, 24, 26, 27 and 28.
That is some professional soldering over there.
In the meantime, the case arrived! Step one, chop it up!
Until now, I kept the header on the Zero and the connectors to the wires, so that I could make sure everything worked until I soldered it. Once soldered, it’s harder to fix mistakes.
Next step was making the buttons work. Like most of these kinds of projects (see the PiGRRL zero), the buttons don’t need a separate controller (board), but go directly through the GPIO. I’m not a coding wizard, so luckily Adafruit has us covered there too. You can install the Retrogame software, which translates connecting a GPIO pin to a ground to a button press. You only need to tell which pin corresponds to which keyboard press. Then RetroPie will take care of the rest.
Hooking up the buttons
Another problem of the GBA is that it doesn’t actually have X and Y buttons on the face. To get around that, I installed two additional buttons behind the L and R (so like where L2 and R2 would be), and use those as X and Y. Not always comfortable, but it’s a solution. So after messing around in Retrogame and assigning all buttons, I came up with this fantastic GPIO scheme:
Never mind the colors, they are for my own reference…
Anyway, time for another test!
What came next was a whole lot of soldering and fudging around to make everything fit. Which was not easy I have to say. Most frustrating part was getting the buttons to work properly. If I tightened the screws too much, the B button would jam. Which I solved by cutting of the nibs of the plastic button, inserting it from the outside and glueing it to the switch below. Not a very elegant solution, but at least it works.
Making the D-pad work
The D pad was a whole different story. As my D-pad switches were not level, the UP would jam if I closed the case too tightly, while I couldn’t press the DOWN without pressing LEFT and RIGHT at the same time as well. Much cursing and angryness ensued.
Final solution: cut the D-pad in four with a saw and then pushing them against each other in the frontplate with some rubber in between. Didn’t expect it, but it works like a charm!
[… to be updated…]
Things to do differently
So, am I happy with the result? Well, no. Not really actually. The headers on the PiTFT made things way harder than necessary, just like not having wifi or sound out on the Pi zero.
So I might just tear it apart sometime soon and start again, or put the components into a different project.
These are some things I would definitely do different if I would start all over:
- Don’t use clicky switches, but soft ones. Consoles are not supposed to go clicky-clicky-clicky when playing!
- Those colored wires with the pin connectors are terrific when using them as pin connectors. However, when cutting off the connector and soldering them to a pin, they somehow become incredibly fragile and tend to snap off every once in a while. Don’t use these wires for soldering!
- Use Raspberry Zero W to avoid having to use a wifi dongle.
- Use a non-assembled screen as you can get much better attachment to the Pi and use less space.
- Fix the pi zero to the PiTFT board in some way. Right now it’s just hanging by the wires in the case. Soldering straight to the pins would already solve this.
- Figure out a different solution for the face buttons, as how well they work should not depend on how tight I fix the screws. Maybe fix them to the faceplate instead of the backplate?
- Buy micro-USB-sockets on PCBs. It’s totally utterly completely impossible to solder those tiny wires by hand!!! I had to use a crappy coaxial connector for this one, none too happy with that.
- Get a proper solution for the sound.
- Are pads 22 and 23 on the pi zero actually the same as D+ and D- on the micro connector? Or is it an unofficial 2nd USB port? Something to figure out, would save having to fit a USB hub internally.