1 of 45

Arcade Emulator

A Project In A Box for beginner to intermediate students

By: Luke Wulf

2 of 45

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!

3 of 45

Why?

  • To build something absolutely incredible that you can use for years to come!
  • By completing this project, you will gain gain confidence with hands-on electronics and will further refine your skill of persistence and following directions!

4 of 45

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.

5 of 45

Let’s Begin

Step 1: check your parts

Parts List:

  • 1 Raspberry Pi B+ 512MB
  • 1 32gb microSD card
  • 1 HDMI Cable
  • 1 Flashdrive
  • 1 5v Power Supply
  • 1 Joystick body*
  • 1 Joystick ball*
  • 1 USB Breakout board*
  • 8 Large Push Buttons*
  • 2 Small Push Buttons*
  • 4 Joystick Connector Wires*
  • 10 Button Connector Wires*
  • 1 USB Cable*
  • 10 Button Stoppers*
  • Some ¼ in screws, nuts and washers*

*Double if making 2 player variant

**You will also need your personal laptop or access to a computer

6 of 45

Section 1: Setting up the Operating System

7 of 45

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!

8 of 45

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:

  • What is an Emulator?
  • What is an Operating System, and why do we need it?

9 of 45

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.

10 of 45

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.

11 of 45

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!

12 of 45

Section 2: Loading Games onto the Pi

13 of 45

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:

  • 1. Include the games in the Operating System (Hard but doable)
  • 2. Include the games on a portable flash drive (Easy)

We’re going to go the easy way and load all the games onto a flashdrive.

14 of 45

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.

15 of 45

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

16 of 45

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

17 of 45

Test Your Understanding

  • What is a ROM?
  • Why are they going to be on a flash drive?
  • How does the Raspberry Pi use a ROM to play a game?

18 of 45

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.

19 of 45

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.

20 of 45

Section 3: The Hardware

21 of 45

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.

22 of 45

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:

  • Think about all the different pieces that went into this project and classify them as either hardware, software or a mix of both.

23 of 45

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:

  • Line up your joystick body with the box before drilling, these 4 small holes need to be exact so that the joystick can actually be mounted
  • Use a 1.25” spade bit for big buttons and a 1” spade bit for small buttons
  • Drill a hole somewhere for the USB cable
  • Most arcade games use 2-6 buttons but the extra buttons are nice for functions such as coin, start and menu.
  • Drill small pilot holes before going in with the large spade bit for better holes.
  • Make sure you drill a hole for the joystick handle (size of large button)

24 of 45

Example Box Layout:

Design Choices:

  • The joystick is usually played by the non-dominant hand.
  • The two small buttons are on the side, they are bound to the quit game and menu buttons (You don’t want to accidentally press)
  • The top buttons could be better staggered or distributed. I’ve only ever had to use 6 buttons max to play a game.

25 of 45

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

26 of 45

Finishing the Joystick

Slip the plastic sleeve over the handle and screw the

ball on top!

27 of 45

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!

28 of 45

You Have Finished Mounting Everything!

Now to move to wiring

29 of 45

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.

30 of 45

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.

31 of 45

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

  • Connect the heads of each pair to the appropriate place on the previous diagram

32 of 45

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

33 of 45

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?

34 of 45

Checkpoint!

Please check to see that your wiring is similar to the one on the right.

35 of 45

Section 4: The Finale

36 of 45

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

37 of 45

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.

38 of 45

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.

39 of 45

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.

40 of 45

The Basics of Configuring Controls

  1. Scroll to whatever button you want
  2. Push your “enter” button to change the control
  3. Push your new button and you’re good!

Remember to keep track of what each of your buttons do. There’s no magic and any button can be linked to any function.

41 of 45

You Did It!

Your Arcade Emulator should be all set up to play games now! Enjoy!

42 of 45

Where to go from here...

There’s so many ways to make this project more personalized!

  • Make an actual arcade cabinet
  • Add bluetooth controllers instead of wired
  • Make your own custom box
  • Play games other than MAME
    • Check the RetroPi site for the current emulator version you wish to try
  • You can label the buttons by easily popping out the pieces and inserting or drawing on the button face!

If you liked this project please give a thought towards the other Project In A Box ideas, located conveniently for you in EBU1

43 of 45

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!

44 of 45

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

45 of 45

I Hope You Enjoyed This Project!

Luke Wulf

Buu Truong

Eric Ho

Cynthia