element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Legacy Personal Blogs My Raspberry Pi - Game Console Emulator
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Former Member
  • Date Created: 19 Jan 2013 3:55 PM Date Created
  • Views 3390 views
  • Likes 2 likes
  • Comments 14 comments
  • emulator
  • retro
  • raspberry_pi
  • members_featured_project
  • game_consoles
  • game_controllers
  • raspberry_pi_accessories
Related
Recommended

My Raspberry Pi - Game Console Emulator

Former Member
Former Member
19 Jan 2013

I love old console games... I am not that much into old arcade games, but console games like Mario and Sonic I find amazing. For the same reason it annoys me that I cannot buy old NES or SNES games on my Xbox 360. I understand that they don't want to sell them on the competitors platform, but it still annoys me that I cant play them.

This was my motivation behind building my own multiple console system emulator based on a Raspberry Pi. I wanted a platform, with original gamepads, which I could play Nintendo Entertainment System, Super Nintendo and Sega Master System II games on. Here is how to do it if you want your own ...

 

The parts ...

The Raspberry Pi is pretty amazing it already comes with a HDMI port and two available USB ports - so its pretty perfect for building a small emulator like this. Here are the parts that I purchased for my emulator:

 

  • 1x Raspberry Pi (Rev B)
  • 1x 4GB Memory Card for the Raspberry Pi
  • 1x Micro USB Power Supply for Raspberry Pi
  • 1x Black Raspberry Pi Enclosure
  • 2x Awesome Retro USB NES Gamepads
    • You can get them here: http://www.amazon.com/Classic-USB-NES-Controller-PC/dp/B002YVD3KM/ref=pd_bxgy_vg_img_y and they are dirt cheap

 

All in all I spend around $80 on hardware which is pretty darn cheap if you ask me!

(Later on a spent an extra 5 bucks on a external reset button - but more on that in a later post)

 

image

First boot ...

To get started with the Raspberry Pi you need to flash the memory card with the Raspbian "wheezy" OS. There are 100 guides on that so I wont bore you with it here. Once you get the booted run the setup script (sudo raspi-config) and make sure you:

 

  • Resize the filesystem
  • Change the locale
  • Change the keyboard layout
  • Setup 128MB memory split

 

Also on your first boot - update the Raspberry to the latest firmware and install some useful packages:

 

sudo apt-get update

sudo apt-get upgrade -y

sudo apt-get install -y git dialog vim

 

Accessing the Pi from another computer

Its pretty easy to contact your Pi from another computer on the same network ... simply ssh to raspberrypi like this:

 

ssh pi@raspberrypi

 

When asked the default password is raspberry.

 

Enabling sound over HDMI on the Raspberry Pi

Enabling sound over HDMI in the Pi is done in the /boot/config.txt file. Open it in your favourite editor (I recommend VIM (apt-get install vim)) and find the line: hdmi_drive=X make sure its it set to:

 

hdmi_drive=2


 

Save the file.

Installing the emulators

This is where the fun starts. I used hours and hours on compiling, cross-compiling and emulator compiling to find the best emulators that didn't take weeks to compile. I found that it is possible to compile a descent set of emulator in less than 2 hours on the Pi. The same emulators can be compiled using an emulator on your Ubuntu in about 40 minutes - but its not worth it because it is difficult to move to the Raspberry Pi afterwards.

 

The absolute best and easiest way to setup your emulators is using the RetroPie-Setup project. petrockblog did an absolute amazing job in finding the best emulators that work on the Raspberry Pi and putting them together in one easy to use setup script. He even added a pretty cool interface for navigating through the emulators on your TV.

 

Setting up RetroPie is simple - follow these steps:

 

cd ~

git clone --depth=0 git://github.com/petrockblog/RetroPie-Setup.git

cd RetroPie-Setup

chmod +x retropie_setup.sh

sudo ./retropie_setup.sh

 

Now follow the directions on the screen for installation and upgrade - here are some recommendation to the default setup:

  • In the "Installation and upgrade" screen - disable ALL emulators that you do not intent to use.
    • This step will bring the compile time down significantly. If you do not disable some of the emulators you will not get under 2 hours of compile time.
  • If you already updated the Raspberry Pi disable the steps "Update APT repository" and "Perform APT Upgrade"
  • Once you press OK - find something else to do while it compiles.
    • Watching it compile will make the wait feel longer!
    • You could watch the video of my project: http://www.youtube.com/watch?v=JSMvRf_eVak

