Introduction: Portable Raspberry Pi Emulation Machine
Have you ever been in the situation where you wanted to play those nostalgiac Super Nintendo games with your friends while on a 200 mile long trek through the rainforests of Madagascar? Probably not, but if the situation ever arises you could use this sweet emulation machine that you are about to learn to build. The emulation machine runs off of a Raspberry Pi running Retropie, this allows it to support various emulators such as NES, SNES, Gameboy, Gameboy Color, Gameboy Advance, Sega Genesis, Neo Geo, MAME, PlayStation One and can even emulate an Apple II.
WARNING: Neither Instructables nor I condone illegal activities. As long as you own a hard copy of the game, you may use a digital backup within your emulation console for personal use.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Acquire Your Supplies
Raspberry Pi Model B ($35)
Pi compatible USB Gamepad(s)
32GB SDHC SD Card ($28)
Micro usb power cable (Free, comes with many electronics such as phones, kindles)
Anker 10,000mAh battery ($50)
Phillips 9012 slave screen ($15-$50)
Any portable 9v or 12v screen should work as long it has the required ports.
Brief Case ($5)
A/V Cable (Free, come with many camcorders)
3.5mm to RCA audio female adapter ($2)
Pick and pluck foam ( Price varies on size of brief case. Make sure the dimensions are larger than the brief case. You will cut it to
PC with SD card reader
USB Keyboard and Mouse
USB Memory Stick
Normal RCA cable
Step 2: Choose Your Path
There are two paths you can take now. The easy way where you will learn nothing about the Linux operating system but it will grant you quick results. Path 2 will separate the men from the boys. If you choose this path be prepared for some troubleshooting and sifting through the innards of the Linux OS. For path 1, skip to step 4. For path 2, continue like normal.
Step 3: Write the SD Card: Hard Path
Hi non-lazy people. You should start this by grabbing your SD card and inserting it into your reader. Then you must download these two programs
www.raspberrypi.org/downloads (Download the Raspbian “Wheezy” under Raw Images.)
Now unzip win32 disk imager and run the .exe. Once the program is open, select the Rasbian wheezy you just downloaded as the image file. Then, using Windows Explorer and the Computer tab, check the letter next to the SD card in side bar. This is the letter you want to select under the device tab. Click write. MAKE SURE YOU GET THIS CORRECT OR YOU CAN WIPE ALL OF THE DATA OFF OF ANOTHER DRIVE!!
Now skip to step 5.
Step 4: Writing the SD Card: Easy Way
So, now you need to grab your SD card and insert it into your PC's SD card reader.
http://blog.petrockblock.com/retropie/retropie-downloads/ (Download the RetroPie Project SD card Image)
Now unzip win32 disk imager and run the .exe. Once the program is open, select the Retropie image you just downloaded as the image file. Then, using Windows Explorer and the Computer tab, check the letter next to the SD card in side bar. This is the letter you want to select under the device tab. Click write. MAKE SURE YOU GET THIS CORRECT OR YOU CAN WIPE ALL OF THE DATA OFF OF ANOTHER DRIVE!!
Step 5: Set Up the Pi
Now you grab your Pi and connect it to a video source using a video RCA cable. Now plug in your keyboard and mouse. Plug the Ethernet cable from your router into your Pi. Then plug the Micro USB into the power port of the Raspberry Pi and then plug the wall charge into the most conveniently placed power outlet. The Pi should now power on. If it doesn’t, you either have a faulty unit or you need to find instructions on how to operate an electrical socket.
Now that it has booted, there should be the Raspi-config menu present. Select the “expand_rootfs” option and execute it by pressing enter. It will display a message when completed but just press enter when the message come up.
Next, configure your keyboard. Do this by select the “configure_keyboard” option and press enter. Now select the option that applies to your keyboard and press enter. I selected the “Generic 105-Key (Intl) PC”. It worked for me and my Apple USB keyboard. Then you must select the correct keyboard layout. To find the English layout, I had to go through the “Other” option and press enter. I then found the “English(US)” and hit enter. Now you must select the special options for your keyboard. I left them at default and pressed enter. I then did not make a compose key on the next page and hit “no compose key” and pressed enter. The next option is for selecting a “ctl alt delete” setting. This is personal preference as I enabled it but never used it.
Now you must select the “change_locale” option. Now use the spacebar to select the locale you want and deselect the ones you do not want. (“en_GB.UTF-8 UTF-8” is Great Britian and “en_US.UTF-8 UTF-8” is United States). On the next screen select the same locale and press enter.
Now go down to “change_timezone” and press enter. Select your region and press enter. Then select the time zone of which you exist within and press enter yet again.
Now go down to “memory_split” and type “256” into the field. (If you have the cheaper Model A Pi, put “128” into the field rather than “256”)
Skip the overclocking option for now as it is not needed yet
Press the right arrow key twice and select “Finish” and press enter
Path 1 folks should skip to step 8. Path 2 people should continue like normal
Step 6: Download and Compile
Once the Pi reboots, it will ask for login info. The default username is “pi” and the default password is “raspberry”. Press enter. Remember this information as it will be used again.
The text “pi@raspberrypi ~ $” should appear. This is called the Terminal prompt. The Terminal is where all of the commands and most of the programs will be executed.
You will soon begin to type all of the commands that will download the RetroPie architecture for your Pi. All bolded text will be something you type in the Terminal prompt. Here is an example
sudo example text
Bolded text with multiple lines should be typed as they are seen. Make sure you press enter and divide them into multiple commands.
git clone example
Not like this
cd git clone example
Now make sure the Pi is connected to the internet through ethernet.
To install updates, type:
sudo apt-get update
Once done the terminal prompt comes back, type this:
sudo apt-get upgrade –y git
This will take a short while, the terminal will appear again once done. Now type:
sudo apt-get install –y git dialog
This will take another few minutes. The terminal prompt will reappear when done.
sudo apt-get install –y git dialog
Yet again, you will be back at the terminal when completed. Now type:
git clone --depth=0 git://github.com/petrockblog/RetroPie-Setup.git
Now this will download the installation files for the emulators. Once you are back at the terminal, type this:
chmod +x retropie_setup.sh
Now the RetroPie installation screen will appear. Pick the Source Based Installation (option 2). Now what you need to do is press enter and the next screen will appear. Skip it by pressing enter. We are going to leave everything on the default setting.
Now you should see some fast moving text that may stop for a while. Don’t worry, it is not frozen, it is merely installing emulators. Now this is going to take a fair bit of time. Mine took from around 8-19 hours. Note that the screen will eventually go black and transition into idle mode; This is not bad as the installation is still commencing.
To pass the time you could either sit there and watch the fast moving integers and pretend you’re a hacking into the government’s top secret bear wrestling facility or you can leave it be; whatever floats your boat.
Now that those long hours have passed, it is time to get back to work. A blue screen should appear when you wake the Pi, it is not too important so just skip it by pressing Enter. Press Enter once the next screen appears also. Now you should be back to the RetroPie-Setup screen. You should now select option 3 “Setup (only if you have run one of the installations above)” and press enter. This should pull up another menu. Select the 5th option which its “Start EmulationStation on boot?” and press enter. Now confirm it by pressing the 2nd option on the next screen and press enter.
You should now be back at the RetroPie_setup, press tab and select “cancel” and press enter. This will bring you back to the main install menu. Repeat the process and you should find yourself back in the terminal prompt.
Step 8: Load Those ROMs!
Load a USB drive with your ROMs that you want to play using your computer. Plug the USB drive into the pi. Now on the Pi, type this into the terminal prompt:
This will start up the graphical interface of the Pi. Depending on your keyboard, you may need a USB splitter. I did not because the Apple keyboard has usb ports for the mouse, thus leaving a port vacant for the USB drive.
Click on the file browser icon which is located near the bottom left of the screen on the bottom tool bar. This will open up a familiar looking file browser. Proceed to locate this folder:
EMULATORNAME is a placeholder for the system your roms are for. Now just copy the ROM files from the USB drive to the proper ROM folder. Once the files are moved over to the correct rom folder, press the logout button on the bottom left of the desktop screen. You should now be back at the terminal prompt.
Step 9: Configure That Gamepad!
Now unplug your USB drive and replace it with one of your gamepads. Now in the terminal prompt type this:
Shockingly, this will reboot your device. Now you must enter your login info yet again and the Emulation Station should start up automatically. It will prompt you to configure your controls for the menus of Emulation Station. Press the button that corresponds on the screen.
Once you are finished you will be shown the Emulation Station UI. Scroll either left or right until you find the emulators you want. They should not work with your controller as you need to go through further setup to configure in game controls. Now you can either press F4 to exit or you can use the menu button to pull up the exit menu. Select exit.
Now back at the terminal prompt, type:
./retroarch-joyconfig >> ~/RetroPie/configs/all/retroarch.cfg
Now you must follow the on screen instructions and press the buttons it tells you to press. This will configure your controller to play in game. When complete, type:
Step 10: Fine Tune the Pi
The following step is for adding more controllers or modifying key maps for the controllers.
Once you sign in and are back at the command prompt, type
Now the graphical interface should be back up. Go back to the file manager application and open the “RetroPie” folder. Within that open the “configs” folder. Within that open the “all” folder. Now you should find the “retroarch.cfg” file. Open it.
You should be seeing a large text file. Scroll down until you find the segment of text that starts with “input_player1_joypad_index = “0″” and highlight it and all of the lines below it that start with “input_player1…”
Note that you can modify these config files so that you can adjust the controller mappings. Some controllers map strangely and require manual configuration. This can be confusing to do and will require trial and error to find out what buttons correspond with certain numbers. When you find out the button numbers you can configure the controls manually.
Now copy all of the highlighted text and paste it beneath it. Make sure you create a space in-between the original chunk of text and the new copy. Now change the first line of the copied text to: “input_player2_joypad_index = “1″”. Now look through the copied text and change everywhere it says “player1” to “player2”. Example: “input_player1_b_btn = “2”” should be changed to “input_player2_b_btn = “2””.
Now, some controllers have more buttons than others. If you lack an extra button to use as an exit emulator button you can use the following method. Scroll to the bottom of the config file and add these two lines:
input_enable_hotkey_btn = "A"
input_exit_emulator_btn = "B"
The A and B are place holders for your button numbers. Make the hotkey the same number as your “select” or “start” button and make the exit button anything that can be used as a exit button. (start, triangle, Y). This will make it so you can only exit the emulator if you hold down the hotkey button while pressing the exit button.
Save and exit the config file and click the logout button on the bottom right of the screen. Now type in:
sudo nano /etc/inittab
This should be the terminal text editor, scroll down to the line “1:2345:respawn:/sbin/getty 115200 tty1” and add a # in front of it. Example: “#1:2345:respawn:/sbin/getty 115200 tty1”. Now directly below that line, add “1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1”
Now save and exit. You shall now be back at the terminal prompt. Type:
sudo shutdown -h now
The Pi should completely shut down. Turn it back on by unplugging it and plugging it back in. It should boot up and launch the Emulation Station automatically. You should now have a working stationary emulation console. Now time to build!
Step 11: Build the Case
Grab your brief case and cut out all of the flaps and pockets. This will enable us to put the foam more evenly. Once all of the flaps are cut off and the interior surfaces are flat, move on to the next step.
Step 12: Cut the Foam Pt. 1
Now grab your pick and pluck foam. Measure out your brief case and then cut your foam to size. I cut a piece of poster board the same size of the inside of the briefcase and used that as a guide on the foam. It would be smart to cut the foam larger than the briefcase because the foam looks nicer slightly compressed.
Step 13: Shorten the Foam
Unless your briefcase has the same height as your foam, it will be too large for the briefcase. This will require you to cut the foam through the middle horizontally. This is a long process but necessary. Use sharp scissors/craft knife to cut the correct amount of foam off of the bottom to shorten it. It does not need to look pretty or be exact. Just remember, the foam can compress and your jagged cuts will lie flat. When complete, place foam into the briefcase
Step 14: Layout Your Components
Now, layout the components that will go inside the briefcase (battery, Pi, controllers). You can follow our layout or think of your own. Just make sure that the Pi is situated in a manner that would allow you to gain access to all of its ports. Now, place pins along the border of all of the components. These will act as your guides for plucking the foam.
Step 15: Pluck That Foam!
Pluck the foam within the pins and make sure that the components fit within the holes. Tightness is okay as long as it does bunch up when you put the piece in the hole.
Step 16: Layout the Components
Take all of the components (Pi, screen, battery, controllers, wires) and lay them out. You will then hook them all up just as if they were in the briefcase. The wires for the screen should be connected like the pictures show. The 3.5mm to rca should plug directly into the audio ports on the A/V cable. The A/V cable should plug into the video rca on the Pi and then plug into the screen’s a/v port. There will be lots of extra wires bundles up but it works and it looks fine when the project is complete. This will allow you to visualize where the wires go once inside the briefcase.
The battery comes with cables that can be used with the pi and the screen. Run the screen off of DC power using the DC cable fitted with the correct tip. Run the Pi off USB fitted with the micro usb tip.
When the visualization process is complete, place the components with briefcase and run the wires underneath the foam. IF the foam bunches up, carve away some more of the bottom of the foam to create a small “cave” for the wires. This will make the foam lay flat and it will look much better.
Step 17: Attach the Screen
Cover the back of the screen with Velcro and then cover the center of the briefcase lid with the opposite Velcro. This provides a extremely secure mount for the screen but still allows it to be replaced.
Step 18: Play!
Now Game! Power on the Pi by plugging it into the battery and then plug in the screen to the batter. Make sure you have the wires hooked up correctly and you should be ready to play.
Step 19: Extra Tips
RetroPie has most likely gone through updates since this tutorial. Some actions may not work.
Bios files are needed for the Gameboy Advanced and the Playstation One emulators. You should obtain these from your console and from a third party.
Some emulators are hit and miss (Neo Geo, Genesis) I have had these working on some setups and not working on others.
Have a good day
Finalist in the
Battery Powered Contest