GBC RetroPie AIO rev C build guide

Ordering the PCB’s

Before you get started you will need to order your PCB’s. Normally PCB’s come in 1.6mm thickness but of this project you will need to order them in a 1mm thickness, This is very important other wise it wont fit in the shell. Also there are 2 boards you need to order, One is the top with the screen and pi and the bottom one is with the buttons and power. Just upload the zipped gerber files to your favourite board house.

PCB files – https://github.com/facelesstech/gbc_retropie_aio_revC

Hardware

3D printed parts

https://github.com/facelesstech/gbc_retropie_aio_revC

Button shell holes

There are several options for buttons on this build, You can keep it classic GBC or add L and R for GBA or go full SNES by also adding X and Y buttons. I think its a good idea to decide before you start the build how many buttons you want, You can add the buttons later but its easier to do it now.

Start with a 3mm drill bit and pilot the holes keeping square to the shell or bracket you are using, Then open the holes to 5mm then on to 7mm this way you will have a nice clean hole, Clean up the button holes. We are done with the shell for now.

Joining the PCB’s

I split the PCB’s for the project into 2 because it was cheaper to produce because the board would have been over 100mm which most board houses don’t like. We need to join the 2 piece together using solder, Its easier to do it now while we can lay them out really flat without anything to get in the way.

Heat the pads up with a nice big blob of solder then quickly pull the iron up away from the 2 pads and it should form a dome of solder and bridge the gap.

Solder the raspberry pi

Since its the most import part of the build we will move on to the soldering of the raspberry pi, Ive made a pinout of which pins we are going to be using. I believe in only soldering the pins we going to be using also this pinout is great for trouble shooting later on.

Start by lining up the pi along side the pads then sliding it over them, Once you are happy with it over the outline start by adding solder to the 5v pad then to the bottom right pad, This will anchor it in place. I normally solder all the other pins then come back to the GND pins once the board is heated up, this way it will made it easier to solder because the GND on the pi is quite large and will soak up the heat. I use a thin soldering iron tip that will get down into the thought hole pads on the pi.

Volume wheel

Before we add the screen we need to solder a few things down that will be hidden behind it, The volume wheel is one of them.

This volume wheel will need to have its pins bent to fit into the pad holes, Just place the 5 pins into the holes then bend it down till the 2 anchor pins are seated nicely. Trim one of the 5 original pins flush with the board, remove the volume wheel then trim the rest of the pins slightly shorter so they will sit below the PCB. Reinsert the volume wheel and solder all the pins. Don’t forget to cover the pins with kapton tape so they wont short on the back of the screen.

L and R buttons

We are going to add the L and R buttons because they are also under the screen. This is the last time we would be able to add them so if you are still on the fence you need to make up your mind. We will start with the 3d printed bracket we drilled the pilot holes with, straighten the legs on the buttons and then push them into the bracket with the legs hanging over the edge. If you look at the bracket you will see that next to the button it has a notch, This is how we know which is the top and bottom of the bracket, Top is where the notch is closest to the egde. We are going to need to solder the 2 most middle pins of the buttons at the bottom of the bracket, This is because they are sharing the GND pin because there wasn’t anywhere else for it to go.

Next we need to get 3 male header pins and a single one, On the 3 pin header remove the middle pin then put the header into the holes on the PCB and push down on the black spacer till its flush with the board, We do this so it wouldn’t get in the way of the screen. Also do the same with the single header pin, Flip the board over and solder the headers in place keeping them square to the PCB. Slid the L and R 3d printed bracket upto the headers and line the button legs up to the pins, remember the left button only has one pin to line up to, The bracket is the same length as the PCB so you can use that as a guide.

Solder the button pins to the header pins and we are done.

Screen

This is probity the hardest thing to solder on this build, But if you take your time and dont panic it can be done. I start by tinning the pads on the PCB, Draw your soldering iron lenght ways on the pads with only the tiniest amount of solder. Next do the same on the screen pads both sides. Next line the screen up with the pads on the PCB make sure its the right way by making sure the pin numbers match (from 1 to 18). Again draw your soldering iron length ways along the pads till you feel them getting stuck down with the solder. Once your happy with the connection we are going to check for shorts on the pins, Ive labled some of the pads on the PCB like the 2 for VCC and 4 for LED because they are all connected together anyway.

