Play The Game: Retropie in a Retroflag GPi case

The Retropie project is a wonderful way to play retro games on a Raspberry Pi (see previous post). A number of handheld units are available to make a convincing retro gaming experience. One of these is the Retroflag GPi case, modelled on Nintendo’s Game Boy. It’s possible to order one of these pre-built and even loaded with games, but where is the fun in that? Here is a quick guide to building one.

You will need: a GPi case, Raspberry Pi zero W (I did not use a heat sink), and microSD card. I ordered my stuff from the Pi Hut.

For setting up, it is easiest if you have a monitor, keyboard, and power supply.

  • Download the Retropie image for Pi 0/1.
  • Use Balena Etcher (or similar) to write the img.gz to the microSD card.
  • Put the card into the Pi zero W that is attached to monitor and keyboard and power it up.
  • Retropie will start up, the file system will expand and then Emulation Station will run.
  • Configure the keyboard for basic control of Emulation Station (follow instructions).
  • Setup wifi. Select Retropie from carousel, select Wi-Fi. First, set your Wi-Fi country (it will guide you to launch Raspiconfig), select Localisation Options, change Wi-Fi Country to UK (or wherever you are). Exit and return to Wi-Fi selection. Choose network and enter password.
  • It’s a good idea to change the hostname (especially if you have other retropies on your home network). Do this in raspi-config, select hostname and enter the new name following the instructions.
  • Also, for security, change the default password from “raspberry” to something unique.

Customising your retropie

At this point you can customise the Retropie. For example, you will need to add ROMs for the games you want to play, and you can add a theme. It’s easier to do all this now, before you put it in the case

  • Themes: the one shown above is minijawn from GitHub user pacdude. Install packages like this from Retropie setup in the Retropie menu, Manage Packages. Themes like minijawn are optimised for a small screen.
  • ROMs: Copy any ROMs to the ROMS folder. There are folders for each system that can be emulated, e.g. gba for Game Boy Advance. If you already have a Retropie running you can copy across ROMs (and any progress) using rsync. On a mac you can mount the ROMS folder by opening a Finder window, doing shift + cmd + K and selecting the hostname from the list, then click on ROMS and login as guest.
  • Artwork: Retropie has a scraper that can find the artwork for all of the ROMs you’ve uploaded. Hit Select and then Scrape Artwork. If you have lots of ROMs, it’s best to disable User decides and just set it going.
  • BIOS: for emulators to run smoothly, a BIOS file is required. The little person I made this for was keen to play Pokémon Emerald on Game Boy Advance, so I added a BIOS for Game Boy Advance. Again, you can find them on the internet, but it is worth verifying the hash of the file you get. Note, these bios files are case-sensitive.
% md5 gba_bios.bin   
MD5 (gba_bios.bin) = a860e8c0b6d573d191e4ec7db1b1e4f6
% shasum gba_bios.bin
300c20df6731a33952ded8c436f7f186d25d3492  gba_bios.bin

Install Safe Shutdown and clear the controls

The GPi case can be configured to do Safe Shutdown. This means if you cut the power, the Raspberry Pi will shutdown gracefully.

From EmulationStation, press F4 to drop to the command line and enter:

wget -O - "" | sudo bash

The Pi will restart at the end of this script.

If you configured the keyboard to work with Emulation Station, it is best to delete this configuration, otherwise it will interfere with the GPi case controls. To do this, go to Retropie setup and then Manage Packages -> Core Packages -> emulationstation -> Configuration and choose the option to Clear/Reset Emulation Station input configuration.

We’re almost there. Now, shut down the Pi and remove the microSD card.

Final touches

It’s useful to be able to ssh in to the Pi to troubleshoot. To set this up, insert the microSD card back into your mac and open the Terminal. Change directory to the root directory of the SD card, and make an empty file called ssh there. This is usually:

cd /Volumes/boot/
touch ssh

Finally, and these instructions are with the GPi case, you need to configure the Pi to work with the case. Briefly, download the file, unzip and follow the directions in the README.

Assemble the case

Now, install the Pi zero into the GPi Cartridge Case by following the instructions. Be gentle with the ribbon cable that attaches to the miniUSB port. They advise to insert the microSD card after everything is assembled, but you can put it in during assembly if you’re careful. Opening the rubber cover is a bit fiddly, so it’s easier to insert it early.

Switch the Safe Shutdown switch (inside the battery compartment) to ON.

The case takes 3 x AA batteries or it can be run off a USB cable. Either way, give it some power. Then switch it on and… have fun!

The post title comes from “Play The Game” by Queen from the album “The Game”.