Retro-Gaming Machine With Raspberry PI, RetroPie and Homemade Case
by mosaicmap in Circuits > Raspberry Pi
11567 Views, 60 Favorites, 0 Comments
Retro-Gaming Machine With Raspberry PI, RetroPie and Homemade Case
Some time ago I found a Linux distribution for Raspberry Pi named RetroPie. I found out immediately that it is a great idea with a great implementation. One-purpose retro-gaming system without unnecessary features. Brilliant.
Soon after, I decided to buy a new Raspberry Pi, on which I wanted to run the RetroPie with some good old games.
I also began to look around for a case. Unfortunately, I didn't like almost any commercial case. They were ugly, overpriced and sometimes even overengineered, in my opinion. On the other hand, I liked some DIY cases which didn't try to copy the look of old consoles. So, I decided to make my own case too. For many reasons, I used a universal project enclosure case as a basis...
Take this Instructable as inspiration and also try to make a retro-gaming machine with a custom case. It isn't too hard and you will be happy about the result. And moreover, it could be a great gift. Think about it...
Components
- Raspberry Pi
- 5V Power Supply with barrel jack 5.5/2.1. I used Vigan 5V/2A.
- 8 GB micro SD card class 10 or better
- universal project enclosure box with good dimensions. Search for good box on eBay or in your local electronic component store. I used KP17 from GMe.cz. (It has dimension: 143x119x33mm)
- USB B micro male connector. I used this one from GMe.cz.
- Power supply female barrel jack 5.5/2.1.
- USB A female connectrors. I took them from broken USB HUB.
- USB A male connectrors. I took them from old USB cables.
- Straight HDMI coupler. I used this one from eBay.
- LEDs. I used 5mm green and 8mm red
- small push button. I used this one from GMe.cz.
- piece of universal PCB
- small piece of plywood or something usebale as spacer
- srews and nuts M3, some spacers
- female pin header
- red and black wire. I used AWG 24.
- four-core cable. I took it from an old USB cable.
- power switch (optional)
- and USB game controllers. I like USB SNES-like controllers.
Tools
- PC connected to the Internet
- micro SD card reader for PC
- masking tape
- black markers
- drill and drill bits. I highly recommend a stepped drill bit (in the picture above) for drilling to a plastic.
- sand paper
- small files
- utility knive and/or small chisels.
- hot glue gun
- pliers
- soldering iron
- good quality ("artistic") color markers. I used markers from Winsor & Newton. I chose colors: Mulberry, Cool Gray 1, Cool Gray 2, Cool Gray 3. But you can use whatever you want, of course.
- white permanent marker
- contact glue. I used common Pattex Contact Glue.
- heat shrink tubes
RetroPie Installation
What is Retropie? By the author's words:
RetroPie allows you to turn your Raspberry Pi, ODroid C1/C2, or PC into a retro-gaming machine. It builds upon Raspbian, EmulationStation, RetroArch and many other projects to enable you to play your favourite Arcade, home-console, and classic PC games with the minimum set-up.
See Retropie homepage: retropie.org.uk.
Download latest version of the RetroPie for your version of Raspberry Pi.
Download and install the Etcher. It is a user-friendly multiplatform tool for safe flashing OS image to a SD card. (If you used Raspberry Pi before, you probably know it well.)
Run Etcher, choose RetroPie image, choose correct microSD card drive and hit the flash button (see image above).
After flashing is finished, put the card to your Raspberry Pi, connect a monitor and a controller and a power supply. At the first run, the RetroPie system should extend the filesystem to the entire SD card and then RetroPie asks you for configuring the controller.
See the original guide.
Basic RetroPie Configuration
Select RASPI-CONFIG in the menu, and:
- Change User Password. The default password is: raspberry (default user is: pi)
- Localization Options
- Set your Locale
- Set your WiFi country code
- Set your Keyboard layout
- Set your Time zone
- Interfacing Options
- Enable SSH
- Enable Serial
- Advanced Options
- Disable Overscan. (It removes black margins)
Perform reboot.
Emulators
Most of the emulators are installed and configured correctly by default. I only had to install DOSBox (a famous MS-DOS emulator) and configure Fuse (a ZX Spectrum emulator).
For more information about the emulators see the original guide.
DOSBox installation
Select RETROPIE SETUP → Manage packages → Manage optional packages → dosbox → install from binaries
Fuse configuration
1) map controller as Kempston Joystick.
To file
/opt/retropie/configs/zxspectrum/retroarch.cfg
add line:
input_libretro_device_p1 = "513"
2) set emulator to ZX Spectrum 48k mode.
In file
/opt/retropie/configs/all/retroarch-core-options.cfg
change line:
fuse_machine = "Spectrum 128K"
to:
fuse_machine = "Spectrum 48K"
You can do it, for example, using SSH.
EmulationStation (ES) essential shortcut
Select+Start = exit currently running game and return to ES menu (not working for DOSBox, see below...)
ROMs and MS-DOS Games
First of all, I have to say that even very old games are still copyrighted, so be aware...
However, many old games are considered as abandonware, because they are technically obsolete and practically unsaleable (or unprofitable). A good instance are games for old computer ZX Spectrum, which you can download for free from sites like spectrumcomputing.co.uk or www.worldofspectrum.org.
Some games for MS-DOS you can purchase from www.gog.com.
How to copy ROM files to RetroPie
There are several ways how to do it. See original manual. If you are running Linux on your PC, then you can also copy ROM files directly to the microSD card.
Tip: Fewer games is more! Don't install entire archives, but only several best games for each system. A large number of games is somewhat depressing.
DOSBox games (for advanced users)
MS-DOS games in RetroPie/Emulationstation are tricky. It is necessary to map controller buttons to the keyboard, create and tune a dosbox configuration file and create a run script for every single game.
Here are steps for game Prehistorik 2:
0) install DOSBox
See step "Emulators".
1) buy Prehistorik 2 from www.gog.com/. Install Prehistorik 2 on your PC first, because you will need unpacked game files.
2) copy the game directory to the microSD card to
/home/pi/RetroPie/roms/pc_data ("pc_data", not "pc"...)
(name of the game directory should be Prehistorik_2).
3) create a run script
/home/pi/RetroPie/roms/pc/Prehistorik_2.sh
with content:
#!/bin/bash cd "/home/pi/RetroPie/roms/pc/" "/opt/retropie/emulators/dosbox/bin/dosbox" -conf "/home/pi/RetroPie/roms/pc/Prehistorik_2_dosbox.cf" -c exit
See Prehistorik_2.sh.txt in the attachment
Prehistorik_2.sh will be recognized as ROM file by the runcommand.
4) create a conf file
/home/pi/RetroPie/roms/pc/Prehistorik_2_dosbox.cf
See Prehistorik_2_dosbox.cf in the attachment
Most interesting parts are:
[autoexec] @echo off mount C "../pc_data/Prehistorik_2" -t cdrom c: cls TITUS.BAT exit
and mapperfile definition:
mapperfile=/home/pi/RetroPie/roms/pc/Prehistotik_2_mapper.map
5) create a map file
/home/pi/RetroPie/roms/pc/Prehistotik_2_mapper.map
See Prehistorik_2_dosbox.map in the attachment
Search on the Internet about how to do it. A good start should be for example a DOSBox wiki.
6) try to run the game.
Scripts and Configuration for LEDs and On/Off Button
Safe power On/Off button
Raspberry Pi has no "safe off" button (at least versions up to 3B+). Search the Intenet for more information about it.
Users often solve this problem by writing their own script which runs a command "sudo shutdown -h now" on an interruption from a button connected to some pin.
I just used well-written scripts from tyler from howchoo.
I let pin for button set to the GPIO 3 (=Physical pin 5) (see pinout.xyz).
External ACT LED
Edit file
/boot/config.txt
- for Raspberry Pi 3 add this:
# --- external LED as SD ACT LED (Raspberry Pi 3) dtoverlay=pi3-act-led,gpio=4 # ---
- for Raspberry Pi 2 add this:
# --- external LED as SD ACT LED (Raspberry Pi 2) dtparam=act_led_gpio=4 # ---
Now you can connect a LED with a resistor to the GPIO 4 (=Physical pin 7) (see pinout.xyz). As ACT LED I used a 5mm green LED.
Power status LED
I adopted a clever super-simple power status indicator from this tutorial from Zach from howchoo. Just enable the GPIO serial port, then you can connect a LED with a resistor to the GPIO 14 = TX (=Physical pin 8) (see pinout.xyz). As power status LED I used an 8mm red LED.
Start Planning a Case
As I wrote, I used a universal project enclosure case as a basis. I admit, it isn't as cool as the case made from good quality wood, or well designed 3D printed case, but it can be still acceptable way how to quickly create a good-looking case, in my opinion.
Plan the position of all components. Where to place Raspberry Pi, where to place all connectors, which connectors omit and so on. Take the time, don't hurry.
USB Extensions
Because I decided to have two USB connectors for two game controllers in the front and Raspberry Pi in the middle, I needed two short USB extenders. I made them from old USB cables and from a crappy USB hub. See pictures above.
Power Adapter Exension
One thing that makes me nervous about Raspberry Pi is the micro USB B power connector. This connector seems to be a bit fragile to me. Therefore I decided to use a common barrel jack 5.5/2.1 and power my retro-gaming machine by 5V power supply with a barrel jack 5.5/2.1 mm.
Marking Holes
Specify the position of all components and mark all necessary holes. In my case:
- holes for two USB (and holes for screws to mounting small PCB)
- hole for barrel jack 5.5/2.1 connector
- hole for HDMI coupler
- power button hole
- two holes for LEDs
- four holes for screws to mounting Raspberry Pi
- hole for micro SD card slot
- ventilation holes (don't forget about them)
Making Holes
Make all holes using your trusty tools.
Small chisels were surprisingly useful for making non-circular holes in my case.
Soldering LEDs and On/Off Button
Do wiring according to the schematic in the picture above. It shouldn't be difficult.
You can secure all wires with hot glue after soldering.
You probably noticed that the power button (see in the picture above) is soldered to a piece of PCB with wooden spacers. I had to make this workaround, because I chose a button designed for PCB, not a button designed to be mounted to a panel.
Placing All Components
Attach all components to the case. I attached every component using a hot glue except Raspberry Pi and USB extenders, which I attached with screws. See pictures above.
Decoration
Decorate your case as you wish. Everything is allowed. For example, I drew a top mask on a paper using artistic markers. Then I glued the mask to the case using a contact glue.
Testing
Close the case and try to test everything. Work everything fine?
No? So, fix all issues, test it again, repeat until everything is fine. Keep cool.