Skip to content
Home » Retro Computing » Setting up Retropie on the Raspberry Pi

Setting up Retropie on the Raspberry Pi

I bought a Raspberry Pi over the weekend intending to turn it into a retro gaming system. I’d rather not have a mess of systems and cartridges out for my kids to tear up and to constantly have to switch around at their whims; a deck-of-cards-sized console with everything loaded on a single SD card seems much more appealing.

I followed Lifehacker’s writeup, which mostly worked. My biggest problem was my controllers. NES and SNES games would freeze seemingly at random, which I later isolated to trying to move to the left. It turned out my Playstation-USB adapter didn’t get along with the Pi at all, and was registering the select and start buttons when I tried to move certain directions, pausing the game.

When I switched to a Retrolink SNES-style pad, the random pausing went away. The precision reminded me of the really cheap aftermarket controllers of yore for the NES and SNES. I concluded my controller, which I bought used, was worn out. Ultimately I ended up switching to a Logitech controller, which worked well.

Lifehacker missed a few things. The option they presented for getting ROM image files onto the Pi works on all platforms, but involves a clunky SFTP client that nags you to register. For the majority of us who have at least one Windows machine, there’s an easier way: Plug the Pi into the network, hit your Start button and type \\raspberrypi and hit <enter>. Up pops a collection of directories for every platform it supports. Drag ROMs into the appropriate directories and the Pi incorporates them into its menus. Very nice. (For that matter a Linux box can connect to SMB shares graphically using Nautilus and I’m pretty sure there must be a way to do something similar from a Mac GUI.)

If you want or need to stay off the wire, I understand you can simply plug a USB stick into one of the USB ports, and it will write directories to it. Unplug the USB stick, plug it into a computer, and write ROMs into the appropriate directories. Be sure to unzip them first. Then, any time you plug the USB stick into the device, it syncs the ROMs up.

I’ll leave finding ROMs to you. If you’re interested in emulation, you probably know where to get those. But be careful–sites that use their own downloaders to, ahem, “ensure your download is faster and virus-free” are probably trying to install spyware. If you want to be on the safe side, there are plenty of homebrew games out there for retro systems that you can download directly in usable format, with no risk of spyware and no legal issues either.

The other thing Lifehacker misses is configuring the controller for the emulators themselves. After you get the device booted up, plug it into the network. Try connecting to the network name raspberrypi via SSH with a program like PuTTY (the default username is pi and the password is raspberry), or if that doesn’t work, plug a keyboard into the device, exit the  and enter the command ifconfig eth0 to find its IP address and connect to that with PuTTY. Once you’re connected, enter the following two commands:

sudo mv /opt/retropie/configs/all/retroarch.cfg /opt/retropie/configs/all/retroarch.cfg.bak
nano /opt/retropie/configs/all/retroarch.cfg

Then paste in the following (a configuration that worked fine for Playstation controllers and the Retrolink SNES-style pad):

system_directory = /home/pi/RetroPie/roms/../BIOS
config_save_on_exit = false
video_aspect_ratio = 1.33
video_smooth = false
video_threaded = true
rewind_enable = false
rewind_buffer_size = 10
rewind_granularity = 2
input_rewind = r
video_gpu_screenshot = true
video_shader_dir = /opt/retropie/emulators/RetroArch/shader/
joypad_autoconfig_dir = /opt/retropie/emulators/RetroArch/configs/
input_player1_joypad_index = 0
input_player1_b_btn = 2
input_player1_a_btn = 1
input_player1_y_btn = 3
input_player1_x_btn = 0
input_player1_l_btn = 4
input_player1_r_btn = 5
input_player1_start_btn = 9
input_player1_select_btn = 8
input_player1_l_y_plus = -1
input_player1_up_axis = -1
input_player1_l_y_minus = +1
input_player1_down_axis = +1
input_player1_l_x_minus = -0
input_player1_left_axis = -0
input_player1_l_x_plus = +0
input_player1_right_axis = +0
input_enable_hotkey_btn = 8
input_exit_emulator_btn = 9
input_enable_hotkey_btn = 8
input_save_state_btn = 4
input_enable_hotkey_btn = 8
input_load_state_btn = 5
input_player2_joypad_index = 1
input_player2_b_btn = 2
input_player2_a_btn = 1
input_player2_y_btn = 3
input_player2_x_btn = 0
input_player2_l_btn = 4
input_player2_r_btn = 5
input_player2_start_btn = 9
input_player2_select_btn = 8
input_player2_l_y_plus = -1
input_player2_up_axis = -1
input_player2_l_y_minus = +1
input_player2_down_axis = +1
input_player2_l_x_minus = -0
input_player2_left_axis = -0
input_player2_l_x_plus = +0
input_player2_right_axis = +0
input_enable_hotkey_btn = 8
input_exit_emulator_btn = 9
input_enable_hotkey_btn = 8
input_save_state_btn = 4
input_enable_hotkey_btn = 8
input_load_state_btn = 5

Hit <ctrl-x> to save the file.

For extra points, skip nano and use the vi editor, preferred by Unix professionals, instead. I’m admittedly not a Unix superstar, and they taught me nano in college, so I stick with that.

This configuration allows you to quit a game and return to the menu by hitting select + start on the controller, so you don’t need to keep a keyboard attached.

All in all, it’s an inexpensive project (I got the Raspberry Pi on sale for $30, the enclosure was $8 or you can print a cardboard one, and an 8 GB Class 10 SD card was $6–I had an old phone charger on hand that I used for a power supply but you can get one for around $5) and it’s a good way to get Unix practice. In the end it costs more than a used Wii, unless you have most of the stuff laying around already, but you’ll learn a lot more and you can always get extra SD cards, build other cool stuff with the Pi, and plug in whatever card you want to suit your needs at the moment. I found Retropie connected to my 32-inch LCD TV gives a nice family room gaming experience–it plugs right into the TV and takes up less space than two game cartridges of any vintage.

Due to the limited processing power of the Pi–it’s roughly equivalent to a 300 MHz Pentium II with a modern low-end graphics card bolted on–it struggles to emulate late 1990s game systems, but it does a fine job of emulating 8-bit and 16-bit systems.

Retropie gets a lot of usability things right, but the default configuration keeps it from being completely n00b-friendly. It took me a few hours to get it right, but if you start out with a good gamepad and how to connect to it with a Windows box, you’ll waste a couple fewer hours than I did.

If you found this post informative or helpful, please share it!

2 thoughts on “Setting up Retropie on the Raspberry Pi”

Comments are closed.

%d bloggers like this: