In the earliest of the 90s, before Sega and Nintendo were best buddies, they went head to head in the handheld console market. Sega released their Game Gear, which had a ton of very interesting features, and was "technologically superior" to it's rival, Nintendo's Game Boy. However, user experience won out, and Nintendo's Game Boy was crowned the victor of this battle. The Game Gear faded into obscurity, forever in our hearts marked as 'pretty cool.'

So, why the handheld gaming history lesson? Well, today we're going to be giving the Game Gear a second life as a Raspberry Pi-based handheld!

We're gonna be modifying the Game Gear's case to fit the screen, and the new internal components. The button PCBs will be reused from the original motherboard, and we'll be adding a couple of capacitive pad buttons for extra inputs! There's quite a bit of soldering involved, lots of heatshrinking, and cutting of plastics & PCBs. Make sure you have your safety goggles and facemask ready!!

First, Tools:

Then, Parts:

 

Here is the mounting hardware table. The smaller machine screws include one extra, just in case.

2x5mm Machine Screws

2x8mm Machine Screws

#2 Metric Nuts

~6.5mm Aluminum Standoffs

Standoff Compatible Screws

#3 Crush Washers

4

9

14

3

3

3

So, with that out of the way... Let's get this thing open!

There are seven screws on the back that you need to remove in order to separate the two halves. Six of them are standard philips head screws, and one is a strange little one called a "Gamebit." You can source a bit for it, if you want, but I find that you can turn it slowly with a pair of needlenose pliers!

 The red circles below indicate where the exposed Philips head screws are, and the blue circle is the Gamebit screw. There is also a screw underneath each battery cover, in the corner.

 There are three cables that go from the front half of the unit to the rear. On the rear case there are two small PCBs and a metal shield. Remove the screws from these (there are two screws in each PCB, and four in the metal shield), and remove them from the case.

The Game Gear uses a giant CCFL tube for it's backlight. Do not forcefully pry the case or do anything to damage the tube!! Glass and potential mercury hazard.

Now, remove all of the Philips head screws holding the motherboard down, there are twelve (the two near for the cartridge connector are larger than the others).

At this point, you should have all the components removed! Hurray! You should save all of the bits and pieces for now, we'll be using them as the project progresses! Also, you can now remove the buttons from the front panel. Put those, their elastomer pads and all of the screws somewhere safe!

Let's get started on these case modifications!

It's clear from looking at the case, that in order to fit everything in there, we're going to need to make some cuts. It's time to let your cutting tool do the talking. It's important to note that, on the rear case the Game Gear has plastic standoffs to support the buttons. Don't cut these standoffs or otherwise ruin their structural integrity, or your button performance will suffer. It's also wise to leave the main case screw standoffs intact for the same reason.

 You can see where they line up here! Mark them so that you know where they are when you're hacking up the case.

Below is a diagram indicating the spots to explicitly avoid when cutting your case. Be as selective as you can when you're removing pieces. Don't slash and burn it (even though, that's more fun). Run through your space planning a couple times before you mark the case for your cuts.

Cutting tools are dangerous! Always wear your safety googles, dust mask and gloves! Work in a well ventilated area!!

It should look something like this when you're done. By far, the largest items to place in the rear case are the LiPo battery and the Raspberry Pi. You may want to slightly alter your cuts if you're using the Raspberry Pi A+, as you need far less room compared to the others.

 If you care to be more agressive in cutting the right battery compartment, you could certainly shift the Pi over to the right by a couple centimeters. Just keep in mind the button supports and main case standoffs!

Next up is the front panel. The Game Gear originally came with a 3.2 inch diagonal display, which is just shy of the 3.5 inch diagonal display we've chosen as ours. You can remove the front plastic bezel, by pressing on it with your fingers from inside the case. It should slowly pop forward. Slightly heating it up with a hairdryer (Not too hot!!) will make it a bit easier, but is not required. There's also this small rubber display gasket, which can be peeled back and removed.

Cut slightly below this line here, about 1mm down the imprint. Do your best to keep the cut even. File down any rough parts when you're finished. The bezel will hide imperfections for the most part (If you even have any, you awesome maker you).

While you're cutting up the front case, you should delete the standoffs that surround the LCD bezel. They will interfere when we attach the display to the front case. The pictured cut is slightly too large, so aim for a bit smaller than this with yours.

And, with that, the major case modifications are done! High five yourself. Makin' progress!
Let's start mounting our parts!!

The Game Gear is significantly curved all around, which makes mounting parts flush with the case a pain. What we're going to do, is cut out perfboard in the shape of the two small PCBs we removed earlier. We'll use these to mount some of our floating components.

Trace both of the small PCBs on the perfboard. Mark the screw mounting holes, and any other voids. Drill equivalent sized holes in the perfboard. It helps a lot to clamp down the perfboard while drilling (or use a drill press), as the perfboard holes can cause the drill bit to jump to the wrong spot.

Use the screws that originally held in the small PCBs to attach the new blank perfboard pieces, and check to make sure all of the clearances are correct.

Next, we'll mount the capacitive sensors. These are mounted on the inner part of the case, right next to the cartridge slot plastic. You'll have to remove the perfboard pieces to access the area. The inner case of the Game Gear is entirely coated with conductive material. In order for the capacitive pads to be mounted flush with the case, we need to scrape all of the material completely off.

First, we measure the distance from one of the mounting holes, to roughly the center of the sensor pad. This comes out to roughly 10.8mm, according to the trusty calipers.

Next, we have to drill out two of the mounting holes (only two are really neccecary), and a hole in the center so that the button can be pressed easily! Finally, use your rotary tool to grind off the conductive coating. It needs to be completely gone! Any stray bits can cause lots of issues. Use your 2x8mm bolts and nuts to secure the sensor. Repeat this process for the opposite side.

Before these sensors become buried under the rest of the components, it's a good idea to solder on wires to them. We need three signals, GND, OUT and VDD. LEDA is an optional pin which could be used for effects. Keep the wire colors consistient for each module, and give yourself a couple inches of working wire to come back to.

You may have to drill a small hole in your perfboard cutouts to accommodate for the bolts holding the sensors in place.

Here is the mounting plan for the rear case. The power switch is in the recessed area where the volume slider used to be, and the USB Mini-B breakout ends up where the original barrel jack connector was for power input. The headphone jack will remain in it's original location. A USB-A connector will be where the EXT/Link port resided on a small riser. The MAX98306 and PowerBoost are mounted on top of the cartridge slot, and the LiPoly Backpack is on the right perfboard with the Mini-B.

For the MAX98306 amplifier board and the Powerboost 1000, we need to isolate them from the conductive material on the Game Gear case. Use your rotary tool to grind off the conductive paint from the top of the cartridge slot, where we're going to mount those boards. To be extra safe, you can put a layer of electrical tape on the underside of each board.

 For the USB A riser, cut a small strip of perfboard and mount the USB A connector that came with your PowerBoost. Bend the two shield tabs firmly against the perfboard for a strong physical connection. Add a dab of hotglue for additional strength. Drill a hole in the base perfboard, and the strip of perfboard, mount the connector on a standoff. You should be left with this handsome little USB port.

 For the headphone jack, you can use the Game Gear's old jack, if it's still working. It's possible to desolder the jack, or you can simply cut the PCB around the jack until it's free. Position it deadbug where it previously resided, and apply hotglue to the underside.

The power switch leads should be bent into the perfboard. Add a dab of hot glue to improve mechanical strength. It helps at this point to solder your power switch leads onto a two pin header, so the perfboard will not have to be removed again. A small diagram is provided below.

Go ahead and drill the holes to mount your parts. The Game Gear plastic is thick so use 2x8mm bolts to secure each board. Anything that passes through the Game Gear case plastic will need at least 2x8mm, but 2x5mm will be enough to get through the perfboard. The Raspberry Pi needs about 6.5mm, as does the USB A Riser, so try and get something close to that for the standoffs to mount them. When it's all done, the back will look something like this.

The display needs a bit of special attention to work properly in the Raspberry Gear. The display is designed to accept from 6V-12V, which is just a mite too high for our 5V system. Testing it with 5V will work somewhat, but it'll be choppy and pretty much unusable. So what to do? Well, the screen's controller board actually uses a combination of 5V and 3.3V, but the input power (6V-12V) has to pass through a regulator. And, no matter how LDO this little regulator might be, it just isn't quite enough.

The display controller board needs to be modified to accept direct 5V, by removing that regulator! Pay careful attention to the orientation of the board in the photos, to ensure you solder onto the right pins!!

(If you absolutely do not want to try and desolder the chip, you should be able to clip all of the leads carefully using your flush cutters! However, do not apply excessive upward force doing this, or you can damage the pads!!)

Surface mount parts can be tough to remove, work carefully and do not pry the component up without freeing it first!

The part is an SOIC-8 part, which means four leads on the top and four on the bottom. Our target chip is highlighted in red below. It's gotta go!

The trick to desoldering these types of parts is to apply a glob of solder to your iron, flow the entire side of pins, and then (while it's still hot/liquid) gently lift that side with your tweezers.

Once the chip is gone, we're going to run two small wires to the main connector, so you can continue using it for power input! The pads are marked below.

(And, so you can see what this looks like without the colored pads in the way...)

The 5V wire should be run to the 12V pad on the display's connector (pin 1), and the GND wire should be run to the GND pad on the display's connector (pin 2).

Now, you're ready to rock that 5V supply! It helps to apply a couple small drops of hotglue to hold down the yellow wires. Don't apply glue directly to the solder pads, as you risk damaging the pads if you have to remove the glue. Try and aim for a neutral empty area.

Finally, you can depin the white and yellow wires on the display connector, and remove them. Then, snip the Composite connector from the blue and green wires. Solder the wires onto a 4 pin male header in the following order:

  1. Blue (Composite Signal)
  2. Green (GND)
  3. Black (GND)
  4. Red (5V)

Your display is now ready!!

Time to mount the display and speakers!

This is what we're going for here. Display dead center of the nice Game Gear bezel. The aluminum frame of the display kind of stands out against the black, so let's fix that. Apply strips of electrical tape along the edges of the display to hide the aluminum bezel. (Feel free to skip this step if you like the look of the aluminum! Entirely optional.)

The display's ribbon cable is very delicate!! Be careful when handling it and the display controller!

Next, line up the display as exactly as you can in the window, and apply small pieces of tape to hold it in place. Then, apply hotglue "straps" to the corners of the display to hold it firmly in place. After that, you should (for ease of connecting later on) solder a couple of wires onto one of your LED sequins, and hotglue it into the "Power" light area in the front case.

Finally, attach the controller board to the back of the display using a strip of double stick tape. Cover the entire display controller board in strips of electrical tape to prevent any shorts. Display mounted!

Time to mount the speakers! Unlike the original Game Gear, we're running full stereo sound. We can mount our two speakers inside the original speaker area (as it is quite large), by shaving a small amount from the plastic ring and tacking them with hot glue. If you're using circular speakers, place one into this speaker grill, and use your drill to create another speaker grill on the opposite side of the case!

Apply a small dab of hotglue on the the bottom of the Teensy, and press it onto a small rectangle of perfboard. Hotglue this the rectangle into your front case, below the screen. You can ignore the wires for now, we'll cover those on the "Wiring (Front Case)" page.

Here's where things get a little tricky! Trimming down the button PCBs and getting them mounted.

The buttons are reasonably simple devices, just a PCB contact patch and a conductive nub on an elastomer pad. They're common ground as well, which makes the wiring much easier. However, we've got to free them from the original motherboard, so that we can use them easily. This requires cutting the PCB with either very large pliers, or using a rotary tool. Large pliers reccommended, as cutting PCB with a rotary tool is unpleasant and creates nasty dust. The tradeoff is that cuts with a rotary tool are significantly cleaner, and there is less risk of damaging the traces by flexing them.

Beware the CCFL tube! It's fragile and hazardous. Be extremely careful when handling it!!

First, we have to safely remove the CCFL tube from the board. Snip the two leads on either end of the tube with your flush cutters, and the tube will be freed (along with it's diffuser). Please carefully dispose of the tube in accordance with your local laws.

 The first tube lead is the copper strand coming out of that rubber bushing. The other is going to the trace marked "FL".

Next, you can fold the LCD out of the way, and begin lining up your cuts. Here are some diagrams for your cuts. You're going to be breaking a lot of components off the board, and generally destroying them... So, if you were planning on doing any salvage, now is the time. Time to meet.... the large pliers.

When cutting the board, USE SAFETY GOOGLES and PARTICLE MASK! This procedure create a lot of particulate, none of which you should be breathing in or getting hit in the eye with!!

When you're all done, you should be left with two piles. One large pile of very sad electronics, and one pile of awesome button PCBs.

Chaching!


Now you can mount up these two PCBs with the screws that originally held in the motherboard. The boards will be sandwiched between the two halves of the case when it's all closed up, so don't worry about there only being a single screw holding the D-Pad PCB in place. It's really just to keep them aligned while the halves are separated. We'll wire 'em up soon enough.

Next, we want to add the capacitive pad for our Select button. It resides right above the D-Pad on the left side. In the above picture, you can see the yellow line indicating it's mounting point. It's reccomended that you solder on the three pickup wires (VCC, GND and OUT) just like the other two, so that you won't have to later. To avoid having screw heads popping out of the front of the case, this capacitive sensor will be glued down.

Use a drilling template for this one. This button will not mount exactly flush with the case unless you use your rotary tool to grind down the ridge that's there. Careful not to overdo it though, as it's very easy to cut through the case. Slowly grind away until the sensor board sits flat.

Almost there...

If you happen to have a spare elastomer pad from the 1, 2 or Start buttons, you can tack that down into the hole you drilled. It gives the Select button a stealth look. You may need to place a tiny bit of tin foil on the bottom of the nub to make it work a bit better, test it a bit before you completely finalize it.

Apply hot glue around the edges, to tack the board in place!

Another section down, another high five for you!

It's time to get into the wiring for the rear case. We're going to do the following:

(The table gets kind of jumbled towards the middle, so pay attention to the numbers. Also, Solder points for the Raspberry Pi B+ are at the very bottom of this page!)

  1. USB Mini-B Breakout 5V
  2. USB Mini-B Breakout GND
  3. PowerBoost 1000 EN
  4. PowerBoost 1000 GND
  5. LiPoly BAT
  6. LiPoly GND
  7. PowerBoost 1000 OUT+
  8. PowerBoost 1000 OUT-
  9. PDH+
  10. PDH-
  11. PDH+
  12. PDH-
  13. PDH+
  14. PDH-
  15. PDH+
  16. PDH-
  17. PDH+
  18. PDH-
  19. Raspberry Pi Composite Video GND/GND
  20. Raspberry Pi Composite Video SIG
  21. MAX98306 LOUT-
  22. MAX98306 LOUT+
  23. MAX98306 ROUT-
  24. MAX98306 ROUT+
  25. AT42QT1010 (1) OUT
  26. AT42QT1010 (2) OUT
  27. Raspberry Pi USB(1) VCC
  28. Raspberry Pi USB(1) D-
  29. Raspberry Pi USB(1) D+
  30. Raspberry Pi USB(1) GND
  31. Raspberry Pi USB(2) VCC
  32. Raspberry Pi USB(2) D-
  33. Raspberry Pi USB(2) D+
  34. Raspberry Pi USB(2) GND
  35. PowerBoost Component T1 (Collector - Pin 3)
  36. LiPoly GND
  1. LiPoly 5V
  2. LiPoly GND
  3. Switch (Middle)
  4. Switch (Left or Right Pole)
  5. PowerBoost IN+
  6. PowerBoost IN- (GND)
  7. Power Distribution Header+
  8. Power Distribution Header-
  9. AT42QT1010 (1) VDD
  10. AT42QT1010 (1) GND
  11. AT42QT1010 (2) VDD
  12. AT42QT1010 (2) GND
  13. MAX98306 VCC
  14. MAX98306 GND
  15. Display Connector 1
  16. Display Connector 2
  17. Raspberry Pi TP1 (#1 Model B or A ONLY!!)
  18. Raspberry Pi TP2 (#1 Model B or A ONLY!!)
  19. Display Connector 3
  20. Display Connector 4
  21. Main Connector 1
  22. Main Connector 2
  23. Main Connector 3
  24. Main Connector 4
  25. Main Connector 5
  26. Main Connector 6
  27. Main Connector 7
  28. Main Connector 8
  29. Main Connector 9
  30. Main Connector 10
  31. EXT/Link Port USB VCC
  32. EXT/Link Port USB D-
  33. EXT/Link Port USB D+
  34. EXT/Link Port USB GND
  35. Battery Probe Connector 1 (Pink)
  36. Battery Probe Connector 2 (Black)

In order to trigger our Low Battery Red LED on the front panel, we're going to piggy back on the PowerBoost 1000s component T1's collector (Pin 3). This PNP transistor is in charge of switching on the red LOW LED on the PowerBoost when your battery is low. We're going to use it to feed our front panel LED as well! You should also solder the 500mA charge rate jumper on your LiPoly backpack, as we're dealing with large battery sizes that can take the extra juice.

It sounds like a lot of steps, but it moves a lot quicker than you think! Here's a diagram explaining the gist of it. We're going to put three connectors between the two halves so they can be separated for maintenance and further improvements! All of the connections have to be sealed with heatshrink to prevent shorts.

We're also going to snip off the power bus from a protoboard to use as our power distribution center for the post-PowerBoost 5V. This will allow for quick disconnects if any parts ever need to be replaced, or serviced. The entire design is setup to be modular, so that any given part can be released from the unit without a lot of effort or resoldering.

Note: There's a little more to the audio than this section covers, there is a dedicated page for the audio wiring. Also, some of the photos show the power switch originally being wired to the LiPoly backpack. This will reduce current draw to zero when the unit is off, however, the PowerBoost at full load can pull up to 4A. This will exceed the rating for the switch. To account for this, we toggle the PowerBoost's EN pin instead. Double However, the PowerBoost pulls up to 20uA when it's disabled. It's a tradeoff. If you're unhappy with the 20uA constant draw, then use a larger switch. If the 2500mAh battery is fully charged, it will take roughly 12 years to deplete the battery through this parasitic draw! The "schematic" and instructions use the EN pin, but some of the pictures are slightly different.

Don't forget about the Game Gear's conductive coating!! Watch out for shorts, make sure to isolate your electronics from it.

You can use a right angle header (instead of the JST male connector) for the PowerBoost, so a breakaway header can attach to it's IN side, as pictured above. There is also the header on the power switch, so that it can be disconnected easily, pictured below.

Next, we're going to create the Power Distribution Header. Time to whip out the large pilers for a second job, cutting the power bus off of this nice Protoboard. It's sad, but it's got two power buses, so it's perfectly usable still.

You should trim it to about half this size, as we don't have enough devices to even fill half of this board. After soldering on some break away headers, this should be the result. Now we have a central area to grab 5V from! Solder two wires from the PowerBoost OUT VCC and PowerBoost OUT GND onto the corresponding PDH buses.

Create a bunch of two pin connectors by trimming your breakaway headers into two pin pieces. Solder the VCCs and GNDs each to an individual connector, so that devices can be plugged into the PDH.

Do not reverse the polarity of power going to ANY device! It's very possible that the device could be destroyed!! Pay careful attention to the polarity of each connector, and the PDH polarity.

As there is no longer a need for them, we will remove the Rasberry Pi's built in USB connectors, and solder onto the pads underneath. The connectors can be removed by crushing them carefully with pilers. Do not try and pry off the connectors, or you will damage the Pi. You can also remove the Composite Video connector, and the Audio Jack.

Here is a photo of the main connector. It's pinout is as follows (left to right):

  1. AT42QT1010 (1) OUT
  2. AT42QT1010 (2) OUT
  3. MAX98306 LOUT-
  4. MAX98306 LOUT+
  5. MAX98306 ROUT-
  6. MAX98306 ROUT+
  7. RasPi USB(1) VCC
  8. RasPi USB(1) D-
  9. RasPi USB(1) D+
  10. RasPi USB(1) GND

The RasPi USB(2) pins go directly to the EXT Port USB A connector.

This is the display connector, and it's pins are (bottom to top):

  1. Raspberry Pi Composite SIG (Blue)
  2. Raspberry Pi Composite GND/GND (Green)
  3. GND (Brown)
  4. 5V (Red)

Here is which pads to solder onto the Raspberry Pi's Composite Connector. The Blue is Composite SIG and Green is Composite GND/GND.

If you have a Raspberry Pi B+, none of the solder points will match the Model A or B. So, you can use this handy guide to find the important ones! The USB ports will match up in the same order, when the Pi's are in the same orientation (USB ports facing left). That is: GND, D+, D-, VCC, just like in the diagram with the Model B.

Test Points

PP2

PP3

PP24

PP25

PP26

PP6

 

5V IN

GND

Composite Video SIG

Audio Left

Audio Right

GND

Test each connection with a multimeter as you progress, and double check your polarities! You'll be greeted by a happy Pi screen in no time!

Next up are the button panels that we hacked up earlier! Basically, we need to find a GND point and the signal pins for each button panel. For the D-Pad, there will be five wires, and the 1-2-Start panel, there will be four. Thankfully, the Game Gear has points that will pull the signals which are easy to find, and included in the cutouts.

D-Pad Solder Points:

  1. UP - M10
  2. RIGHT - M13
  3. LEFT - M12
  4. DOWN - M11

1-2-Start Solder Points:

  1. START - M16
  2. 2 - M15
  3. 1 - M14

 There are a few easy locations to grab GND from, the brightness slider on the 1-2-Start board has two large GND points. Depending on your motherboard type, the D-Pad may have a small pad near the middle left.

Solder your wires onto these points, and then we're going to solder them onto the Teensy. Be sure to give yourself adequeate length to position the Teensy in the lower center of the case. If you happen to switch any of these, don't worry about it, it's a small change to the Teensy firmware to correct it.

Connect the two GND wires together, and then to the GND pin on the Teensy. Then, wire these up like so.

  1. UP - Teensy B0
  2. RIGHT - Teensy B1
  3. LEFT - Teensy B3
  4. DOWN - Teensy B2
  5. START - Teensy B7
  6. 2 - Teensy D0
  7. 1 - Teensy D1

Once you've wired them up together, you can go ahead and flash the Teensy with the sketch. It's easiest to switch the sketch into MODE_KEY, so that you can plug it into your computer and see the keypresses pop up. You can do this by changing the #define statement around line 20 to either MODE_KEY or MODE_JOY. Once you've verified that everything is working, MODE_JOY is reccomended. Alternatively, you can leave it in MODE_JOY, and test everything using a joystick testing program.

You can test the buttons by placing the elastomer pads over the gold contacts on the PCB and pressing the nub down. Once you've verified everything is super great, you can apply a bit of hot glue along the edge of the PCB to hold the wires in place. Then, simply place the PCBs back into their standard mounting points, and screw them in!

Front case time! For the front case, we're going to tie in the Teensy to the Raspberry Pi USB Port (through the main connector). We're going to tie the low battery probe to an LED in the front panel (to indicate it to the user). The four speaker wires on the main connector go to the speakers. The Select capacitive sensor gets tied into the Teensy, along with the OUT pins from the two capacitive pads in the rear case. The audio ctrl connector pins will be run to the Teensy, as well.

Main Connector 1

Main Connector 2

Main Connector 3

Main Connector 4

Main Connector 5

Main Connector 6

Main Connector 7

Main Connector 8

Main Connector 9

Main Connector 10

Teensy F0

Teensy F1

Speaker 1-

Speaker 1+

Speaker 2-

Speaker 2+

USB Mini-B VCC

USB Mini-B D-

USB Mini-B D+

USB Mini-B GND

Audio Ctrl Connector 1 (Blue)

Audio Ctrl Connector 2 (Green)

Teensy B6

Teensy F7

Battery Probe Connector 2 (Black/GND)

Battery Probe Connector 1 (Pink/T1 Collector)

LED Sequin-

LED Sequin+

 With the Main Connector sorted, you should snip off the Composite connectors from the display controller harness, and save the Blue, Green, Black and Red wires. The rest can be de-pinned, or snipped at the base.

Display Connector 1

Display Connector 2

Display Connector 3

Display Connector 4

Red (VCC)

Black (GND)

Green (Composite GND/GND)

Blue (Composite Signal)

The display wires match in color 1 to 1 with the wires on the other end of the display connector! Easy peasy!

If you opted to chop up a USB Mini-B cable instead of getting the connector, then your connections will look like this...

Speaker wires!

Onto the audio section! This section assumes that you have made the connections outlined in the "Wiring (Rear Case)", which are: The power connections for the amplifier and, the amplifier/speaker OUT connections to the Main Connector.

With the Game Gear's original headphone jack, the two 'Headphone Detect' pins are open circuit when no headphones are inserted, and closed circuit when there are headphones inserted. The other pins are self explanatory, audio connections.

We're going to pass the amplifier's SDWN pin and the 'output' from the headphone detect to the Teensy on the front panel through this two pin connector. The Teensy will have it's INPUT_PULLUP turned on for the headphone detect pin. When it sees the pin go LOW, it knows that headphones have been inserted, and it will drive the SDWN pin low, which will turn off the amp. Otherwise, the SDWN pin will be driven HIGH, activating the internal speakers.

When connecting the RasPi Audio to the Amplifier & Headphone Jack Chain, add a three pin male header/three pin female header connector, so that it can be quickly disconnected. This will also allow you to create an audio test cable, so that you can pipe audio into the circuit once you are finished. You can use any 3.5mm male cable, or old pair of headphones to make the test cable.

Raspberry Pi Audio GND
Raspberry Pi Audio Right
Raspberry Pi Audio Left
MAX98306 Audio (L-/R-)
MAX98306 Audio (R+)
MAX98306 Audio (L+)
Headphone Detect 1
Headphone Detect 2
MAX98306 SDWN

MAX98306 Audio GND (L-/R-)
MAX98306 Audio Right (R+)
MAX98306 Audio Left (L+)
Headphone Audio GND
Headphone Audio Right
Headphone Audio Left
GND
Audio Ctrl Connector 1 (Green)
Audio Ctrl Connector 2 (Blue)

Here's the audio test cable, you can plug this right into your three pin header to test your audio circuit. Match the of your headphone cable to the pinout of your three pin disconnect.

With all of that hardware setup out of the way, you're ready to setup the Raspberry Pi! Don't close the case up until we're completely finished here!

  • Download the RetroPie SD image (you can read about the features of the RetroPie SD card image here!) for your Raspberry Pi version.
  • Load it onto your SD using one of the common SD card utilities -- Win32DiskImager for Windows, ApplePi-Baker for OS X or plain old dd on LinuxHere's an in depth guide to getting your SD card setup.

(If you see a message saying "Illegal Instruction" when starting Emulationstation, it's possible that you installed the wrong SD card image. You'll know there's a problem because instead of loading ES, you'll be dropped right into a command line on your first boot.)

  • Emulationstation will prompt you to train it for your inputs, so go ahead and assign them! Give those awesome new Game Gear controls their first offical presses!
  • Now, enter the menu and shutdown ES. We need to complete some system setup stuff so we can get the most out of the system.
  • Run sudo raspi-config and select Expand Filesystem.
  • Reboot, and quit ES again!

It helps a lot to do these configurations via SSH, so plug in your Ethernet cable and bring up your eth0 interface. The built in screen will be hard to read until we make a few changes. If you're really having trouble, you can temporarily plug in an HDMI cable (this will disable the built in screen) and use a regular monitor.

There are tons of things that you can configure in RetroPie, and there are guides on the RetroPie wiki. Highly reccomended that you give these a look through and see if they can answer any questions. This guide here will only give you the basics to get going.

One caveat to know going in, your Emulationstation bindings you set a little while ago do not work in the actual emulators themselves, those are set in the RetroArch configs. This guide covers that a bit later.

Keyboard Configuration

If you're in the U.S., you'll notice that pressing Shift-3 gives you a British Pound symbol (If you're on the local console, this shouldn't affect SSH). This is because the default keyboard layout is set to the Raspberry Pi's home country of the United Kingdom!

A quick and easy way to change it to a U.S. layout is to run this command:

sudo pico /etc/default/keyboard

You'll be greeted with this file:

# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="gb"
XKBVARIANT=""
XKBOPTIONS=""

BACKSPACE="guess"

Navigate to the line that says XKBLAYOUT="gb", and change it to "us", like so:

# KEYBOARD CONFIGURATION FILE

# Consult the keyboard(5) manual page.

XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS=""

BACKSPACE="guess"

 

Config.txt

Next up, we have to configure the Rasperry Pi's video output to best match our little screen. Replace the lines at the top of the config.txt with the lines shown below. Don't overwrite the whole file though, just this block.

 (You may need to adjust your overscan values slightly. Play with them to create the best results.)

sudo pico /boot/config.txt
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=0

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
overscan_left=-26
overscan_right=-26
overscan_top=-16
overscan_bottom=-16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
framebuffer_width=320
framebuffer_height=240

Joystick Bindings

You have to now modify some of the configuration files for RetroArch and Dgen. This guide does not cover the many other possible configurations, just these. The configurations also allow for a USB joypad to act as your player two in any RetroArch supported emulator.

retroarch.cfg

 You can find the retroarch.cfg file in:

/opt/retropie/configs/all/

Scroll down to the input/keyboard section (it's a long file...) called "Keyboard input." and replace input_playerX block with the following:

# RetropieJoyConfig 
input_player1_joypad_index = "0"
input_player1_b_btn = "1"
input_player1_y_btn = "5"
input_player1_select_btn = "8"
input_player1_start_btn = "9"     
input_player1_up_btn = "h0up"
input_player1_down_btn = "h0down"
input_player1_left_btn = "h0left"
input_player1_right_btn = "h0right"
input_player1_a_btn = "0"  
input_player1_x_btn = "4" 
input_player1_l_btn = "5"  
input_player1_r_btn = "4" 
input_player1_l2_btn = nul
input_player1_r2_btn = nul
input_player1_l3_btn = nul
input_player1_r3_btn = nul
input_player1_l_x_plus_btn = nul
input_player1_l_x_minus_btn = nul
input_player1_l_y_plus_btn = nul
input_player1_l_y_minus_btn = nul
input_player1_r_x_plus_btn = nul
input_player1_r_x_minus_btn = nul
input_player1_r_y_plus_btn = nul
input_player1_r_y_minus_btn = nul
  
input_player2_joypad_index = "1"
input_player2_b_btn = "0"
input_player2_y_btn = "3"
input_player2_select_btn = "10"
input_player2_start_btn = "9"
input_player2_up_btn = "h0up"
input_player2_down_btn = "h0down"
input_player2_left_btn = "h0left"
input_player2_right_btn = "h0right"
input_player2_a_btn = "1"
input_player2_x_btn = "2"
input_player2_l_btn = "4"
input_player2_r_btn = "5"
input_player2_l2_btn = nul
input_player2_r2_btn = nul
input_player2_l3_btn = nul
input_player2_r3_btn = nul
input_player2_l_x_plus_btn = nul
input_player2_l_x_minus_btn = nul
input_player2_l_y_plus_btn = nul
input_player2_l_y_minus_btn = nul
input_player2_r_x_plus_btn = nul
input_player2_r_x_minus_btn = nul
input_player2_r_y_plus_btn = nul
input_player2_r_y_minus_btn = nul

Make sure all other input_playerX lines are commented out with a #, as they may conflict with this configuration.

dgenrc

This file is located in the same directory as the retroarch.cfg. Open it up, and scroll down to "# Joystick/joypad definitions for pad 1" area.

Replace the entire joy_pad1 block with the following:

joy_pad1_up = joystick0-hat0-up
joy_pad1_down = joystick0-hat0-down
joy_pad1_left = joystick0-hat0-left
joy_pad1_right = joystick0-hat0-right
joy_pad1_a = joystick0-button0
joy_pad1_b = joystick0-button1
joy_pad1_c = joystick0-button4
joy_pad1_x = joystick0-button3
joy_pad1_y = joystick0-button5
joy_pad1_z = joystick0-button6
joy_pad1_mode = joystick0-button8
joy_pad1_start = joystick0-button9

Then, replace the entire joy_pad2 block with the following:

joy_pad2_up = joystick1-hat0-up  
joy_pad2_down = joystick1-hat0-down
joy_pad2_left = joystick1-hat0-left
joy_pad2_right = joystick1-hat0-right
joy_pad2_a = joystick1-button0
joy_pad2_b = joystick1-button1
joy_pad2_c = joystick1-button2
joy_pad2_x = joystick1-button3
joy_pad2_y = joystick1-button4
joy_pad2_z = joystick1-button5
joy_pad2_mode = joystick1-button8
joy_pad2_start = joystick1-button9

These may require some small tweaks depending on what kind of Player 2 Joypad you want to keep around, namely the button numbers. The Player 1 configurations match what the Teensy is configured to send. Edit it to your liking!

Time to give this project the final one-two punch!

If you're unhappy about how the edge of your screen looks, you can create a new tapered bezel using Sugru!

 The doublestick tape holding the front panel's clear plastic bezel may have faded a bit, and might not hold so well when you go to put it back together. You can freshen it up with some fresh tape. Don't use anything too thick, as it'll throw off the look!

It's reccomended that you mask off any exposed electronics on the front panel, to avoid having any shorts. You can use strips of electrical tape, or masking tape. It doesn't matter which tape, as long as there's a layer there to isolate it. You can also put a couple of wire ties on the bundles.

You should also apply a string of hot glue along your male headers. This will keep the pins from separating from the plastic shrouds.

And, that's it! Press the halves together, put the screws in and enjoy! Load some ROMs and play some games!

This guide was first published on Mar 02, 2015. It was last updated on Mar 02, 2015.