Screen test

This is quite an exciting part of the build because we have enough things on the PCB to start to test the screen. We just need to solder the all important 10ohm 1206 SMD resistor in place. If you haven’t already you will need to prepare your sd-card with the Retropie image on it, scroll down the the sortware setup guild.

What you should see is the screen light up all white then it will reset to black then you will see the retropie start up then you should land on the button config screen.

Amp and sound filter

With this build I have added a amp but this meant I would need to filter the PWM audio from the pi. I found this filter circuit HERE. We are going to start with R4 and R5 270ohm 1206 resistors, I tin one of the pads on each of the footprints then grab the resistor with tweezers and solder it to the tinned pad, Next add solder to the untinned pad, Once both are done we can move on. Next we will be soldering the C1 c1 33nf capacitors doing the same as before. Next up is the R6 and R7 150ohm 1206 resistors, Solder them as before. Lastly we will be soldering C2 and C3 10uf capacitors doing the same as before.

Once they are all soldered we can move on to the AMP board, There is only one orientation for this so line it up with the footprint. Just like the pi we are going to be filing the holes in with solder, giving each pad a few extra seconds heat to ensure a good solder joint.

USB C charge port

The USB C female charge port is a really nice 6 pin port compared to the normal 16 pin port on your phone. There is also 2 5.1k 1206 resistors because they are used to tell the charger that its a device that needs power. Start by soldering 2 of the anchor pins to secure it to the PCB while we solder the 6 pins down. I’m using a fine tipped soldering iron and some flux, Carefully apply heat to the first pin then feed it some solder, Do this till all the pins are soldered down securely. Next we need to do the resistors, Like the sound filter resistors and capacitors we are going to tin one pad on each footprint then grab the resistor with some tweezers, hold it to the tinned pad and apply some heat from the iron hold it down while it cools so it doesn’t move. Apply some solder to the other side of the resistor. Don’t forget to solder down the other 2 anchor pins if you are happy with the port.

Power switch

This one is an easy one, Im using a 3 pin thought hole switch soldered to some SMD pads on its side. Its the perfect sized to act as the GBC power switch and its readily available. Tin one of the pads and offer up the switch using tweezers and secure one of the pins. If you are happy with the placement solder the other 2 pins and we are done.

Power bank board

We have finished the assembly for the top PCB we are going to move on to the bottom PCB. First thing we are going to do is solder the power bank board in place. I love this board because its got everything we need to charge a battery and power the pi in one neat package. It is quite tight the placement of this part but I have given it elongated pads so you can get it to fit. Just like the Pi and the amp board we are going to fill the holes with solder. I would suggest to start with one pin to see if it fits before moving on. pick a hole that isn’t a GND pin. Put the board in place so that the bottom left corner is just off the PCB like below.

You will want to see if the PCB fits in the shell, If it doesn’t move the whole power bank up don’t just swing up the left side because the pads might short when soldering. If it all fits solder the other holes in the same way.

Battery female header

With this build I wanted to elimenate the wire that went from the battery bay to the PCB, I found that if I put the female header on the PCB and a male header on the shell I could make it work. If you ether have a 2×1 female header or are just cutting one down, If you are cutting one down you will need to make sure there isn’t any excess maternal on the cut side. I cut mine down with flush cutter then file it to size. The female header is going on the back of the PCB, get it into place then flip it back over and solder one pin, Make sure it at right angles to the PCB and as far right as it will go in the holes. Solder the other pin and we are done with that.

X and Y buttons

If you have gone full SNES layout we are going to be adding them buttons in, If you haven’t chosen this setup move on to the next step.

Start with the X button, We are going to remove 2 of the legs because there isn’t room for them. If you look at the button with the legs coming out of the top and bottom you will need to remove the bottom legs (it really doesn’t matter if you pick the top or bottom legs because they are both connected). Fit the button into the PCB and solder one leg down, check that the button it flat before soldering the other leg down. The Y button we can just fit as is, Again place it on the PCB and solder one leg down checking that its flat before soldering the other legs. Don’t forget the clip the legs off flush with the PCB once we are done otherwise it wont fit in the shell.

