Retro-gaming on the Raspberry Pi

February 27, 2015
We are a gaming family. Board games, card games, video games -- we spend a lot of our free time playing in one form or another.

We have various iterations of several different modern consoles attached to TVs throughout our house, but sadly, all of my older games remain boxed. So for this painfully simple Raspberry Pi project, I wanted to add some retro-gaming to our collection.

Project Description
Raspberry Pi logo

Most of the heavy lifting required to build a gaming console has been done by others, which is why this project is such a fast and easy way to leverage your Pi for some old school gaming. The heart of the project is installing Emulation Station, which is a program that lets one computer system (i.e. your Raspberry Pi) behave like another system (e.g. a Super Nintendo). The emulator can in turn run game ROMs, which are game copies stored on your system.

Emulation Station has the capability to emulate a large number of classic gaming systems, though some work better than others, and some require additional configuration. For my retro gaming setup, I'm using the Sega Genesis, Intellivision, Atari 2600, PlayStation, Nintendo, and Super Nintendo emulators on my system, but there are about 20 others that are available. Check out the full list at the PetRockBlog. Emulation Station also gives you the ability to change the UI of your gaming setup with themes, and additionally includes an image scraper to help build your library of game images. Pretty handy.

While Emulation Station forms the core of gaming system, the RetroPie project is the tool that enables for easy installation and configuration of the Emulation Station software on a Raspberry Pi. So the project consists of copying the RetroPie disk image to your microSD card, configuring your system and controllers, adding ROMs, and scraping game images. The rest of the work is done for you thanks to RetroPie and Emulation Station.

Materials Required for the Gaming System
  • Raspberry Pi B+ 512 MB (via Amazon, $28.30)
  • Power supply for the Pi (via Amazon, $6.99)
  • 8 GB Class 4 MicroSD card; if you plan on adding PlayStation games, consider a 16 GB card, but I don't find the PS games emulate very well (via Amazon, $6)
  • USB gaming controllers; I used the linked ones, and they do the job, but I'm not impressed. I'll likely upgrade to wireless in the future. (via Amazon, $9.24)
  • Raspberry Pi case (optional); I used this Zebra Case because I thought it fit the retro theme nicely. (via Amazon, $14.50)
  • HDMI cable
  • Monitor or TV
equipment for the build
Materials Required for the Build
  • MicroSD card reader (via Amazon, $6.29)
  • USB keyboard and mouse; wireless sets will also work. I use a mini keyboard/mouse combo for Pi projects (via Amazon, $12.99)
  • Router and wireless or wired connection
  • Secure File transfer utility. I use WinSCP.
  • Win32 Disk Imager
  • A PC
Building the System
Install RetroPie
Disk Imager dialog

Download the "RetroPie Project SD-card Image for Raspberry Pi 2" (or other image, as appropriate for your build). If you don't already have it installed, download and install Win32 Disk Imager.

A known limitation of Win32 Disk Imager is that it cannot read or write to an SD card that is inserted directly into an onboard card reader on your PC. For this reason, you'll need to insert your SD card into a USB SD card reader, and then plug that into your PC. Once you do that, you'll be able to select the disk image you downloaded, and the drive to which to write the image. Click the write button to begin writing to your card. This process will take several minutes to complete.

Configure Raspberry Pi
Pi configuration menu
  1. Before booting up your Pi, connect the HDMI cable to your monitor/TV, plug in your keyboard/mouse, and plug in one of your USB controllers. Eject the SD card from your PC and insert it into your Raspberry Pi, and then plug in your power supply to boot the Pi.
  2. You'll boot directly into Emulation Station, where you'll be prompted to configure your controller. Ignore this for now, and hit F4 to go to the command line.
  3. Open the configuration menu by typing:

    sudo raspi-config
  4. Menu item one is selected be default, so hit enter to expand the filesystem. You'll see the message "Root partition has been resized." Hit OK to return to the configuration menu.
  5. Cursor down to menu item 4 to change your internationalization options. Here you can change your locale, timezone, and keyboard layout. When you hit Enter, a list of locales is generated. Cursor down and use your spacebar to select/deselect locales. I deselected en_GB and selected en_US.
  6. Cursor down to menu item 7, Overclock, and hit Enter. I chose to set my overclock speed to Medium, but I've heard others who have set it to High without adverse impacts. It will impact system life, however. I also added a heat sink to my Pi, but this probably wasn't necessary for the modest overclocking I selected.
  7. Cursor down to menu item 8, Advanced Options, and hit Enter. On the resulting screen, select SSH, and then pres Enter to enable it. We'll be using it to transfer ROMs and system files.
  8. Select Finish on the configuration menu, and press Enter to reboot.
