Introduction: GameDroid: Android Gameboy
A couple of years ago, I purchased a second hand GameBoy Color from a flea market so I could kill some time. Unfortunately, I hadn't thought about buying cartridges for it, so I started looking up how much a GameBoy flash cart which could store various games at once would cost. After some time, I came to the conclusion that they all had an exorbitant price tag (for me at least), but while searching I had been introduced to the world of GameBoy modding. I saw how people added backlights or frontlights to their console, made the Prosound mod, or illuminated it from the inside. It all seemed really cool to me - that is, until I stumbled upon Xodustech's Raspberry Pi GameBoy Pocket. At once, I knew I had to make myself one of those. There was only one problem: I didn't have a single thing he used in his project. No Raspberry Pi, no display, no Teensy, no nothing. I didn't even understand half the things that were being explained on his page at the time. So I looked around my desk to see what else I could possibly shove into that GameBoy, and saw my phone. I briefly considered actually putting it in my GameBoy, but quickly discarded the idea, as it was my phone, and I had nothing else to replace it at the time. Some time later, I eventually got a few Raspberry Pis, a couple different displays, and had accumulated quite a collection of LiPo batteries. However, I never got around to building my dream GameBoy. Then, a week ago, my eyes rested upon a broken GameBoy and my phone, which is no longer my daily driver, and thought "Why not?" So here it is.
Step 1: What's Required
Here's the list of things I used for the GameDroid. It's been almost completely sourced from my pile of junk, so you may or may not have to adapt if you plan on making one of these.
- GameBoy (duh)
- It doesn't have to be a functional one, as you won't be using many original pieces.
- Make sure the buttons and the power switch work, you're going to need them.
- If possible, make sure it has the battery cover, the ones on eBay don't always have a matching color
- It can be any GameBoy really, you only have to adapt it to your needs. I don't think any of the GameBoy Advance (original, SP, or Micro) would be of any use, but you can try your luck with the original GameBoy Advance. You'd need a miracle or a miniscule phone to manage to get it in a GBA SP or Micro.
- It's got to be a small one. I used an LG Optimus L3 II, but I'm sure other ones can work too
- Try to keep the screen height under 7 centimeters or 3 inches
- The cheaper, the better. Things will go wrong, you do not want to have an expensive mistake.
- The HTC Wildfire and original LG Optimus L3 may work for this project, but I have absolutely no clue if they are viable candidates.
- If you find a small enough phone which has USB OTG capabilities, it's your best choice. This project would have been a lot easier had I been able to use a USB keyboard for the gamepad input.
- It is highly recommended NOT to get a phone which has its tactile screen stuck to the lcd, as many newer phones do
- Must be a phone that can be rooted (Samsung tends not to be easily rootable)
- Although getting one of those mini-bluetooth keyboards made for phones seems the right way to go, they often have a controller pcb which is bigger than full-fledged bluetooth keyboard controllers. There isn't much space inside a GameBoy.
- The cheaper it is, the more probable it is to have a small pcb.
- I sourced mine from a broken VGA to HDMI adapter. There were various colors, and they were extremely thin, even thinner than the wires found inside USB cables
- I am led to believe that video cables such as DVI, VGA, and HDMI have very very thin wires, but don't take my word for it. I also believe that old serial and printer cables have very thin wires
- It isn't absolutely necessary for wires to be that thin, the ones found in any old USB cable will do, but it does simplify your life enormously when it comes to soldering things together and fitting things in such a cramped space.
- You will need extra buttons to get some basic functionality out of your phone, I found that buttons that come with breadboards suited my needs
- I used 4 buttons in total, 1 for power, 1 for back, and 2 for volume. You can add 2 more for brightness control, but I felt it was unnecessary (besides havng nowhere to put them)
- Unless you want your GameBoy's lifetime to depend on how much battery you have left in your phone, you need to get one (or two or three) of these to charge and communicate with your phone
- This is unnecessary if you place your phone in such a way that the port is accessible without need of rewiring it
- I don't recommend desoldering the one that's one your phone and then just running cables between the port and the phone; as always, things will go wrong
- During the build, I used my 16GB SDHC card for testing, but ended up using an old 128MB MicroSD
- No need for high storage capacities nor fast write speeds, old console games are next to nothing when it comes to memory
- If you have any pieces protruding from the cartridge slot, you'll want a cartridge to cover it up.
- Used to show if charging or not, you can take it from the GameBoy motherboard (unless you fry it, like me)
- You may or may not use what I've used, but here's my stuff:
- Soldering iron (the smaller the better)
- Hot glue gun (you can probably get away with just superglue)
- Superglue (you can probably get away with just hot glue)
- Tri-wing scredriver for the gameboy screws (a small flat one can do)
- Cutter (you can get away with just a dremel)
- Dremel (no, you can't get away with just a cutter, your hands are at stake)
- As I have repeated a few times already, things WILL go wrong
- When things go wrong and you just can't understand why, explaining it to someone else in detail often helps you realize the problem by yourself, even if that other person has no clue about all the crazy things you're rambling about
- It does tend to help
Note: Having two of everything helps enormously, so try to keep everything as cheap as possible if you must buy something
Step 2: Setting Up Your Phone
As tempting as it may be to shred your GameBoy to pieces to shove your phone in it, there must be preparation beforehand. First off, you must set up your phone to be able to work without a tactile screen, as all tactile response will be lost by performing this project. Android will have to be navigated using the little buttons available to you. The newer the Android version, the better, as it has more support for external devices. Anything JellyBean 4.1 or above should be just fine, but aim for KitKat 4.4 or higher to be on the safe side.
Before starting off, you must make sure your phone is rooted. Files in the system must be edited, and without root privileges, this won't be possible. My phone, the LG Optimus L3 II, came out of the box with a locked bootloader, an LG version of Android 4.1.2, and unrooted. Android phones rarely come pre-rooted and with an unlocked bootloader, but it isn't unseen. I went overkill and chose to unlock my bootloader and unofficially upgrade my Android to 4.4.4 KitKat, under the form of an unofficial port of CM11 by Caio99BR. I chose this specific firmware for various reasons: I could have gone all the way up to Android 6.0, as there are unofficial ports for this LG, but the newer the version, the more resource-intensive it is, and this phone isn't what you would call powerful. KitKat has more than enough support for external keyboards and mice, so I left it at that. What's nice about CyanogenMod custom ROMs is that they are highly customizable, have root integrated into the firmware, and you can fine-tune the system to increase performance at your will.
Of course, there is no need to modify your system as much as I did. All you really need to do is to look up how to root your phone on the Internet.
Now, you need to connect your bluetooth keyboard to your phone. DON'T take neither phone nor keyboard apart until you have succeeded in pairing the devices together and have made sure they work well together. Don't be like me (I took the keyboard apart and desoldered components off it past the point of no return). I ended up having to recreate the number keys on a breadboard to type in the pairing code which my phone required. If your phone supports USB input and you use a USB keyboard, you needn't worry about this.
Play around with controlling your phone with your keyboard and make sure you can access all the vital controls you need to operate your phone with your keyboard.
I highly recommend installing a remote desktop server on your phone as backup. You can never be too safe. I chose to install Mobizen, and I enabled screen sharing over both WiFi and USB. You can control your phone over WiFi by accessing mobizen.com, but you must install the Mobizen client on your PC if you want to control it over USB. Unfortunately, there is no PC client for Linux operating systems, but you should be fine if you use Windows or OSX. I also installed Remodroid on both my LG phone and my current phone, as it allows me to remotely control the LG from my current phone. It does have its disadvantages though. Performance with RemoDroid has been nowhere near perfect, but it works well enough to suit my needs. It's supposed to mirror the LG screen on my other phone, but if often just stays stuck. You can however use it as a remote touchscreen, which is more than enough for me.
If you plan on having WiFi connection on your GameBoy, you'll want to save all the WiFi passwords on it beforehand, as you will no longer be able to type them in once the phone's in the GameBoy, unless you use a remote desktop.
I also recommend installing all the emulator software you plan on using later on now, it will save you from the hassle of installing it without a touchscreen. You might as well start fiddling around with each emulator's settings to adapt it to your needs.
Since there will be no tactile feedback, you will also want to remove all screen locks and possible obstacles which require actions such as swiping and/or dragging.
Step 3: Slice the GameBoy
It's the GameBoy's turn now. You're going to need as much space as you can get, so get your dremel and cutter out, and cut away.
Start by unscrewing the GameBoy with the help of your tri-wing screwdriver (or flat screwdriver if you're careful). Try not to lose the screws, you may need them later on. Inside, you will find the main board and the screen, as well as the power switch and gamepad buttons. With a phillips screwdriver, unscrew the motherboard from the GameBoy casing. You can take the screen out, and leave the GameBoy casing aside.
What you want to get from the motherboard is the gamepad, the switch, and possibly the EXT port and LED. You can keep or leave out other pieces depending on how you want your GameDroid to be set up. To take the gamepad, I just took a dremel and a disc and sliced the board in half along the bottom on the cartridge slot (red line in pic). I then proceeded to desolder all the components on the gamepad part of the board, with no exception, so that all I was left with was a thin pcb with contacts on it for the buttons. I also used the dremel to cut out the the power switch, leaving some pcb around the switch to keep its structural integrity. For the EXT port and LED, I took it off using the soldering iron. You can discard the rest of the motherboard if you wish, it is no longer of any use.
You can set aside the motherboard pieces now. You now have to hollow out the GameBoy casing. The GameBoy cartridge metallic protection can go, it will only get in the way. Once that's out of the way, you must decide how your screen will go: horizontal or vertical. You may have to take your phone apart at this point to see how you can fit in the screen, but be careful with it, as you may still need to put it back together for some more setup. Once you figured out which orientation the screen will go in, get rid of the top and bottom or left and right screen holders on the casing so that your screen can fit snugly against the front of the GameBoy. I personally chose to put the screen vertically, as it allowed me to add buttons on the sides and operate the power switch. For it to fit vertically, I had to sand away a bit of the D-Pad buttons holder. Thankfully, it was just enough to not affect the functionality of the D-Pad. I wanted to put it horizontally in my GameBoy Pocket, but I broke the screen cable connector because of the odd angle I had the motherboard compared to the screen. To avoid breaking it again, I placed it vertically inside the GameBoy Color, as it is slightly taller and it fits.
You also have to cut away in the areas you will be placing your volume buttons and power buttons, so that they can fit. Cut away any excess plastic which seems to take up space, you're going to need as much space as you can get.
Finally, you can cut away the whole battery compartment. It takes up way too much space and it's not even going to be used.
Step 4: Gamepad Wiring
Now's the time to get the gamepad to send signals to the phone. This is where the keyboard comes in. To understand why I use a keyboard, how it works, and understand what I'm talking about, head to my keyboard matrix Instructable.
I believe this was the most complex part of the project. You first have to prepare the gamepad before making any connection to the keyboard. You first have to identify which tracks on the gamepad lead to which buttons. I used a dremel with a diamond point and ever so slightly rubbed it against the white paint to reveal the copper beneath it, then traced each cable. I then isolated the buttons into 4 groups. Here's why: If you have two buttons which share the same "letter" or "number" cable (reference to the previous Instructable), when you press those two buttons at the same time, only one will get registered. However, if they have no common cable, they can both be simultaneously registered. I have not seen a single game which requires both the Select and Start button to be pressed at the same time, so I gave them both the same "letter" cable. Same goes for the D-Pad, you can't press both Down and Up at the same time, so the D-Pad buttons don't require individual "letter" cables. When it comes to pressing two diagonal D-Pad buttons, the system seems to be able to handle that without needing different "letter" cables (I don't know why). The A and B buttons are each individually cabled, as they are used in combination with practically every single other button. To isolate each button from having a common ground, I dremelled an indentation like a trench around each group of buttons and dremelled the holes which made connection to the back of the pcb. I ended up with 12 cables in total, 8 being "number" cables and 4 being "letter" cables. The D-Pad group had 5 cables in total, the Select and Start Group had 3 cables in total, A had 2 cables, and B also had 2.
Once you have this cabled, you will want to check with a continuity meter to see if the cables respond correctly to button presses, and make sure there are no interferences; they are your worst nightmare. Once done soldering, I recommend scrubbing the pcb with some rubbing alcohol to remove grease and acid, which are the main culprits for interferences.
After that, you need to solder the wires to the keyboard controller. If your keyboard controller has some black pads which are used to connect to the plastic sheets with the keys, you can scratch these off with a cutter or screwdriver point, then apply some tin to it with the soldering iron to facilitate soldering. If you have a female header where you insert the sheet via FFC, unsolder the header. You then have to solder the "letter" cables to the "letter" pins, and "number" cables to "number" pins.
Now that it is all wired, you'll want to install the KeyTest app mentioned in the above Instructable. Once installed, go ahead and connect the keyboard to the phone. Open the installed app and make sure each key is sending a separate scancode, and that no "imaginary" keys are being pressed. If you are getting ghost key presses, shut down the keyboard and gamepad, and rub the connections with alcohol, with either a brush or toothbrush.
Step 5: Reprogram the Gamepad Keys
In the KeyTest app, press each key and write down on a piece of paper or your medium of choice the scan code of the key and which button of the gamepad you pressed. Beware, the scan code is NOT the number on the first line, that is the key code, a completely different thing. The scan code is on the third or fourth line.
Once you have each scan code annotated, use a file explorer to navigate to /system/usr/keylayout/Generic.kl. Use any file explorer with root privileges, such as ES File Explorer or Root Explorer. Scroll down until you find the scan codes you annotated. For each scan code, replace the text afer it with what it's supposed to be. For example, if the Up button gave me a scan code of 20, which by default is a "T", I erase the "T" and write "DPAD_UP" in it's place. You should replace the rest of the buttons with appropriate key. I used "DPAD_UP", "DPAD_DOWN", "DPAD_RIGHT", and "DPAD_LEFT" for the D-Pad buttons, "ENTER" for the A button, "B" for the B button, "SPACE" for the Start button, and "S" for the Select button. For the changes to take effect, you need to reboot your phone. You can now navigate your phone using the gamepad buttons.
To save time, you might as well find the file with your volume, power and home keys in the /system/usr/keylayout/ directory and change "HOME" with "BACK" if you plan on having a back button on your GameDroid and you wire it to the original home button.
Step 6: Resize Resolution
Obviously, the phone screen is not the same size as the GameBoy screen. You will need to resize the resolution of your phone so that it all fits within the margins of the GameBoy screen. There are two methods for this, both with its advantages and disadvantages.
The first method is to have ADB installed on your computer. With some luck, you can download the Minimal ADB and Fastboot package for Windows, and by default, it will already support your phone. If you're on Linux, notably Ubuntu (and its derivatives), you can type in a terminal "sudo add-apt-repository ppa:phablet-team/tools && sudo apt-get update" (without the quotation marks), then type "sudo apt-get install android-tools-adb android-tools-fastboot". To see if it works, on your phone's settings, go to About Phone, then tap on build number 7 times. After that, you go back to the main Settings menu and scroll down until you find Developer Options. Activate Developer Options, then enable USB Debugging (it may be called ADB debugging on some ROMs). Once that's done, connect your phone to your computer and open up ADB. In the terminal window that opens up, type in "adb devices". If your device shows up, you're good to go. If not, you will have to install the whole Android SDK and get special USB drivers for your phone. Once you have ADB working for your device, whether it be using the minimal package of the full SDK, experiment with the "wm overscan" command. Start by typing "adb shell". You will then be inside the device via command line. Unless you have root privileges over ADB defined in your system's settings, you will have to type "su" to get root privileges. After that, type "wm overscan 100,100,100,100" and see how it changes your phone's device resolution. Play around with the numbers until it is the right size. I used "100" as an example, your values will be different,
The second method does not involve the use of a computer, but it is a hassle to get the numbers right, unless you are good at guessing and predicting. Download Terminal emulator from the play store. Type in "su" to get root privileges, then experiment with "wm overscan" to resize the screen. You mustn't put big numbers right away, as you may make your screen too small for you to type "wm overscan 0,0,0,0" to make it normal size again. I would recommend going in intervals of 5 until you reach the right size.
Note: If you use Android 4.1 or lower, replace "wm" with "am".
The above pics show the change from normal to overscan of 0,200,0,400 using my Xperia Z1C.
Step 7: Bring on the Glue (and Wires)
Now's the time for you to start making things permanent. Place the screen in the desired location, and make sure that it is not slightly tilted. Make sure it's perfectly aligned, or it will torment you for the rest of your life. It stands out A LOT. Only apply small amounts of hot glue on the edges of the screen. You don't want to damage the screen by heating it too much, nor do you want to take up too much space by filling it all up with glue. Once the screen is secured, go ahead and stick the switch in, which will be used later. If you are not using a bluetooth keyboard, feel free to put something else in its place, such as brightness control, as you don't need the switch. You will also want to put the the back, power, and volume buttons in.
I made the circular headphone jack into a square, and I shoved a button down there. Before sticking it in, I recommend soldering two wires two it to simplify things later on. Where the original volume knob used to be, I placed two buttons. I then realized they were too far in for my fingers to reach them, so I cut the volume knob into a small semicircle and stuck it on top. Now, when you lean the knob to one side, it turns the volume up, while leaning it to the other turns it down. I also added a power button where the wrist strap hole used to be.
These buttons then went on to be soldered to the hardware GPIO buttons on the phone: The power button to the the two power pads on the phone motherboard, the volume buttons to the volume pads, and the back button to the original home button.
You should then solder some relatively long cables to the battery pins and wire them to the phone's battery input, then glue the battery as far out as possible where the battery compartment used to be.
I chose to rewire the phone's speakers to the original speaker hole on the GameBoy. For esthetics, I took some foam from some broken headphones I had laying around, cut it to the right size, and stuck it in.
Once that's all dry, if you're using a bluetooth keyboard and it's powered by a LiPo battery, unsolder it. If it has a USB port for charging it, you may want to remove it if it saves space. You can then stick in on top of the screen and gamepad.
Step 8: Wiring the Power
Unless you want your GameDroid to last for just a few hours, you will need to add a charging port. Personally, I decided to increase the size of the original charge port and stick in a MicroUSB port in there. I then wired the keyboard's original battery wires to the phone's battery, passing the positive wire through the GameBoy power switch. That way, I can turn the keyboard on and off at will, independently from the phone. I soldered each wire from the MicroUSB port to its respective pin on the phone's MicroUSB port, so that I can charge it and have full USB functionality. I also took a LED and wired it to the negative and positive pins of the MicroUSB port, with a 10K resistor between. I wanted to use the original red GameBoy LEDs, but I managed to fry 3 of them before putting them to any use. I settled for a white LED instead. This LED is basically an indicator to see if it's charging or not.
My first version of the GameDroid had the keyboard include its own battery and charge circuit, but the GameBoy casing didn't close. And that's a problem. I ended up just using the phone's battery to power to keyboard.
Step 9: Closing It Up
It's now time to say goodbye to your GameDroid's innards; you won't be seeing them for quite some time (hopefully, if you do see them, it's that something's gone horribly wrong). You can still place the top 4 screws back into place, but the bottom two screws no longer have a place for them. I decided to use superglue to seal the bottom half, and it seemed to go pretty well. All that is left to do is to cover up the phone which is protruding from the cartridge slot, and sand down the battery cover so that it fits in.
All you have to do for the battery cover is cut of the two support prongs and the plastic spring which kept the battery cover closed. Dump a load of hot glue into the hole, and place the battery cover on top. You then just have to hold it in place while the glue dries off.
Step 10: Sacrifice a Cartridge
Since my phone was about the size of a cartridge, I decided to cut a cartridge up to cover the phone's motherboard. This process is too complex to be done with a cutter, unless you don't mind slicing up your fingers (believe me, it's not much fun). With a pencil, sketch out the areas you want to cut out, and with a dremel, cut out the necessary pieces. I got rid of the whole back plate of the cartridge carefully with some pliers, keeping only the edges, which I stuck around the phone. I left a hole for the MicroSD slot and the headphone jack. I decided to keep only the top half of the cartridge, as the bottom half would be hidden away anyways by the GameBoy itself. I left a hole for the MicroSD once again, the vibration motor, the camera, and the battery connector header. Of course, your phone will be different from mine, and you will have to adapt the cutouts to your needs. After it's cut out, all that's left to do is to stick it on the GameBoy and voilà! You're done.
Step 11: Boot Animation
This is purely for esthetics, but I felt the need to change CM11's default bootanimation, so I decided to make my own with the help of images extracted from a dump of the GBA's boot image. Why the GBA you ask? Simple, really. My phone's screen width is of 240 pixels, and so is the GBA's. It looks nice and crisp, as it isn't at a scaled resolution. If you want to make your own boot animation, here's the basics.
Step 12: GameDroid Vs GameBoy
As you can tell, I tried to keep the GameBoy casing as unaltered as possible.