About technologies for your digital home

For beginners and tinkerers

Retro Pie – Old Retro Games On a new Raspberry Pi!

October 18th, 2014

Old Retro Games On a new Raspberry Pie

Yes, it is true that, someone decided to turn the Raspberry Pi into a retro-gaming console by writing the emulator adaptations for different types of the old consoles 😉 The project is called Retro Pie and it can be found here.

Installing Retro Pie is a medium complexity project, however you will have a retro game emulator on Raspberry Pie at the end of this post!

Old games console on Raspberry Pie

What is needed for this project?

  • Raspberry Pie (preferable with Internet connection)
  • SD card (2 GB or larger)
  • Retro Pie image
  • USB game pad
  • keyboard
  • HDMI monitor or tv

Amazon (UK) and eBay can you offer pretty big choice of the game pads with the USB connector. After waiting for it from eBay, it finally arrived and the tinkering began 😉

I first tested Nintendo NES USB game pad on Windows, which found the device and installed the drivers without requesting to provide them:

Nintendo USB Gamepad Detection on Windows

As you could see, it became ‘USB Input Device’. In our case, it matters only that it was properly detected and it looks like it works 😉

Let’s move on!

Putting Retro Pie image

As you can guess, everything starts with intalling the Retro Pie image, which you can get from this link. The image is based on Rasbian distro.

After you will get the image, you can follow the instructions given in my older post about Raspberry Pi XBMC. If you already have your preferred method, it should be fine as well 😉

Enable Nintendo Game Pad id 0079:0011 on RetroPie

Booting Retro Pie and detecting the Game Pad

After writing the image, connecting everything together (and to your home network), you should be able to connect to Retro Pie by using a SSH protocol.

In order to check the IP address (which is provided by your home router), you can check on the router itself (screenshot from mine DD-WRT router:
Check IP address of Retro Pie on your router

Here is the information for SSH connection:

user: root

password: raspberry

Once you are connected, you have to do few things.

First of them is to check if your game pad was detected by Linux kernel by issuing the commands:

dmesg | grep Game

[ 3.646488] usb 1-1.2: Product: USB Gamepad
[ 5.999480] input: USB Gamepad as /devices/platform/bcm2708_usb/usb1/
1-1/1-1.2/1-1.2:1.0/input/input0
[ 6.219186] dragonrise 0003:0079:0011.0001: input,hidraw0: USB HID 
v1.10 Joystick [USB Gamepad ] on usb-bcm2708_usb-1.2/input0

Good news, the game pad was recognized by RPi.

Next, you can check if it is functional from USB point by issuing the command lsusb:

root@raspberrypi:~# lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 0079:0011 DragonRise Inc. Gamepad

this means that everything properly works and mine game pad has a HW id 0079:0011.

Further Steps

You should update Retro Pie libraries by going to RetroPie-Setup dir:

cd /home/pi/RetroPie-Setup

and running script ‘retropie_setup.sh’:

sudo ./retropie_setup.sh

which showed such window:

Retro games console On Raspberry Pie RetroPie

After choosing first option ‘Binaries based installation’, RetroPie produced following messages:

Binaries-based installation
 = = = = = = = = = = = = = = = = = = = = =
 = = = = = = = = = = = = = = = = = = = = =
 Installing dependencies for AdvMame
 = = = = = = = = = = = = = = = = = = = = =
 = = = = = = = = = = = = = = = = = = = = =
 Installing dependencies for SNES emulator SNES9X-RPi
 = = = = = = = = = = = = = = = = = = = = =
Get:1 http://archive.raspberrypi.org wheezy Release.gpg [490 B]
Get:2 http://mirrordirector.raspbian.org wheezy Release.gpg [490 B]
.......................................

 

You can leave it your Retro Pie for overnight I’m not kidding, it takes a really long time to update 😉

Enable your gamepad on RetroPie

Next step just to enter the command emulationstation from the terminal

/home/pi/.emulationstation

Just follow instructions on the screen and you should get your game pad working for the navigation on Retro Pie.

The previous steps will enable your game pad only for controlling the navigations (but not for the emulators!).

In order to enable in the emulators, you should do following:

/opt/retropie/emulators/RetroArch/installdir/bin/retroarch-joyconfig -a 
/opt/retropie/emulators/RetroArch/configs/gamepad.cfg

If you do not have some keys present on your game pad, just choose one (already used). That issue will be possible to fix later 😉

Here is the output during the process:

B button (down)
 Joybutton pressed: 2
 Y button (left)
 Joybutton pressed: 2
 Select button
 Joybutton pressed: 8
 Start button
 Joybutton pressed: 9
 Up D-pad
 Joyaxis moved: Axis 1, Value -32767
 Down D-pad
 Joyaxis moved: Axis 1, Value 32767
 Left D-pad
 Joyaxis moved: Axis 0, Value -32767
 Right D-pad
 Joyaxis moved: Axis 0, Value 32767
 A button (right)
 Joybutton pressed: 1
 X button (top)
 Joybutton pressed: 2
 L button (shoulder)
 Joybutton pressed: 2
 R button (shoulder)
 Joybutton pressed: 2
 L2 button (trigger)
 Joybutton pressed: 2
 R2 button (trigger)
 Joybutton pressed: 2
 L3 button (thumb)
 Joybutton pressed: 2
 R3 button (thumb)
 Joybutton pressed: 2
 Left analog X+ (right)
 Joybutton pressed: 2
 Left analog X- (left)
 Joybutton pressed: 2
 Left analog Y+ (down)
 Joybutton pressed: 2
 Left analog Y- (up)
 Joybutton pressed: 2
 Right analog X+ (right)
 Joybutton pressed: 2
 Right analog X- (left)
 Joybutton pressed: 2
 Right analog Y+ (down)
 Joybutton pressed: 2
 Right analog Y- (up)
 Joybutton pressed: 2

Right now, you can fix edit earlier produced ‘gampad.cfg’ by using ‘nano’ editor:

input_player1_joypad_index = "0"
input_player1_b_btn = "2"
input_player1_select_btn = "8"
input_player1_start_btn = "9"
input_player1_up_axis = "-1"
input_player1_down_axis = "+1"
input_player1_left_axis = "-0"
input_player1_right_axis = "+0"
input_player1_a_btn = "1"

You can use Ctr+K to delete a whole line in the ‘nano’ editor.

At the end, you will have to press Ctrl+O to write to a file.

Your game pad is ready to be used!

Installing game ROMs

You can use a SFTP service to transfer the games roms to the RetroPie.

Rom’s location is following e.g. for NES:

/home/pi/RetroPie/roms/nes/

After putting them in this location, everything should work and they should appear by browsing RetroPie menu.

Last Thing – How to Exit the game

If you are in the same situation as I am, where are no spare buttons on the USB NES game pad which could be assigned and used as ‘Exit’ button.

The solution in such situation is to use connected keyboard’s ‘Esc’.

Have fun playing the classics on RetroPie!