Arcade Emulator
A Project In A Box for beginner to intermediate students
By: Luke Wulf
What is This Project?
The Arcade Emulator is a portable console ran by a Raspberry Pi that plugs into any monitor using an hdmi cable.
The Arcade Emulator can play any game that can be found on a MAME .0375b ROM
ROM’s are basically files containing an arcade game.
MAME (Multiple Arcade Machine Emulator) is the emulator for arcade games
An Emulator is software that lets one machine behave like a different machine
This is a step-by-step guide to teach you how to build this awesome gaming platform, while also learning about Raspberry Pi’s!
Why?
Before We Begin
If you are ever confused or have a question please ask a tutor.
Here is a Google Doc that will be updated periodically with common pitfalls and how to fix them!
https://docs.google.com/document/d/1CoPV9yos1klgfjyd_Bz2nvYZ8ZkkXt5Z6vOMqaTWz0U/edit?usp=sharing
Finally, if you ever get frustrated, just take a break! This project is just for fun and is meant to be a pleasant way to become immersed in the hands-on side of engineering.
Useful Links and Extra Guides at end of slides.
Let’s Begin
Step 1: check your parts
Parts List:
*Double if making 2 player variant
**You will also need your personal laptop or access to a computer
Section 1: Setting up the Operating System
Setting Up the Raspberry Pi
First off, a Raspberry Pi is a very small computer.
All computers have to use an operating system (OS) in order to function.
An Operating System is the software that supports a computer's basic functions, such as logging on, setting up emulators and executing files
The Raspberry Pi’s operating system needs to be downloaded onto your SD card and then plugged into the Raspberry Pi.
Since the OS is on an SD card you can have multiple different operating systems and functions for a single Raspberry Pi!
Our Operating System
For this project we will be using an OS called RetroPie
RetroPie is an OS that makes our little computer into a console that can play any game up to GameBoy Advanced.
RetroPie does this by using emulators.
Recall:
Extra Knowledge About Raspberry Pi
A raspberry pi can do almost anything your laptop or desktop can! It is only limited by memory, RAM, and extra peripherals (such as graphics cards).
Underneath the RetroPi OS is a linux based operating system. If you plug in a keyboard and type f4 followed by any key you go to the command prompt!
Raspberry Pi’s can be used in so many different ways. Some examples are: Communicating with servers, creating a “smart” home, being a server, or being the brains of an rc tank. The possibilities are endless.
Downloading RetroPie onto your SD card
Download the newest version of RetroPie here:
https://github.com/RetroPie/RetroPie-Setup/releases/download/4.0.2/retropie-4.0.2-rpi1_zero.img.gz
Insert your microSD card and Adapter into your computer:
Install The OS image file onto your microSD card:
https://www.raspberrypi.org/documentation/installation/installing-images/
Note: This step is different for whatever computer you are on, but the Raspberry Pi site does a great job at explaining each system. Simply follow each step fully to write your image to the microSD card.
Not every laptop has an SD card slot. There is an adapter in the lab with the 3D printer that you can use. It connects to your laptop through usb.
YAY!
You have successfully set up what may be your first Raspberry Pi!
If you’re feeling a little burnt out just take a break!
Installing those files and reading through all that jargon is difficult work the first time you do it.
However, you’re now one step closer to the finished project!
Section 2: Loading Games onto the Pi
ROM’s
A Raspberry Pi with just RetroPie installed cannot actually play a lot of games
This is because games are large and the Raspberry Pi does not have enough memory to hold all of them.
There are two ways to solve this problem:
We’re going to go the easy way and load all the games onto a flashdrive.
What is a ROM?
A ROM is a .zip file that contains the game files for whatever game you are trying to play.
RetroPie extracts the contents of the zip-file to play the game.
You can think of the Raspberry Pi as the GameBoy and the ROMs as the different cartridges.
Formatting Your Flash Drive
To format your flash drive for the first time it is incredibly easy!
First, plug in your flash drive into your computer and make sure it's FAT32 format.
Next make an empty folder in the flash drive titled “retropie”
Plug the pi in with the drive and it's all set!
MicroSD Card w/ OS
5v Power | Connect to Power Supply
(Do this chord last)
HDMI to monitor
Flash drive
Checkpoint
Turn off your Raspberry Pi by disconnecting the power.
Plug the flashdrive into a computer and check that it has a config and roms folder
Within the roms folder there should be a bunch of other folders.
Each folder corresponds to a different emulator and you place your ROM files (.zip) in the corresponding emulators.
We will be focusing on mame-mame4all
Test Your Understanding
Downloading ROM’s
Disclaimer: Downloading any ROM without the publisher’s permission is pirating and illegal.
As a school, we do not condone pirating therefore we are not going to provide instructions for how to download ROM’s.
You are free to download them at your own discretion.
With that being said, if you were to download a ROM please make sure it is of MAME .0375b ROM format, since that is what the RetroPi uses.
Also, make sure to put the .zip file of the ROM into the mame-mame4all folder on the flash drive.
Congratulations!
You are done with all the software of this project!
If you downloaded the ROM’s correctly they should appear in the appropriate machine on the Raspberry Pi when you turn it on.
Section 3: The Hardware
Hardware
Hardware is any physical, electrical or mechanical component.
Software is any code or file that is used by the hardware.
So far the OS and the ROM’s have been Software, but the SD card and the Flashdrive have been Hardware.
Building the Box
All the parts of the box are forms of Hardware!
This section will teach you how to put all these pieces together so that you can actually play arcade games.
*If you are making the 2 Player variant please do each of the next steps twice*
Before we begin:
Building the Box | Step 1: Prepping the Box
In order to hold all of our components we must cut holes into our box.
We will do this by using a drill and some drill bits.
You are free to cut the holes however you wish, but please keep in mind these notes:
Example Box Layout:
Design Choices:
Building the Box | Step 2: The Joystick
Line up the small holes you just drilled with the holes on the joystick corners.
For each hole:
Stick a screw into both holes.
Add a washer underneath the joystick
Tighten a nut around the screw until washer locks
Finishing the Joystick
Slip the plastic sleeve over the handle and screw the
ball on top!
Building the Box | Step 3: Mounting The Buttons
There are two steps to the buttons: Mounting and Wiring
Let’s begin with mounting: White clasps are for small buttons and Black are for large buttons
Mounting the buttons is fairly simple, just stick the button through the hole and add the clasp underneath the button and screw until it is tight.
If a button does not fit into a hole: Use sandpaper on the hole until it is large enough!
You Have Finished Mounting Everything!
Now to move to wiring
Building the Box | Step 4: Wiring
Take out the USB breakout board
To the right is a diagram of the it:
We will be using the USB cable, 2 Pin Joystick and LED Push Button Pins.
This board is where the magic happens, it takes the physical input of pressing buttons and converts it to a digital signal that the Raspberry Pi interprets.
Each of pins are already wired to serve the designated function of an arcade controller.
The USB Breakout Board
This board is incredibly important!
Without it, the buttons would just be singular pieces whose signal could never be interpreted by the Raspberry Pi.
Think of the Arcade Box as if you are building a keyboard, each button corresponds to a different letter.
This keyboard would never function correctly if there wasn’t something underneath organizing all the different key presses to correspond to different buttons! That is why we use the USB breakout board.
Building the Box | Wiring the Joystick
Take out the blue and white jumper wires
These sets of wires connect to the 4 pins of your joystick.
Blue wires = Outside pins
White wires = Inside pins
Building the Box | Step 5: Wiring The Buttons
Use the provided quartets of black, yellow and red wire sets to connect each button to the USB board.
Here is the plan for connecting each button: Please note which way the plastic crown is pointing.
*In the photo the crown points up*
Attach the successfully wired headers onto the USB board in the designated positions
Building the Box | Step 6: Attaching the USB Cable
Take the USB cable and attach the 5 pin header into the designated spot on the board.
Thread the cable through the hole that you made in the box!
Recall: What is this USB breakout board doing?
Checkpoint!
Please check to see that your wiring is similar to the one on the right.
Section 4: The Finale
Setting Up the Raspberry Pi
Similar to how we set up the flash drive, we need to attach all the extra parts to the Raspberry Pi to make it run! (plug in 2 usb cables for 2 players)
5v Power connected to socket
(Do Last)
MicroSD card w/ OS
HDMI to monitor
Flash drive w/ ROMS
USB cable to box
Configuring Controls (General)
When you first turn on the Raspberry Pi, the machine does not know how you wish to input commands.
Therefore, it prompts you to configure input. Simply follow the instructions to completion.
RetroPi supports many different controllers from keyboards to xbox so if you ever get tired of the box you can use one of those!
You will have to skip a few buttons since we don’t have enough, however it doesn’t change any MAME playability.
But I thought that the USB board already configured the controls?
The USB board organizes the button presses in a way that the computer can understand. For example a button #1 press will look different from a button #2 press.
However, the meaning behind these button presses must still be given to the computer. This process occurs with all keyboards, and the standard qwerty keyboard layout is already built into most computers’ OS’s.
USB communicates through incredibly quick pulses of on and off. The computer then interprets that specific on off pattern as a certain key or button. So, when you press the ‘p’ key on a keyboard it’s not actually sending a literal ‘p’ through the cable.
Configuring Controls (MAME)
Like the general controls, the MAME emulator controls may also need to be setup.
To do this, simply hit your menu button when playing a MAME game, and scroll to the choice that says “Input (general)”
The general input for the MAME emulator is the catch all of the MAME games, however some games are special and you have to configure input from the “Input (this game)” tab.
The Basics of Configuring Controls
Remember to keep track of what each of your buttons do. There’s no magic and any button can be linked to any function.
You Did It!
Your Arcade Emulator should be all set up to play games now! Enjoy!
Where to go from here...
There’s so many ways to make this project more personalized!
If you liked this project please give a thought towards the other Project In A Box ideas, located conveniently for you in EBU1
Questions and Feedback
Please email ece.pib@gmail.com with your questions and/or concerns.
We love to hear what you have to say about our projects and how we can make them better!
Useful Links and Guides
These are some simple guides that I used when I first made this project!
They will be very useful if you’re looking for more resources or need another explanation.
Useful Guides
General Idea: https://learn.adafruit.com/retro-gaming-with-raspberry-pi/raspberry-pi-setup
https://www.youtube.com/watch?v=RcsKNryPAzw
USB Flashdrive Setup: https://www.youtube.com/watch?v=2WGpGCn9NeI
https://www.youtube.com/watch?v=OYMoxvbkYD4
I Hope You Enjoyed This Project!
Luke Wulf
Buu Truong
Eric Ho
Cynthia