In the latest issue of The MagPi, out now, David Crookes takes a look at a device based around Raspberry Pi Pico that emulates the Sega Mega Drive and lets you play homebrew games.
Although there are many handheld retro game consoles based around Raspberry Pi devices, we still want to play with more. They help to keep the memories of old machines and titles alive, while providing the perfect opportunity to dive into a project and learn more about what is going on under-the-hood.
It’s this desire to understand that has driven Daniel Kammer to create Pico Held, a beautiful, open-source handheld with a Raspberry Pi Pico board at its heart. “There is so much you can learn from creating DIY projects,” he says. “By making it open-source, it also gives others the opportunities to learn – maybe they’ll help to improve Pico Held in the future.”
Before getting down to work, Daniel came up with some goals. “I wanted an appealing design, a screen big enough to play games on, a nice speaker for sounds and music, and a device powered by Raspberry Pi Pico – an amazing piece of hardware with a balanced set of features,” he explains.
There were clear reasons for this. “A small screen and subpar speaker kind of defeats the whole point of having a gaming device in the first place,” he notes. This prompted Daniel to hunt for the largest, low-cost screen possible. “A 3.2-inch display was the biggest IL19341 I could get on AliExpress,” he says, but the goals posed a host of challenges.
Since Daniel custom-made a PCB and 3D-printed a case, he needed everything to fit. “I had to align the button holes to the PCB contacts, make sure the LCD was nicely centred, and the analogue stick was fitting,” he explains. “I also found it quite challenging not to exceed a thickness of 12 mm. For every flaw, I made a new PCB and new case!”
In the end, sacrifices needed to be made. “My prototype had four buttons, but I decided to go for three and use an analogue stick instead of a D-pad,” he says. “I also wanted to design the Pico Held in a way that others could build it too. That was a big constraint.”
To be this good
Developing the software proved even more challenging. Daniel wanted his handheld to play retro games, so he modified a Sega Mega Drive emulator called Gwenesis by bzhxx. “I had to fiddle with the endianness [the order in which bytes are stored] and the RAM/ROM handling,” he recalls. “It was pretty frustrating because virtually all errors were hard faults.”
The result has been an emulator running Mega Drive games more slowly than intended, but Daniel says lots of games still remain playable. “Sound was a bit trickier: I had to make the sound generation per frame/per line rather than per cycle, and that causes the sound to be flawed in a lot of games.” Daniel has also been able to run a NES emulator on his device: “It runs at full speed,” he tells us.
More than that, Daniel wants people to create their own games. “The Pico Held’s software library was written with the idea of allowing people to create classic pixel art games with 256 colours,” he reveals. “Creating the blitter and the tile map blitter in the software library for this purpose kept me busy for days.”
Yet, it’s been worth the effort. “Some have said the analogue stick isn’t well-suited for this kind of game device, and some want four buttons,” he says, confessing that he isn’t actually really into gaming. “But the reactions have been surprisingly positive. I was really glad about that!”
The MagPi #133 out NOW!
You can grab the brand-new issue right now from Tesco, Sainsbury’s, Asda, WHSmith, and other newsagents, including the Raspberry Pi Store in Cambridge. It’s also available at our online store which ships around the world. You can also get it via our app on Android or iOS.
You can also subscribe to the print version of The MagPi. Not only do we deliver it globally, but people who sign up to the six- or twelve-month print subscription get a FREE Raspberry Pi Pico W!
The free PDF will be available in three weeks’ time. Visit the issue page for more details.