A Game Boy Supercomputer for AI Research

Reinforcement learning has been a hot-button area of research into artificial intelligence. This is a method where software agents make decisions and refine these over time based on analyzing resulting outcomes. [Kamil Rocki] had been exploring this field, but needed some more powerful tools. As it turned out, a cluster of emulated Game Boys running at a billion FPS was just the ticket.

The trick to efficient development of reinforcement learning systems is to be able to run things quickly. If it takes an AI one thousand attempts to clear level 1 of Super Mario Bros., you’d better hope you’re not running that in real time. [Kamil] started by coding a Game Boy emulator in C. By then implementing it in Verilog, [Kamil] was able to create a cluster of emulated Game Boys that enabled games to be run at breakneck speed, greatly speeding the training and development process.

[Kamil] goes into detail about how the work came to revolve around the Game Boy platform. After initial work with the Atari 2600, which is somewhat of a defacto standard in RL circles, [Kamil] began to explore further. It was desired to have an environment with a well-documented CPU,  a simple display to cut down on the preprocessing required, and a wide selection of games.

The goal of the project is to allow [Kamil] to explore the transfer of knowledge from one game to another in RL systems. The aim is to determine whether for an AI, skills at Metroid can help in Prince of Persia, for example. This is arguably true for human players, but it remains to be seen if this can be carried over for RL systems.

It’s rather advanced work, on both a hardware emulation level and in terms of AI research. Similar work has been done, training a computer to play Super Mario through monitoring score and world values. We can’t wait to see where this research leads in years to come.

Corn Starch Fixes A Game Boy Screen

Nintendo’s Game Boy was the handheld of the 1990s. Like many of their products, it was famous for its ability to stand up to punishment from angry children and military strikes alike. Its biggest weakness is perhaps its unbacklit LCD screen. Retrogamers and chiptuners alike find themselves modifying and replacing these regularly.

A common problem during these swaps is “Newton rings” – an issue where the polarizer comes into contact with the LCD glass, causing unsightly visual artifacts. Thankfully, there is a simple fix. It’s possible to keep the two separated with the application of microscopic particles, too small to see. [esotericsean] uses cornstarch, while [bogamanz] favors diatomaceous earth. For best results, a makeup brush can be used to apply a fine coating, and compressed air used to clean out the Game Boy and remove any excess.

It’s rare to fix a delicate screen problem with a household staple, but gratifying when it works. The results are hard to see on camera, but many report this fixing the frustrating issue. So, if you’re planning to backlight your Game Boy, keep this in your bag of tricks. It’ll allow you to get the best possible result, and may be useful on other old-school LCDs as well. Video after the break.

Continue reading “Corn Starch Fixes A Game Boy Screen”

Playing Pokemon On A CRT Thanks to A Powerful Microcontroller

Microcontrollers come in a broad swathe of capabilities these days. There are the venerable 8-bit micros that have been around forever and valiantly crunch away, all the way up to modern 32-bit powerhouses with advanced peripherals and huge amounts of RAM and ROM. If you’re blinking a few LEDs or opening a garage door, the former is fine. For what [Jared] had in mind, a little more horsepower was required.

[Jared]’s project started out as an experiment with composite video output on a STM32F446RE microcontroller. Using a 4-bit resistor DAC, the device was able to output NTSC signals, using interrupts and NOPs to handle timing. The hardware worked, and was tested by playing the entirety of Star Wars: A New Hope from an SD card.

Attention then turned to creating a Game Boy emulator for the platform. After many hurdles with various bugs and edge cases, things started working, albeit slowly. The Pokemon game ROM wouldn’t fit in the microcontroller’s limited flash storage, so [Jared] implemented a complicated bank switching scheme. This combined with the limited computational resources meant the game was playable, but limited to just 10 FPS.

Enter the STM32H7. With over double the clock speed and capable of 856 DMIPS versus 225 of the original chip, things were coming together. Pokemon now ran at 60 FPS, and the built-in DAC greatly improved the sound. The DMA subsystem allowed further performance gains, and even running in debug mode, performance far exceeded that of the previous hardware.

With unit prices of most microcontrollers being remarkably low, it goes to show that once you’ve tapped out on performance on one platform, there’s usually a faster option available. It’s possible to emulate the Game Boy on the ESP-32 too, as Sprite_TM showed us in 2016. Video after the break.

[Thanks to Ben for the tip!]

Continue reading “Playing Pokemon On A CRT Thanks to A Powerful Microcontroller”

FPGA Brings Arduboy to the Game Boy Advance

Hackaday readers are perhaps familiar with the Arduboy, an open source handheld gaming system that aims to combine the ease of Arduino development with the seething nostalgia the Internet has towards the original Nintendo Game Boy. While not quite the same as getting one of your games published for a “real” system, the open source nature of the Arduboy platform allows an individual to develop a game playable on a commercially manufactured device.

While the Arduboy hardware itself is actually quite slick, that hasn’t stopped people from trying to bring its games to other pieces of hardware. Now thanks to the efforts of [uXe], the Game Boy Advance is well on its way to becoming Arduboy compatible, in a way bringing the whole project full circle. Assuming this gadget becomes a commercial device (it sounds like that’s still up in the air), Arduboy developers will be able to proudly play their creations on the final and objectively best entry into the Game Boy line.

Getting to this point has been something of an adventure, as documented in a thread from the Arduboy forums. Members of the community wondered what it would take to get Arduboy games running on a real Game Boy, but pretty quickly it was decided that the original beige brick model wasn’t quite up to the task. Eventually its far more capable successor the Game Boy Advance became the development target, and different approaches were considered for getting existing games running on the platform.