Configure Controllers
relevant XKCD comic
  1. You'll boot once again into Emulation Station prompting you to configure your controller. Ignore this again, and press F4 to go to the command line.
  2. Open the setup directory by typing:

    cd RetroPie-Setup
  3. Then open the RetroPie setup menu by typing:

    sudo ./retropie_setup.sh
  4. Cursor down to menu item 3, SETUP, and press Enter. On the resulting screen, cursor down to item 322, Register RetroArch controller, and hit Enter.
  5. Take a look at your controller and make a mental note of the button names and placement. When you configure the controllers, the system will quickly prompt you to press a controller button corresponding to what's on the screen. You only have a limited time to make your selection, so it helps to be prepared. While you're looking over your controller, press some of the buttons, and move the directional pad or joystick around randomly to reset the controller. Hit Enter when you're ready to begin configuring your controller, and follow the prompts.
  6. Go back to main RetroPie Setup menu and select item 7 to reboot.
Add Game ROMs

At this point, your retro gaming system is setup and ready for action. But you having nothing to play until you add game ROMs for the emulators to run. And this is where retro gaming becomes sticky.

Game publishers and developers still own the intellectual property rights to these games, even if they're no longer manufactured, so you still need some type of (at least) implicit license to use them. Similar to fair use with music, it is generally accepted that you can make digital copies of games you physically own, with precedence coming from the Supreme Court in Sony vs. Universal City Studios. There are repositories of game ROMs available, but exercise caution when using them. In the United States, it is illegal to download ROMs of games that you don't physically own, though no one yet has been cited or arrested for it. Be sure to scan anything you might download.

  1. If you don't already have it installed, download and install WinSCP or another file transfer utility.
  2. Connect to your Pi with its IP address (obtain this hitting F4 and then typing hostname -I), the username "pi," and password "raspberry."
  3. On your Pi, navigate to /home/pi/RetroPie/roms, and open the appropriate emulator folder. I'm starting with PlayStation games here, and moving them to the PSX folder.
  4. Repeat this process for the consoles and games that you would like to emulate.

Unfortunately, it's not always simple with emulators. Several of the emulators require additional files to run. Below are the two that I ran across:

  • Intellivision: you'll need to add exec.bin and grom.bin to /usr/local/share/jzintv/rom. These folders don't exist, so create them by typing

    sudo mkdir -p /usr/local/share/jzintv/rom
    . Then copy both files into the new rom directory:

    sudo cp exec.bin /usr/local/share/jzintv/rom
    .
  • PlayStation: you'll need to add a PSX BIOS to /home/pi/RetroPie/BIOS. I used scph7502.bin.

Another consideration when emulating retro games is that there were wildly varying controllers for these game systems, so you might need to make accommodations with your style of play. For example, if you remember the old Intellivision controllers, that had a large joy-knob, a full number pad, and buttons on the side. In some cases, I found that a keyboard/controller combination was needed for some of these non-standard controller games.

Here's one of my favorite games running on my RetroPi system:

Mike Tyson's Punchout
Fit and Finish
Game Images

This is an easy way to really improve the UI of your retro-gaming console.

  1. In Emulation Station, press Start on your controller to bring up the Main Menu.
  2. Press A on your controller to select Scraper
  3. Go down to Scrape Now and press A
  4. Under Systems, select the All option
  5. Be sure that "User decides on conflicts" is set to on
  6. Start scraping

If your Rom files are properly named, the scraper should pull a good number of cover images automatically. If it can't find a match, it will give you the option to skip it or search for a match. If it finds more than one match, it will prompt you to select the correct one. Here is the finished product:

Emulation Station UI
Esc Key

To exit each game, you must press the Escape key on a keyboard. I haven't yet been able to figure out how to specify via configuration files how to designate a certain controller combination as an "Exit game" command. Please holler if you have a solution that works!

Build a Mini-cabinet with 2-Player controls

This is perhaps the most detailed Instructable I've ever read.

3D Print your own Gameboy-like Case

Why build a case when you can print one? Try this model.

What the Heck Would Ben Do?

Something awesome.

Ihave heard there are troubles of more than one kind. Some come from ahead, and some come from behind. But I've brought a big bat. I'm all ready, you see. Now my troubles are going to have troubles with me!

- Dr. Seuss

Shaun

Hi, Shaun here. No, not the soccer player. And not the children's performer. Just me, a 40-something father of two, residing in Raleigh, NC, where the summer heat has me questioning my life choices.

I try lots of things. I'm okay at some of them. My hobby is collecting hobbies. I drink a lot of coffee. I'm susceptible to ear worms. I throw myself into the things I love. I can't wait for the weekend.