Tiniest Game Boy Hides In Your Pocket

This is likely the world’s smallest fully-functional Game Boy Color, able to play all of the games using the tiny direction pad and buttons, with onboard display and battery and in the original form factor. This is an incredible hack which presents a tour de force in hardware and software. This will easily rank in the top five hacks you’ve seen this year.

keychain-redactedI’m sure that many of you have fond memories of your first handheld games. This will be Game Boy for most, and we admit they had fairly decent portability and battery life that puts many smart phones to shame. Despite this, Sprite_TM always dreamed of an eminently more portable version and to his adolescent delight he discovered a key chain version of the Game Boy. Unfortunately, he was duped. The keychain looked like a Game Boy but only functioned as a clock.

But now, decades later, technology has progressed as have his own skills. For his talk at the 2016 Hackaday SuperConference, Sprite_TM actually built his childhood dream.

Hardware:

Sprite started his hardware design by spec’ing out the display. The original Game Boy had a rather poor screen that could manage 160×144 with about 4 levels of grayscale. The new screen needed to encompass this but with as small a physical size as possible.

The first screen he found was a tiny 800×600 color OLED screen: an amazing piece of hardware with a ridiculous price of $720. The better bet was a color OLED just under 1″ in size for $3.80 — it didn’t have quite enough resolution at 96×64, but Sprite tested it and found it would be a passable image. Rounding out the hardware choices he went with a speaker less than 1 cm in diameter, an ESP-32 chip (in the form of an ESP-WROOM-32 module), and a 150 mAh lithium-ion battery.

The size of the screen decided all of the dimensions for the body of the Game Boy. Sprite pulled a measured image of the screen into Inkscape and started playing with images of the original hardware to arrive at his final size. He had some challenges laying out the board since it needed a slot for the OLED flex cable to pass through. He modeled the PCB in OpenSCAD and built up the case design around it. This was his first time using a 3D printer and his case (printed on a Form 1+) really did come out looking great!

Software:

Software is a challenge in this case. Sprite wanted to start with an emulator, but emulators are written for a full computer system. The ESP32 is a beefy chip (dual-core 240 MHz, 512k RAM, a laundry-list of peripherals, WiFi and Bluetooth) but it is still not a full computer. He decided to look at older emulators that are optimized to run on very old computer equipment. After a survey of the many options he settled on GNUboy which has optimizations that make it runnable on a 486 computer.

tc4-croppedThat was a good start, but he had a long way to go to ensure this was possible. Most notably, the “tile cache” that GNUboy uses to maintain the “sprites” — 8×8 graphic chunks that make up every game. This is well-explained at about 18:34 into the video. GNUboy allocates about 128 kB of RAM (more than 1/4 of what is available) for the tile cache. Sprite was able to reduce this need to about 46 kB.

Once the emulator was running, Sprite added in some nice user features. There is an on-screen display that allows the user to adjust brightness, volume, and to load or reset the ROM. Since there isn’t mass storage on the board the tiny Game Boy can only store a few ROMs at once. Sprite leveraged the WiFi capability of the chip to get around this. When you want to load a new game it broadcasts an Access Point and runs a webserver that allows any phone or computer to upload a new game.

Things That Didn’t Go Well at First

There are always issues when building an epic piece of bespoke hardware like this one. Lucky for us, Sprite is more than happy to share his tripping points and he’s very entertaining while doing so.

speakerhotAudio was a sticking point, and one of the most technically interesting parts of the talk. He noticed that the speaker was getting hotter than it should have… it was about 90 degrees Celsius. He’s driving it with an H-bridge motor driver chip (BD6211) which is not all that unorthodox. It just seemed like that chip never stopped driving the speaker.

To solve the problem he started looking into filtering techniques and uncovered two designs referred to as AD modulation and BD modulation. Turns out that BD modulation uses positive and negative voltage driving on either side of 0V as the center line. This was the solution to the heat problem but provided another challenge: how to generate the negative voltage from the microcontroller? His initial audio technique used the I2S peripheral but that outputs just a single pin. He moved to using the RMT peripheral which has two pins, using this to toggle a negative voltage circuit. This solution is very clever and Sprite suggests looking into the RMT peripheral for other hacks (here’s one that drives WS2812 LEDs).

wroomkill2We’ve heard people complain about microcontrollers that use external flash memory. This is actually a pretty nice feature sometimes. For instance, Sprite wanted more program memory and the ESP32 supports that, but the WROOM module has a metal box soldered on the board shielding all of the circuitry. He figured a hot air reflow station would take care of that. It did, it also took care of desoldering the rest of the on-board components as well. Another try with a new module and he was able to top out with the largest flash chip possible.

It Lives — And It’s More Than a Game Boy

The proof is always in the pudding. The demonstration of the tiny Game Boy was delightful. And if you talked to Sprite at all during the weekend, he probably offered to let you try it out. This works as well as the original Game Boy. Despite the missing pixels the screen looks fantastic! The user controls feel normal and the sound is respectable, although a bit of delay is present and he has a fix for that on his todo list.

tiny-game-boy-doomThe kitsch benchmark for hacked gaming systems has long been DOOM and this fact wasn’t lost on Sprite. He demonstrated DOOM running well, but with very poor framerate — that still counts as a win in our books. He also showed off his key-chain-sized handheld playing Witcher 3. Something doesn’t smell right, right? Of course the microcontoller can’t handle a current-generation game, but it can handle VNC forwarding like a charm. A very cool trick, and if the Game Boy emulation didn’t fully drive home how far our miniturized technology has come, this demo should finish the job.

Sprite will release code under GPL once he has it cleaned up. He is planning the same with the PCB and case design files. If you want one of these, and love to do a little fabrication of your own, it can be yours. Watch SpritesMods.com for that code release and more info on the build itself.

Want more of Sprite_TM right now? His talk from last year’s SuperCon, the Tamagotchi Singularity, is an epic presentation and hardware hack in itself. Enjoy!

26 thoughts on “Tiniest Game Boy Hides In Your Pocket

      1. Its a Gameboy, on a key chain. There is no “real world” use of it, its a novelty, and a challenge to make, and with the video, you can learn what Sprite_TM had learned along the way.

        Hell, can you point out a use for the “Tamagotchi Singularity?” No? Just another challenge Sprite_TM made?

  1. What always impresses me about Sprite’s hacks is that he always goes one step further. He got the Game Boy Working, so then he figured why not make an SNES emulator work? Why not run Doom? Can I use a VNC forwarder to play current-gen games? Very awesome.

    Didn’t mention it above, but he told me he plans to publish an in-depth post about the hardware once he completes his TODO list (add wireless charging, fix the audio buffer delay, etc.)

    1. FYI, before people are going to request sources I don’t have: both Doom and the SNES emu were done using the VNC client as well, that was the reason I only mentioned them that briefly. I’m sure Doom can be ported to the ESP32 (actually already have a working one at work, which unfortunately isn’t stable due to a silicon bug…) and maybe the SNES emu can as well, but the GB emu cost me enough time already so I did not try those.

      1. Hey man what you have created is amazing!! Honestly I can see this being as popular as the arduboy. A couple YouTube tutorials and easy to read documentation and you have yourself an amazing D.I.Y project. I would love to make one (or at least own one…). One question though, can it play Pokemon on the gbc? because I know that has some rtc elements in it, and I don’t how the ESP-32 handles that. if its not necessary for the game, I wouldn’t mind it not being there, but Good luck on the future of this!

    1. “Half the size of the Micro” is kinda, sorta accurate, but it doesn’t convey how small this thing actually is. Not only can this thing fit in your pocket, but you can *lose* it in your pocket.

      I’m really, really looking forward to a random company in China ripping off the design and putting these things up on aliexpress.

  2. Love what you done I think it’s good work you done there.
    I hate the enclosure I wish you could make it better so it looks the part.
    Sorry not putting your project down. Would love to see it in a better made enclosure. Great work.

  3. According to the speaker driver problem: Why did you use a motor driver and not just a tiny class D audio amp? They come in something like a 3*3mm DFN8 and deliver up to a watt from a 3V (LiIon) supply. I used one some time ago, I think it was from TI, but I have the details at home.

      1. Spot on. In the end, I will release everything needed to make this under a liberal license. If someone decides to manufacture the thing with that as a base, I would absolutely not mind. For me personally, I don’t think any profits generated from a crowdfunding campaign I’d do would weigh up to my sleep being disturbed by nightmares of the big N knocking on my door…

  4. Sprite_tm, amazing work as always! P.S. Since you live in China now, you should totally tip off some companies about this project (when you release the software, 3D plans and the schematics) and I’m sure it will become a reality in no time :)

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.