Headphone jack

Next we are going to be adding the 3.5mm headphone jack. It goes on the underside of the PCB. We are going to have to remove all the little plastic registration legs on the underside of the part, I just used a Stanley knife but any knife will do, Just cut them flush. Once they are removed put it in place and clip one of the leads flush with the PCB, Next cut all the others to be slightly shorter then that pin so they just sit below the PCB. Apply heat and solder to one of the pins then check that its sitting flush with the PCB, If you are happy then solder the other pins the same way.

Speaker

You can use a genuine GBC speaker here if you want but Im using a after market one because they are easier to get hold of. Ive also upgraded the whole sound system on this build so it only seamed right I went with a real speaker over the piezo speaker in the last build. All you need to do is solder the + and – of the speaker to the + and – on the PCB. If your speaker doesn’t come marked with + or – its doesn’t really matter which way round to solder them because we are only using one speaker.

Shell cuts

Screen and front shell

Ive tried to keep the shell cuts to a minimum. Lets start with the front shell and the screen area, There is a box around where the original screen went. We are going to be removing the top and bottom horizontal walls of that, I use a pair of flush cutters, start trying to cut it as flush as possible by cutting from both sides. Keep trying the screen in place to see if you have missed any material. Once its fits just try and cut it as flush as possible to the shell.

Back shell raspberry and amp hole

The back of the shell needs some cuts to make room of the raspberry pi and amp board. Hold the PCB up to the back and mark how far the raspberry pi comes up the back by the cart slot. Cut down each side of the cart slot to where you marked. Using a craft/Stanley knife and a steel rule score between the cuts a few times front and back then use some pliers rock it back and forth until its breaks off along the scored line. Use a fine file to clean it up. Also we are going to be cutting a slot for the SD card, Grab the 3d printed fake GB cart and hold it up to the shell hard up against the right hand side. Mark the overhand part of the cart onto the shell, This is the part that needs to be cut to allow access to the SD card when put together. Once that’s cut clean it up with a fine file. We are also going to need to but part of the shell where the headphone jack goes because its slightly bigger then the GBC one.

Battery bay

If you look to the left of the battery bay there is a smaller bay, this is where we are going to install the male side to the female battery connector. There is a small 3d printed piece that’s got groove in the top and one side flat and one side with a slant to it. We need to add a 2 pin right angled male header to it, The black spacer goes in the groove all the way over to the straight side and the shorter legs go over the shorter part of top. Pre-tin the shorter legs before gluing it into place.

We also need to glue to into the shell into the small bay next to the battery bay. It needs to go with the straight side next to the battery bay.

I kept the battery bay the way it is with the GBC because there’s no point in reinventing the wheel. With the GBC the batteries were connected in parallel to get 3v but we don’t want to do that with the 14500 lipo batteries we are going to be using. Start by removing the old spring and dome plate from the shell, There is a tab that needs pushing flat to do this.

Might as well start with the spring side which are on the left hand side of the shell if you are looking at the back side. The replacement springs have a tab to them that going to come up thought the shell, The bottom spring is the easier to install because it has a spring sized gap from the original setup but the top one will need to have the spring compressed to get it thought the gap. Once they are in place we are going to use solid core wire (mines out of an old ethernet cable) to join them together with solder. Pre-tin the spring tab and the whole of the solid core wire, Solder the end of the wire to the sprint tab then make sure its were you need it to be solder it to the other spring tab. This will hold them in place. We also want to the use another piece of solid core wire to connect the springs to the right angle male header, We need to solder it to the left side pin.

Lets move on to the dome plates the + side of the batteries, these need to go into the shell with the tabs facing up. Pre-tin the tabs and the solid core wire, Solder one of the tabs to the solid core wire then get bother the plates in place and solder the other tab. Next we need to get a short peice of wire and pass it up through the back slot between the two dome plates and solder that to the solid core wire joining them together. make sure the wire will reach across to the male header then cut and tin the end and solder it to the male header. I put a little dab of glue on the back of the battery bay to hold down that wire.

Gameboy cart pi cover

We need away to cover the pi but also have access to the sd card. I came up with the idea to make a fake Gameboy cart and hold it in place with magnets. Put one of the magnets into the cart with a little bit of superglue. line up the fake cart cover where you want it to go then put a dab of glue in the EXT port on the shell where you can see the magnet in the cart, Drop the magnet in and orienting itself correctly and with the right magnet poles.

Assembly

I found the best way to put it all together is start with the back shell, Put the L and R buttons in place and the power slider, Drop the PCB into the shell remember to line up the female header for the battery to the male headers next to the battery bay and everything else should fall into place. Make sure the front shell has all the buttons and rubbers into it. Stick the screen lens onto the shell and remove the protective layer off the LCD, Also dont forget the IR window,

Screen Software setup (4.5.1)

I found it best to use a slightly older version of Retropie (4.5.1) because its much faster on the raspberry pi zero. Download the release from HERE. Burn the image by following THIS guild, works on windows, linux, MacOS and chromebooks. I find the easiest way to set up the pi is by SSHing into it to run the commands, I find THIS guild super helpful. Once you are all set up we can begin.

The pins I’m using for the screen are

  • Reset – BCM 27
  • DC – BCM 25
  • LED – GND with 10ohm resistor
  • CS – BCM 08
  • SCK – BCM 11
  • MOSI – BCM 10

Before we get started we need to go into raspi-config and turn on SPI. To do this run

sudo raspi-config

The SPI setting is in the interface option. Might as well change your SSH password to be secure.

First you will need to open the file below in your favourite text editor.

/etc/modules

Then add the text below to the file then save and close.

spi-bcm2835
fbtft_device

Next open up file below in your favourite text editor.

/etc/modprobe.d/fbtft.conf

Add the text below to the file then save and exit.

options fbtft_device name=fb_ili9341 gpios=reset:27,dc:25 speed=60000000 bgr=1 rotate=0 custom=1 fps=60

Now all we need to do is install the software that will mirror the HDMI output to the SPI screen. Use the commands below. The are taken from HERE.

sudo apt-get update
sudo apt-get install cmake
git clone https://github.com/tasanakorn/rpi-fbcp
cd rpi-fbcp/
mkdir build
cd build/
cmake ..
make
sudo install fbcp /usr/local/bin/fbcp

Once that’s installed you will want it to start at boot up.

Open up the file below in your favourite text editor.

/etc/rc.local

Then you will need to add the text below, You will need to paste it before “exit 0” or it wont work.

fbcp &

Configuring the screen

We need to edit the confix.txt file in the /boot directorly to do that we need to open the file below in your favourite text editor

/boot/config.txt

Lets start with the overscan, This lets us crop and centre the screen in the GBC shell. Add these lines below.

overscan_top=40
overscan_bottom=90

Next we need to add some other screen and sound settings. The top line is the sound, The other lines are for the screen.

dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4
hdmi_force_hotplug=1
hdmi_cvt=480 440 60 1 0 0 0
hdmi_group=2
hdmi_mode=1
hdmi_mode=87

That’s it, Reboot and should see the config controller screen.

Sound setup (4.5.1)

In the screen section we have already added to sound pins to the config.txt files but we need to turn up the volume. We are going to need to SSH into the pi you can ether turn on SSH in the raspberry pi config or by adding a empty file called “ssh” into the /boot directory.

Once you have SSH’d in you will need to run the command below

sudo /home/pi/RetroPie-Setup/retropie_setup.sh

Once that loads hit configuration/tools option

Next is the audiosettings

Hit the headphones option, this will set the headphones to have sound out rather then HDMI. I might kick you bakc out to the previous option screen , just come back into the audiosetting one again.

This time go into the mixer – adjust output volume

Once this loads you will need to hit F6 and select bcm2835 headphones then using your arrow keys set the volume to 100. Now just hit ESC to exit and back out of all the menus and on the last screen hit reboot.

Screen software setup (4.7.19)

If you are using a raspberry pi zero w 2 then this is the software setup for the screen. You will need retropie version 4.7.19 this is a weekly build which I’m using for now since its so new.

The pins I’m using for the screen are

  • Reset – BCM 27
  • DC – BCM 25
  • LED – GND with 10ohm resistor
  • CS – BCM 08
  • SCK – BCM 11
  • MOSI – BCM 10

Before we get started we need to go into raspi-config and turn on SPI. To do this run

sudo raspi-config

The SPI setting is in the interface option. Might as well change your SSH password while we are at it to be secure.

We are going to be using the super fast fbcp-ili9341 library but I’ve had to fork it to get it to run properly in portrait mode. SSH into your pi and run this commands to get it compiled

sudo apt-get update
sudo apt-get install cmake
cd ~
git clone https://github.com/facelesstech/fbcp-ili9341
cd fbcp-ili9341
mkdir build
cd build
cmake cmake -DILI9341=ON -DGPIO_TFT_DATA_CONTROL=25 -DGPIO_TFT_RESET_PIN=27 -DSPI_BUS_CLOCK_DIVISOR=8 -DSTATISTICS=number=0 -DDISPLAY_ROTATE_180_DEGREES=OFF ..
make -j
sudo ./fbcp-ili9341

Hi Ctrl c to get back to the command line. Now we have that working we need to make it work at boot. We need to edit the files below using your favourite text editor

/etc/rc.local

You will need to add the text below to the files but it needs to be before “exit0”

sudo /home/pi/fbcp-ili9341/build/fbcp-ili9341 &

We need to add and edit a few things in the file below. open it in your favourite text editor

/boot/config.txt

Lets start with the overscan, This lets us crop and centre the screen in the GBC shell. Add these lines below.

overscan_bottom=45

Add the list below to the end of the file.

dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4
hdmi_force_hotplug=1
hdmi_cvt=480 480 60 1 0 0 0
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
display_rotate=0

Button setup

We are going to be using RetroGame from adafruit HERE is the section i pulled the commands from. Copy and paste the 3 commands below into the command line.

cd ~/

curl https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/retrogame.sh >retrogame.sh

sudo bash retrogame.sh

Select the pigrr2 install option and wait till it reboots. We will need to edit the button pins so it will work with my button layout. Edit the files below in your favourate text editor.

/boot/retrogame.cfg

You can just replace the button section with mine below.

LEFT      26  # Joypad left
RIGHT     19  # Joypad right
UP        20  # Joypad up
DOWN      5  # Joypad down
LEFTCTRL  12  # 'A' button
LEFTALT   24  # 'B' button
Z         17  # 'X' button
X         22  # 'Y' button
SPACE     4   # 'Select' button
ENTER     23  # 'Start' button
A         16  # Left shoulder button
S         21  # Right shoulder button
ESC           # Exit ROM; PiTFT Button 1
1             # PiTFT Button 2
2             # PiTFT Button 3
3             # PiTFT Button 4

We will need to reboot to make it take effect and you should be greeted with the button config screen. Hold down one of the buttons and it will ask you to press the buttons to map them. Don’t forget to set the hotkey, I normally use select for that.

Hot keys for saving and loading

We need to set up the saving hotkeys and also turn off a few other options. When I mention un-commenting a files you just need to remove the hash sign at the beginning of the line and when I mention commenting the line out you just need to add a hash sign to the beginning of the line. Lets get started.

You will need to edit the file below

/opt/retropie/configs/all/retroarch.cfg

search for the word below in the file

input_player1_select

Then uncomment the line below and add what was at the end of input_playe1_select to the end of this line

input_enable_hotkey_btn =

search for the word below in the file

input_player1_l

Then uncomment the line below and add what was at the end of input_player1_l to the end of this line

input_load_state

search for the word below in the file

input_player1_r

Then uncomment the line below and add what was at the end of input_player1_r to the end of this line

input_save_state

Also you need to uncomment the line below and change the end to a key thats not used, I use “f”

input_toggle_fast_forward = f

Sound setup

One response to “GBC RetroPie AIO rev C build guide

  1. Pingback: Facelesstech Landing page | Facelesstech·

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s