While there were some interesting ideas, such as using the GBA’s link port to “feed” the system games over SPI, in the end [uXe] decided to look into creating an FPGA cartridge that would actually run the Arduboy games. In this scenario, the GBA itself is basically just being used as an interface between the FPGA and the human player. In addition to these low-level hardware considerations, there was considerable discussion about the more practical aspects of bringing the games to the new hardware, such as how to best scale the Arduboy’s 128 x 64 output to the GBA’s 240 × 160 screen.

As demonstrated in the videos after the break, [uXe] now as all the elements for playing Arduboy games on the GBA in place, including the ability to disable full screen scaling by using the shoulder buttons. Now he just needs to shrink the hardware down to the point it will fit inside of a standard GBA cartridge. Beyond that, who knows? Perhaps the appeal of being able to run Arduboy games on a real Game Boy is enough to warrant turning this hack into a new commercial product.

Thanks to a hardware swap we’ve seen Arduboy games played on the Dreamcast VMU, and [uXe] himself previously grafted Arduboy-compatible hardware into an original Game Boy, but being able to play these games on an unmodified Game Boy Advance obviously has its own appeal. At the very least, it will be a bit more ergonomic than using a hacked classroom gadget.

Continue reading “FPGA Brings Arduboy to the Game Boy Advance”

Use Your Game Boy As A Wireless Controller

Like many retro favourites, the Game Boy is in no way dead — development continues apace through its many fans.But what about the hardware side? This is a particularly interesting one: [Alex] wondered if a Game Boy could be readily used as a wireless controller. Set out to make it happen, the final product is a game cartridge that makes the classic handheld a wireless controller.

It’s achieved quite elegantly, with a custom cartridge used to turn the Game Boy into a controller while requiring no modification to the handheld. The cartridge contains a flash chip to store the ROM, along with an ATmega48PA microcontroller and an NRF24L01 to do the talking. Upon powerup, the Game Boy runs code from the ROM, and the microcontroller is in charge of reading button states and sending them to the NRF24L01 for transmission. The program stored on the ROM also allows configuration changes to be made from the Game Boy itself, such as choosing the appropriate wireless channel.

The cartridge transmitter can be used with a variety of receivers. [Andy] has developed a USB HID joystick emulator to allow the Game Boy to be used with PCs, as well as a receiver for the GameCube, too. Yes, that’s right — you can now play Super Smash Bros. with a weirder controller than all your friends. A Super Nintendo version is also in the works. Perhaps the coolest feature, however, is that the cart can use its radio link to communicate with another Game Boy running the same cartridge. [Andy] demonstrates this with a basic game of Pong being played between two Game Boy Advances.

Working on retro hardware can be great fun — things are well documented, parts are cheap, and there’ll be plenty of fans cheering you on, too. [Andy] has even made the hardware available for purchase on Tindie and his website if you’re not quite comfortable rolling your own.

The Game Boy platform remains ripe for hacking – you can even take screenshots with a logic analyzer these days. Video after the break.

Continue reading “Use Your Game Boy As A Wireless Controller”

A Canon Lens Adapter for the Game Boy Camera

Released in 1998, the Game Boy camera was a bit ahead of its time. This specialized Game Boy cartridge featured a 128×128 pixel CMOS sensor and took 4-color greyscale photos. The camera even rotated, allowing for selfies years before that word existed.

The fixed lens on this camera meant no zoom was possible. [Bastiaan] decided to address this shortcoming by building a Canon EF Lens Mount. The resulting build looks hilarious, but actually takes some interesting photos.

[Bastiaan] designed the mount using Rhino 3D, and printed it out on a Monoprice 3D printer. After some light disassembly, the mount can be screwed onto the Game Boy Camera. With the massive 70-200 f4 lens and 1.4x extender shown here, the camera gets a max focal distance of just over 3000 mm.

One issue with the Game Boy Camera was the limited options for doing anything with the photos. They could be transferred to other Game Boy Camera cartridges, or printed using the Game Boy Printer. Fortunately, [Brian Khuu] has a modern day solution that emulates the Game Boy Printer using an Arduino. This lets you get PNG files out of the device.

This Thermal Printer has Serious Game

[Dhole], like the fox, isn’t the first to connect his computer to a Game Boy printer but he has done a remarkable job of documenting the process so well that anyone can follow. The operation is described well enough that it isn’t necessary to scrutinize his code, so don’t be put off if C and Rust are not your first choices. The whole thing is written like a story in three chapters.

The first chapter is about hacking a link cable between two Game Boys. First, he explains the necessity and process of setting the speed of his microcontroller, a NUCLEO-F411RE development board by STMicroelectronics. Once the rate is set, he builds a sniffer by observing the traffic on the cable and listens in on two Game Boys playing Tetris in competition mode. We can’t help but think that some 8-bit cheating would be possible if Tetris thought your opponent instantly had a screen overflowing with tetrominoes. Spying on a couple of Game Boys meant that no undue stress was put on the printer.

Chapter two built on the first chapter by using the protocol to understand how the printer expects to be spoken to. There is plenty of documentation about this already, and it is thoughtfully referenced. It becomes possible to convince a Game Boy that the connected microcontroller is a printer so it will oblige by sending an image. Since there isn’t a reason to wait for printing hardware, the transfer is nearly instantaneous. In the image above, you can see a picture of [Dhole] taken by a Game Boy camera.

The final chapter, now that all the protocols are understood, is also the climax where the computer and microcontroller convince the printer they are a Game Boy that wants to print an image. In the finale, we get another lesson about measuring controller frequency without an oscilloscope. If you are looking for the hack, there it is. There is a handful of success in the form of old receipts with superimposed grayscale images since virgin thermal printer paper by Nintendo costs as much as a used printer.

This story had a happy ending but grab your reading glasses for the smallest Game Boy and here’s someone who wrote their own Game Boy color game.