Post installation setup

After the emulator installation there are a few steps we need to take before we can start playing ... but first make sure everything works. To test that everything works we need to add a game image or ROM to the Raspberry Pi. The roms must be put in the appropriate directory under "~/RetroPie/roms/".

 

****

About game roms:

Please know that downloading game "roms" from the Internet is illegal.

Instead you can extract roms of of old cartridges you actually own using projects like this: http://familab.org/blog/2012/12/snes-super-nintendo-emulated-system/

Please respect the rights of the game developers!

****

 

Put a ROM into the appropriate directory under ~/RetroPie/ and start the emulator ui with: emulationstation.

 

If everything worked as expected do the following to complete the setup.

Add Gamepad Configurations to RetroArch emulator

The RetroArch emulator will be the base emulator for most of the consoles you wish to emulate... so we need to configure the gampads.

 

  • Open the file ~/RetroPie/configs/all/retroarch.cfg.
  • Find the "#### Input" section and add the following:

 

input_player1_a_btn = 1

input_player1_b_btn = 2

input_player1_start_btn = 9

input_player1_select_btn = 8

 

input_player2_a_btn = 1

input_player2_b_btn = 2

input_player2_start_btn = 9

input_player2_select_btn = 8

 

input_player1_left_axis = -0

input_player1_right_axis = +0

input_player1_up_axis = -1

input_player1_down_axis = +1

 

input_player2_left_axis = -0

input_player2_right_axis = +0

input_player2_up_axis = -1

input_player2_down_axis = +1

 

Now in case you installed the Osmose - Sega Master System emulator (my favourite) we also want to add gamepad control to this.

  • Open the file ~.emulationstation/es_systems.cfg
  • Find "Sega Master System II" section and ensure the COMMAND line looks as follows:
    • COMMAND=/home/pi/RetroPie/emulators/osmose-0.8.1+rpi20121122/osmose %ROM% -joy -joy1 2 -tv -fs

Start emulationstation UI on boot

The last step is ensuring that the emulatorstation UI always start when the Raspberry Pi boots. To do that start the RetroPie Setup script again:

 

cd ~/RetroPie-Setup

sudo ./retropie_setup.sh

 

Enter the "Setup" section and select "Start Emulation Station on boot?"

 

From the setup screen you can also run the program "ES-scraper", this is a pretty cool script that will parse your ROM directories and download descriptions and cartridge images for your UI.

 

You're now ready play!

- the only bad thing about this setup is that since you're using both USB ports for both gamepads, there is no keyboard available and you can therefore not exit the games without rebooting the Raspberry Pi. This is quite annoying since the Raspberry Pi takes about 30 seconds to boot. I will address this issue in my next post where I will add an external reset button that will exit the current emulator.

 

Here is a video of my system in action

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Credits

 

Thank you Raspberry Pi HQ for making this project part of the Top 5 Raspberry Pi Projects on the Internet. I hope to be able to provide a much more detail guide on RaspberryPiHQ.com soon - so this project is no longer just for advanced users!


  • Sign in to reply
  • Former Member
    Former Member over 11 years ago

    Thanks for the awesome walkthrough!

    However, I've been struggling now for several days gettings my controllers to work properly.

     

    I have two controllers: a Logitech Rumblepad 2 and a modified original Nes USB controller (bought from retrousb.com)

    The rumblepad seems to work properly in the RetroPie menu, but for some reason the pad itself only works for Mega Drive emulator.

    And to be honest, I have no idea how to add the second controller.

    Any chance of modifying the retroarch.cfg for me?

    I would like the rumblepad to be primary for the menu + mega drive + snes. (Obviously due to the lack of buttons, i cannot  use the nes controller as a Player2)

    But the NES controller primary for NES emulator. (Here I should have the Rumblepad as Player2).

     

    If it cannot be done, I'll satisfy myself with using the Rumplepad everywhere.

    I would gladely upload any needed files in order to get this done...

     

    If I run the input wizard inside RetroPie, I can set all the controllers I Like, but those seems to get erased after reboot...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 11 years ago

    OK thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 11 years ago in reply to Former Member

    Hi George - they should work as long as they are USB - I have SNES controllers as well that I use sometimes. You just need to play around with the Gamepad configuration file (~/RetroPie/configs/all/retroarch.cfg - input section).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 11 years ago

    I couldn't find any nes controllers from the UK so i found a cheap snes one i was wondering if it would work?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 11 years ago

    what about SNES controllers? would they work too?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube