Game Boy Color Zero (GBCZ) *With Build Guide Notes

Show off your completed Game Boy Zero, or post your build logs here!
User avatar
infinitLoop
Posts: 536
Joined: Mon Dec 24, 2018 11:46 am
Location: Portland, OR
Has thanked: 222 times
Been thanked: 199 times
Contact:

Game Boy Color Zero (GBCZ) *With Build Guide Notes

Post by infinitLoop » Thu May 23, 2019 6:19 pm

Hey everyone. I just closed up my Game Boy Color Zero, and wanted to show it off real quick. I have lots of pics of the build, so I will add those in additional comments (attachment limits and all), along with all the details on how it was set up, in edits. It actually turned out not to be too difficult in the end, what with Glitch'd Gaming's button board and Pocket Adventure's "Assist" boards, and so I hope other people give it a try.

I would have had it done a little sooner, but I dropped my first screen and cracked it :oops: :cry: - Luckily (!) it worked out, since, even though I had to wait a little while longer for the replacement, it actually was correct, where the first one had "touchscreen" functionality that added like a (precious...) mm or so, even though I did order it without that. Moral of the story - make sure you get that non-touch one!!

*** UPDATE ***

If you want to give this build a try, also check out my second attempt which has some 3D-printable brackets to make this much easier.

***


Highlights:
  • 2.4in SPI Screen (with ~60fps - most of it is visible, but the left side is cut off a little, with overscan)
  • "Safe" Shutdown on the power switch
  • 2500mah battery =~ 5.5+ hours of gameplay
  • Silicon shoulder buttons
  • I2S Digital Audio with Digital Volume controls
  • ADS-1115 Battery Monitor
  • Full-size external USB port
  • External SD Card access from original power switch spot
