Raspberry Pi Setup

With all of that hardware setup out of the way, you're ready to setup the Raspberry Pi! Don't close the case up until we're completely finished here!

  • Download the RetroPie SD image (you can read about the features of the RetroPie SD card image here!) for your Raspberry Pi version.
  • Load it onto your SD using one of the common SD card utilities -- Win32DiskImager for Windows, ApplePi-Baker for OS X or plain old dd on LinuxHere's an in depth guide to getting your SD card setup.

(If you see a message saying "Illegal Instruction" when starting Emulationstation, it's possible that you installed the wrong SD card image. You'll know there's a problem because instead of loading ES, you'll be dropped right into a command line on your first boot.)

  • Emulationstation will prompt you to train it for your inputs, so go ahead and assign them! Give those awesome new Game Gear controls their first offical presses!
  • Now, enter the menu and shutdown ES. We need to complete some system setup stuff so we can get the most out of the system.
  • Run sudo raspi-config and select Expand Filesystem.
  • Reboot, and quit ES again!

It helps a lot to do these configurations via SSH, so plug in your Ethernet cable and bring up your eth0 interface. The built in screen will be hard to read until we make a few changes. If you're really having trouble, you can temporarily plug in an HDMI cable (this will disable the built in screen) and use a regular monitor.

There are tons of things that you can configure in RetroPie, and there are guides on the RetroPie wiki. Highly reccomended that you give these a look through and see if they can answer any questions. This guide here will only give you the basics to get going.

One caveat to know going in, your Emulationstation bindings you set a little while ago do not work in the actual emulators themselves, those are set in the RetroArch configs. This guide covers that a bit later.

Keyboard Configuration

If you're in the U.S., you'll notice that pressing Shift-3 gives you a British Pound symbol (If you're on the local console, this shouldn't affect SSH). This is because the default keyboard layout is set to the Raspberry Pi's home country of the United Kingdom!

A quick and easy way to change it to a U.S. layout is to run this command:

sudo pico /etc/default/keyboard

You'll be greeted with this file:

# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="gb"
XKBVARIANT=""
XKBOPTIONS=""

BACKSPACE="guess"

Navigate to the line that says XKBLAYOUT="gb", and change it to "us", like so:

# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS=""

BACKSPACE="guess"

 

Config.txt

Next up, we have to configure the Rasperry Pi's video output to best match our little screen. Replace the lines at the top of the config.txt with the lines shown below. Don't overwrite the whole file though, just this block.

 (You may need to adjust your overscan values slightly. Play with them to create the best results.)

sudo pico /boot/config.txt
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=0

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
overscan_left=-26
overscan_right=-26
overscan_top=-16
overscan_bottom=-16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
framebuffer_width=320
framebuffer_height=240

Joystick Bindings

You have to now modify some of the configuration files for RetroArch and Dgen. This guide does not cover the many other possible configurations, just these. The configurations also allow for a USB joypad to act as your player two in any RetroArch supported emulator.

retroarch.cfg

 You can find the retroarch.cfg file in:

/opt/retropie/configs/all/

Scroll down to the input/keyboard section (it's a long file...) called "Keyboard input." and replace input_playerX block with the following:

# RetropieJoyConfig 
input_player1_joypad_index = "0"
input_player1_b_btn = "1"
input_player1_y_btn = "5"
input_player1_select_btn = "8"
input_player1_start_btn = "9"     
input_player1_up_btn = "h0up"
input_player1_down_btn = "h0down"
input_player1_left_btn = "h0left"
input_player1_right_btn = "h0right"
input_player1_a_btn = "0"  
input_player1_x_btn = "4" 
input_player1_l_btn = "5"  
input_player1_r_btn = "4" 
input_player1_l2_btn = nul
input_player1_r2_btn = nul
input_player1_l3_btn = nul
input_player1_r3_btn = nul
input_player1_l_x_plus_btn = nul
input_player1_l_x_minus_btn = nul
input_player1_l_y_plus_btn = nul
input_player1_l_y_minus_btn = nul
input_player1_r_x_plus_btn = nul
input_player1_r_x_minus_btn = nul
input_player1_r_y_plus_btn = nul
input_player1_r_y_minus_btn = nul
  
input_player2_joypad_index = "1"
input_player2_b_btn = "0"
input_player2_y_btn = "3"
input_player2_select_btn = "10"
input_player2_start_btn = "9"
input_player2_up_btn = "h0up"
input_player2_down_btn = "h0down"
input_player2_left_btn = "h0left"
input_player2_right_btn = "h0right"
input_player2_a_btn = "1"
input_player2_x_btn = "2"
input_player2_l_btn = "4"
input_player2_r_btn = "5"
input_player2_l2_btn = nul
input_player2_r2_btn = nul
input_player2_l3_btn = nul
input_player2_r3_btn = nul
input_player2_l_x_plus_btn = nul
input_player2_l_x_minus_btn = nul
input_player2_l_y_plus_btn = nul
input_player2_l_y_minus_btn = nul
input_player2_r_x_plus_btn = nul
input_player2_r_x_minus_btn = nul
input_player2_r_y_plus_btn = nul
input_player2_r_y_minus_btn = nul

Make sure all other input_playerX lines are commented out with a #, as they may conflict with this configuration.

dgenrc

This file is located in the same directory as the retroarch.cfg. Open it up, and scroll down to "# Joystick/joypad definitions for pad 1" area.

Replace the entire joy_pad1 block with the following:

joy_pad1_up = joystick0-hat0-up
joy_pad1_down = joystick0-hat0-down
joy_pad1_left = joystick0-hat0-left
joy_pad1_right = joystick0-hat0-right
joy_pad1_a = joystick0-button0
joy_pad1_b = joystick0-button1
joy_pad1_c = joystick0-button4
joy_pad1_x = joystick0-button3
joy_pad1_y = joystick0-button5
joy_pad1_z = joystick0-button6
joy_pad1_mode = joystick0-button8
joy_pad1_start = joystick0-button9

Then, replace the entire joy_pad2 block with the following:

joy_pad2_up = joystick1-hat0-up  
joy_pad2_down = joystick1-hat0-down
joy_pad2_left = joystick1-hat0-left
joy_pad2_right = joystick1-hat0-right
joy_pad2_a = joystick1-button0
joy_pad2_b = joystick1-button1
joy_pad2_c = joystick1-button2
joy_pad2_x = joystick1-button3
joy_pad2_y = joystick1-button4
joy_pad2_z = joystick1-button5
joy_pad2_mode = joystick1-button8
joy_pad2_start = joystick1-button9

These may require some small tweaks depending on what kind of Player 2 Joypad you want to keep around, namely the button numbers. The Player 1 configurations match what the Teensy is configured to send. Edit it to your liking!

Last updated on 2015-05-04 at 04.27.07 PM Published on 2015-03-02 at 01.18.29 PM