Pico Pocket Gamer

By Nicola King. Posted

While reminiscing about a retro electronic game called Lights Out (a puzzler with a grid of lights), Grgo Mariani realised he could make his own updated version with an unused Raspberry Pi Pico.

“I remember how I used to play it while visiting my family and think about working out a perfect strategy to solve each new puzzle. Since I recently became a father, I wanted my son to have this experience as well, but unfortunately, I could not find a shop where I could buy this product anywhere,” he recounts. This was the push he needed to start creating, and the result is a rather fun little games machine that is simple enough for a newbie.

Newcomers welcome

As the hardware encompasses just a Pico, a 320×240 touchscreen display, and five mechanical switches, Grgo sees this as a very achievable make. All that’s required is connecting several Pico pins to the display and mechanical switches. “No resistors, no capacitors, no battery, no external power supplies… I would call this beginner-level,” he confirms. While he designed a custom PCB to streamline his mini console, he says this is optional.

On the software side, he’s created a simple engine to handle the key and touch inputs, update the game state, and draw to the frame buffer in a loop. “Each game shares one 320×240 frame buffer for drawing and one 64×64 texture buffer. There is also a 16kB space used for game state memory,” he explains.

So far, he has created 14 games for the device, including his versions of Snake, Pong, and of course, Lights Out, and took a flexible approach to game development. “The end design became much more than that one single game, as I really took an agile approach while building it.”

He wrote most of the open-source code himself while modifying a few parts from other projects – in particular for handling communication with the display. “I also adapted the ray casting algorithm [for] my Labyrinth game.” He emphasises that, from a coding perspective, he’s not using any advanced capabilities of Pico here.

Apart from finding the time, as a new parent, to spend on his project, Grgo found that the most difficult element was choosing the right display and constantly rewiring the breadboard to adapt to the new pinouts. “It took me several months to find the right display… PCB design is also something I never did before, so I had to learn it from scratch.”

Take a look at his useful YouTube video, which shows him putting the device together.

Favourable feedback

The response received around the Pico Pocket Gamer has been super-positive, and Grgo’s been bowled over by the reaction by some members of the Reddit community. “Some people already DM‑ed to ask me how they can replicate the project. It brings me joy to think that I might have ignited a spark in someone to give their Pico, and some new project they have in mind, a try.”

As for future projects, Grgo doesn’t have any concrete plans yet, but confirms, “it will have something to do with the Pico W, that’s for sure.” One thing he would really like to do is to implement some of the algorithms from Michael Abrash’s Graphics Programming Black Book, and make a simple 3D game using them. He plans on adding more games to this console, and has been buoyed along by the momentum of creating each game: “With every game finished, there was this drive to build just one more.” And surely that’s a sentiment that many makers can empathise with.

From The MagPi store


Subscribe to the newsletter

Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.