parts list
All the partsShow
  • Pi Zero W
  • Aftermarket GBC shell with standard buttons from some rando AliExpress merchant
  • 23mm 8ohm 2w speaker
  • ADS1X11 for battery monitoring (this one works with 1115 settings, even though I keep trying to get 1015s)
  • UV LED light for front "power"
  • Printed mounting hole (I needed to file it down some in spots, to fit with this build - If I do another, I think I would remix this to fit better with these builds)
  • Power switch for a GB DMG (I had this for a little while, and don't remember where it came from, but most likely with HHLegend, RetroModding.com or Kitsch-Bent)
  • "Clicky" tactiles for volume control
  • Tiny DPDT switch for power-on, and safe shutdown/off, and to cut off battery from ADS
  • PJ-328 audio jack (Although, if you can get one that fits the stock model, the button board would handle it better - this is just what I had on-hand, and it fit pretty good with the existing shell cut-outs for the standard one)
  • 30awg silicon coated wire (perhaps the most important part in this list!)
  • Custom designed screen border
software
how to set it upShow
  • RetroPie 4.3 (because it's worked better for me than 4.4, with the SPI driver, for whatever reason)
  • JUJ FBCP LCD Driver for SPI Display
    • detailed instructionsShow
      I discovered this method through VeteranGamer's posts, so this is cribbed from that mostly, but adapted to suit the orientation and overscan for this build.
      Here are the commands you will need to execute:

      Code: Select all

      git clone https://github.com/juj/fbcp-ili9341.git
      
      cd fbcp-ili9341; mkdir build; cd build
      
      cmake -DARMV6Z=ON -DILI9341=ON -DSPI_BUS_CLOCK_DIVISOR=6 -DGPIO_TFT_DATA_CONTROL=24 -DGPIO_TFT_RESET_PIN=25 -DSTATISTICS=0 ..
      
      make -j
      
      If you get an error that cmake isn't installed...Show
      I have never needed to install it here, but, you can run this to install it and then continue with the "cmake" line when it finishes:

      Code: Select all

      sudo apt-get install cmake
      Then add it to the startup process:

      Code: Select all

      sudo nano /etc/rc.local
      Add this line somewhere above "exit 0":

      Code: Select all

      /home/pi/fbcp-ili9341/build/fbcp-ili9341 &
      Here are the overscan settings I found work best.

      Code: Select all

      sudo nano /boot/config.txt
      Paste these in, but make sure you do not have other conflicting settings for these in the config elsewhere. If you do, add a # to the beginning to disable them.

      Code: Select all

      ##########################
      ### Small Screen Sizing ##
      ##########################
      framebuffer_width=284
      framebuffer_height=240
      
      ##########################
      ### Overscan Placement ###
      ##########################
      disable_overscan=1
      overscan_scale=1
      overscan_left=42
      overscan_right=2
      overscan_top=0
      overscan_bottom=0
      
      ##########################
      # Disable SPI
      ##########################
      dtparam=spi=off
      
      
  • RetroGame Controls
    • Mapping configShow

      Code: Select all

      sudo nano /boot/retrogame.cfg

      Code: Select all

      UP        22  # Joypad up
      DOWN       1  # Joypad down
      LEFT      23  # Joypad left
      RIGHT      0  # Joypad right
      ENTER     12  # 'Start' button
      SPACE      5  # 'Select' button
      A         16  # 'A' button
      B         14  # 'B' button
      X         26  # 'X' button
      Y          6  # 'Y' button
      L         20  # Left shoulder button
      R         15  # Right shoulder button
      ESC     12 5  # Hold Start+Select to exit ROM
      
  • Minty Battery Monitor (Sixteenbit's fork) for battery monitor
    • Updating for ADS-1115Show
      Open up the script file:

      Code: Select all

      sudo nano ~/Mintybatterymonitor/MintyBatteryMonitor.py
      Find the line "adc = Adafruit_ADS1x15.ADS1015()" and update to "adc = Adafruit_ADS1x15.ADS1115()"

      Adn then scroll down to the convertVoltage method and update the line "voltage = float(sensorValue) * (4.09 / 2047.0)" to read "voltage = float(sensorValue) * (4.09 / 32767.0)"
  • Safe Shutdown
    • detailed instructionsShow
      Getting the safe shutdown working was a bit of a challenge. PocketAdventures has some information over here. Unfortunately, some of it does not work out-of-the-box on older Raspian/RetroPie images.

      I was able to get it working using two methods.
      Both methods require an overlay added to startup, that should keep the "Signal On" to the PSU active, until the "poweroff" happens and sets it to low (cutting the power).

      Code: Select all

      dtoverlay=gpio-poweroff,gpiopin=4,active_low="y"
      Using Minty Battery Monitor / ShutdownShow
      I think this is the easier option, if using an ADS-1x15 for battery monitoring.
      Bring up the script:

      Code: Select all

      cd ~;sudo nano Mintybatterymonitor/MintyShutdown.py
      Scroll to the bottom and update the Shutdown and Monitor buttons:

      Code: Select all

      # Interrupts
      shutdown_btn = Button(17, hold_time=0.3)
      monitor_btn = Button(7, hold_time=2)
      shutdown_btn.when_held = shutdown
      monitor_btn.when_held = togglestate
      pause()
      I use 0.3 seconds for shutdown to try and improve the responsiveness, but any numeric value should work.
      Using config.txt with overlayShow
      The gpio-shutdown overlay needs to be installed on RetroPie 4.3, in order to call shutdown using config.txt. I found the instructions through here.

      First, get the overlay code:

      Code: Select all

      wget http://www.stderr.nl/static/files/Hardware/RaspberryPi/gpio-shutdown-overlay.dts
      Next compile it (you should be able to ignore any Warnings):

      Code: Select all

      dtc -@ -I dts -O dtb -o gpio-shutdown.dtbo gpio-shutdown-overlay.dts
      Copy the command code to the overlay folder:

      Code: Select all

      sudo cp gpio-shutdown.dtbo /boot/overlays/
      Finally, we need to add a uDev rule file for a power key:

      Code: Select all

      sudo nano /etc/udev/rules.d/99-gpio-power.rules
      Paste in this code:

      Code: Select all

      ACTION!="REMOVE", SUBSYSTEM=="input", KERNEL=="event*", SUBSYSTEMS=="platform", \
          DRIVERS=="gpio-keys", ATTRS{keys}=="116", TAG+="power-switch"
      And now we can register it in config:

      Code: Select all

      sudo nano /boot/config.txt
      Add in:

      Code: Select all

      dtoverlay=gpio-shutdown,gpio_pin=17
  • Digital Volume
    • detailed instructionsShow
      Here's a little python script I hacked together for doing digital volume controls, since I wasn't able to find one on a (relatively short) google search-and-find. It's very basic - it doesn't log or provide any onscreen feedback. It just increases and decreases the volume when you hit one of two buttons (up and down). Props to HoolyHoo and all the other open-source scripters out there, for enough examples to pull this together pretty quickly:
      First, create the file:

      Code: Select all

      sudo nano volume.py
      You should have a blank text file. Paste the content in - if you used pins other than GPIO 13 for Up and 27 for Down, then change those near the top:
      here's the codeShow

      Code: Select all

      from gpiozero import Button
      from signal import pause
      import os
      
      # Location of perisitant state file
      statePath = "/home/pi/volume.txt"
      
      # Initial volume setting
      vState = 60
      # Minimum/maximum volume and how much each press adjusts
      vStep = 2
      vMin = 0
      vMax = 100
      
      # GPIO pin configuration
      volumeUpBtn = Button(13)
      volumeDownBtn = Button(27)
      
      
      # Functions
      def volumeDown():
          global vState
          vState = max(vMin, vState - vStep)
          os.system("amixer sset -q 'PCM' " + str(vState) + "%")
      
      
      def volumeUp():
          global vState
          vState = min(vMax, vState + vStep)
          os.system("amixer sset -q 'PCM' " + str(vState) + "%")
      
      
      def readData(filepath):
          with open(filepath, 'rb') as file:
              return file.read()
      
      
      def writeData(filepath):
          with open(filepath, 'wb') as file:
              file.write(str(vState))
      
      
      def doVolume():
          while True:
              if volumeUpBtn.is_pressed:
                  volumeUp()
                  writeData(statePath)
              elif volumeDownBtn.is_pressed:
                  volumeDown()
                  writeData(statePath)
      
      # Initial File Setup
      try:
          vState = int(readData(statePath))
          os.system("amixer sset -q 'PCM' " + str(vState) + "%")
      except:
          writeData(statePath)
          os.system("amixer sset -q 'PCM' " + str(vState) + "%")
      
      # Doin its thing
      volumeUpBtn.when_pressed = doVolume
      volumeDownBtn.when_pressed = doVolume
      pause()
      
      
      that will also create a file to store the current volume setting (to persist when you reboot) named volume.txt in the pi root.

      finally, you need to set it up to run the script at boot time:

      Code: Select all

      sudo nano /etc/rc.local
      Add a line above "exit 0" with this text:

      Code: Select all

      sudo python /home/pi/volume.py &
modifications
Things I had to changeShow
Screen notesShow
Although I actually discovered it on my own, it seems other people did as well around the same time - Since space is such a premium, the screen works best if you trim the case to fit. Luckily it's already a pretty good fit on the top and bottom, and the 2.4in screen fits nicely between the plastic wall where the power switch normally goes, and the LED indicator mounting spot. I trimmed the HDMI off the pi to fit better, because it was pushing against the screen at first, but that was when I had the touch-panel-installed one, and it might not have been necessary with the thinner, non-tft one.

I also ended up removing the connector on the SPI adapter board, and soldering its flat cable directly to the board, to save another mm or so.
Cuts madeShow
I ended up taking a bit more off the battery area, to more easily get the battery in and out of the shell, and I reinforced it a bit, in the rear of the battery compartment, just with some hot glue. I also ended up cutting a slit to that hole where the cartridge would be, so that I could work the wires into it that went to the power supply, mounted there.
Front shell cutouts and 1st battery cut. Mounted USB and volume buttons.:
IMG_5340.jpg
IMG_5340.jpg (768.97 KiB) Viewed 12954 times
USB cut:
IMG_5341.jpg
IMG_5341.jpg (553.96 KiB) Viewed 12954 times
X & Y Button WellsShow
The button board has built-in guide holes for drilling pilot holes, and then I used a step-up drill bit to get up to the proper size. I did try and work with the 8mm tactile mounting spots at first, but there just isn't enough room to get a button in there too. Maybe if someone comes up with a good 3D design to use on those it would work out.

I used Game Boy Pocket buttons, since they do not have the A/B printed into them, and I used a button well to match, and also the silicon from a GBP. It's important, if you do this, that you line up the slots on the wells with the silicon pad. they are pre-cut to fit in certain spots, so you won't get good action on the button if you don't. I also cut off the little hoop that would normally fit around a case peg, and that let it fit perfectly with the GBC silicon.
IMG_5346.jpg
IMG_5346.jpg (558.87 KiB) Viewed 12954 times
IMG_5345.jpg
IMG_5345.jpg (539.08 KiB) Viewed 12954 times
Power SwitchShow
I moved the power switch up to the top, where it is on a Game Boy (and where the Color had an IR remote spot) so that I could use its switch spot for SD Card access (basically the same spot as the contrast slot on a GBZ).

I trimmed the little flap off of the switch, that would normally hold the game cartridge in place on a GB, and filed a little bit around the case in that area, and it fit pretty well. There is not a lot of give/take though, so you can see into the case some when it is switched to one side if it's not mounted just right. I used a very small DPDT (2P2T) switch so I could also cut the battery off from the ADS - the motion isn't very wide, but it works well and keeps the button pretty much within the cutout for it.

Another thing that I did, that worked well when the switch is too far to one side, is to use the flap that I trimmed off to cover up some of the opening, so that when the switch is to one side, you can't see into the case. But, I was able to position the switch just right so that it doesn't need it in there.

I also removed some of the area around where the lanyard would normally go, to mount the battery monitor toggle button there.
Power Supply and CartridgeShow
I ended up just using the onboard LEDs from the PSU for charging/charged/power, so I drilled the small holes in the print to expose those.

I also ended up cutting off the lower half of the cart model (just under where the PSU sits in it) to give that bit of space over to the battery to use.
finishing touches and optimization
ComingShow
  • Coming
anyway, on to some pics...
Image
Original Custom Screen GuardShow
IMG_5369.jpg
IMG_5369.jpg (490.39 KiB) Viewed 12969 times
Closer shot of screen border/protectorShow
IMG_5370.jpg
IMG_5370.jpg (522.64 KiB) Viewed 12969 times
Turned-on (upside down screen image)Show
IMG_5368.jpg
IMG_5368.jpg (547.82 KiB) Viewed 13028 times
Opened up and exposedShow
IMG_5362.jpg
IMG_5362.jpg (1 MiB) Viewed 13028 times
Back of the caseShow
IMG_5364.jpg
IMG_5364.jpg (546.43 KiB) Viewed 13028 times
SD Card accessShow
IMG_5365.jpg
IMG_5365.jpg (529.73 KiB) Viewed 13028 times
External USB and Volume controlShow
IMG_5366.jpg
IMG_5366.jpg (497.5 KiB) Viewed 13028 times
Power Switch, Charging port, and Indicator LEDsShow
IMG_5367.jpg
IMG_5367.jpg (500.8 KiB) Viewed 13028 times
Last edited by infinitLoop on Thu May 21, 2020 7:20 pm, edited 40 times in total.

User avatar
rodocop
Posts: 1723
Joined: Mon Aug 22, 2016 3:14 pm
Location: Saskatchewan
Has thanked: 606 times
Been thanked: 608 times

Re: Game Boy Color Zero GBCZ

Post by rodocop » Fri May 24, 2019 11:18 am

Nice to see something in a color shell. Good job!

User avatar
infinitLoop
Posts: 536
Joined: Mon Dec 24, 2018 11:46 am
Location: Portland, OR
Has thanked: 222 times
Been thanked: 199 times
Contact:

Re: Game Boy Color Zero GBCZ

Post by infinitLoop » Fri May 24, 2019 12:36 pm

I did something somewhat unique for the shoulder buttons (although, who knows, someone else has probably done this before - someone has done everything, it seems - but it was an original thought for me anyway). it would be pretty easy to stick some tactiles in the sides there, but I've gotten spoiled on the silicon bounciness. So what I did was get some Game Boy Advance silicon, and some button pads, cut up the start/select and a/b pads, and glued them together and to a button board...

Shoulder buttons
IMG_5350.jpg
IMG_5350.jpg (882.42 KiB) Viewed 12954 times
all the parts, cut upShow
IMG_5347.jpg
IMG_5347.jpg (1.2 MiB) Viewed 12954 times
holes cutShow
IMG_5349.jpg
IMG_5349.jpg (677.8 KiB) Viewed 12854 times
(I just eye-balled the hole placement, and tried to line it up with those little walls from the battery compartment)
glued togetherShow
IMG_5348.jpg
IMG_5348.jpg (1.01 MiB) Viewed 12954 times
in the backShow
IMG_5351.jpg
IMG_5351.jpg (604.23 KiB) Viewed 12954 times
at an angleShow
IMG_5354.jpg
IMG_5354.jpg (742.38 KiB) Viewed 12954 times
Last edited by infinitLoop on Wed May 29, 2019 9:28 am, edited 3 times in total.

User avatar
infinitLoop
Posts: 536
Joined: Mon Dec 24, 2018 11:46 am
Location: Portland, OR
Has thanked: 222 times
Been thanked: 199 times
Contact:

Re: Game Boy Color Zero GBCZ

Post by infinitLoop » Fri May 24, 2019 12:59 pm

I will probably end up swapping the screen protector out at some point for a glass one, with just a stock whatever printed on it. Although I like the custom pi/zero aspect, the adhesive on the clear plastic lens is a little uneven, which makes it look like there are air bubbles in places on the printed vinyl sticker, so that's not ideal.

Here is the png I did for it though, if anyone else wants to use it or modify it (with and without "zero")
cuttin it upShow
IMG_5356.jpg
IMG_5356.jpg (648.97 KiB) Viewed 12950 times
with the zero textShow
gameboy color zero screen.png
gameboy color zero screen.png (50.1 KiB) Viewed 12951 times
gameboy color no zero screen.png
gameboy color no zero screen.png (46.72 KiB) Viewed 12951 times

MrErickson
Posts: 171
Joined: Sat Nov 04, 2017 3:04 pm
Has thanked: 54 times
Been thanked: 38 times

Re: Game Boy Color Zero GBCZ

Post by MrErickson » Fri May 24, 2019 9:18 pm

Nice build, looks good!

User avatar
waffe
Posts: 23
Joined: Wed Apr 24, 2019 10:35 pm
Has thanked: 14 times
Been thanked: 10 times

Re: Game Boy Color Zero GBCZ

Post by waffe » Sat May 25, 2019 12:30 am

Good job on the build! I like the powersupply, did not know about that one! :)

User avatar
infinitLoop
Posts: 536
Joined: Mon Dec 24, 2018 11:46 am
Location: Portland, OR
Has thanked: 222 times
Been thanked: 199 times
Contact:

Re: Game Boy Color Zero GBCZ

Post by infinitLoop » Sat May 25, 2019 8:58 am

waffe wrote:
Sat May 25, 2019 12:30 am
Good job on the build! I like the powersupply, did not know about that one! :)
thanks!

it is very nice - i like it quite a lot! it's got a small power strip too, so if you only have 3 things to power (like say, pi, audio amp, and usb in this one), you don't even need another strip for that. and when you mount it in a cartridge, pretty much all the pins for wiring poke out from where the case ends too, which is very convenient (it will fit in just about any "hollow" cart model, but the one on the site has indented marks where the onboard LEDs are, and a hole for the charge port).

the only downsides are that you can't just power from the charge port, since it doesn't provide enough power to everything that way without a battery to give it a boost, and that it's not as powerful as helder's psu, so even though it works great for zero builds, i don't think it would work well with more hungry builds like a/b+ or other types of pis.


User avatar
infinitLoop
Posts: 536
Joined: Mon Dec 24, 2018 11:46 am
Location: Portland, OR
Has thanked: 222 times
Been thanked: 199 times
Contact:

Re: Game Boy Color Zero GBCZ

Post by infinitLoop » Sat May 25, 2019 12:59 pm

a few more shots of the build...

here's another inside shot, with the battery tucked in
IMG_5371.jpg
IMG_5371.jpg (908.7 KiB) Viewed 12853 times
from the back - battery accessShow
IMG_5373.jpg
IMG_5373.jpg (592.31 KiB) Viewed 12853 times
bottom - headphone jackShow
IMG_5374.jpg
IMG_5374.jpg (527.66 KiB) Viewed 12853 times
removed the SPI connectorShow
IMG_5342.jpg
IMG_5342.jpg (1.17 MiB) Viewed 12853 times
(lifted a couple pins (again) but they weren't in-use, so it still worked)
screen soldered and taped to the boardShow
IMG_5343.jpg
IMG_5343.jpg (1.15 MiB) Viewed 12853 times

User avatar
infinitLoop
Posts: 536
Joined: Mon Dec 24, 2018 11:46 am
Location: Portland, OR
Has thanked: 222 times
Been thanked: 199 times
Contact:

Re: Game Boy Color Zero (GBCZ) *With Build Guide

Post by infinitLoop » Sat May 25, 2019 2:24 pm

Here's how I hooked up the GPIO. I also added the retrogame config to the original post instructions

I used everything on there, except the 5vs and one ground...
Original GPIO Layout (Updated in later post)Show
pi_gpio_mapping.jpg
pi_gpio_mapping.jpg (88.65 KiB) Viewed 12845 times
Last edited by infinitLoop on Mon Jun 03, 2019 9:15 am, edited 1 time in total.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest