Circuit-Level Game Boy: Upping Emulation Ante By Simulating Every Cycle

Usually when writing emulation software for a system like the Game Boy, one makes sure to take as many shortcuts as possible in order to reduce the resources required for the emulation. This has however the unfortunate side-effect that it reduces the overall accuracy of the emulation and with it the compatibility with games on the system.

This is the basic reasoning behind projects which seek to abandon simplistic abstractions in favor of cycle-accurate, full compatibility approaches, of which MetroBoy is probably the most extreme one. Instead of abstracting away the hardware, it instead does the emulation at the circuit level. As with such other projects, this means that the emulator requires a lot more CPU cycles to get things just right. On the bright side, one can likely still run this emulator on any modern system.

As the MetroBoy author explains, he implemented code in C++ which allowed him to construct circuits in an HDL-style manner, which should theoretically also allow him to generate a Verilog (or VHDL) softcore out of the project. As a demonstration of implementing HDL in C++ it’s decidedly interesting.

An approach like this is pretty much the exact opposite of a project like the UltraHLE (ultra high-level emulator) Nintendo 64 emulator, which used the knowledge that Nintendo 64 games are written in C as a first step to creating libraries that the code in the Nintendo 64 ROMs would call instead of the native (Nintendo) libraries. This allowed N64 games to directly run on the target system, with the graphic and system calls translated by UltraHLE into native OS calls, using the 3dfx Glide API for accelerated graphics.

While an approach like UltraHLE took allows for the most minimal use of system resources by essentially foregoing emulation completely, for retro systems like the Game Boy where games were implemented in assembly on bare hardware, using this circuit-level emulation ensures that one gets the most accurate match with the original handheld console experience.

As a word of caution to those who are now itching to try out MetroBoy, its Github site notes that it currently lacks support for game saves, uses a mixture of original Game Boy (DMG) and Game Boy Advance SP (AGS) hardware that confuses some games and has rather buggy sound support.

If playing around with software-defined Game Boy circuits isn’t enough and would like to literally look inside a real Game Boy, the X-ray image from the top of the article is something Chris over at Elektronaut pulled off several years ago.

Pano Logic FGPA Hacking Just Got Easier

When Pano Logic went out of business in 2012, their line of unique FPGA-based thin clients suddenly became a burden that IT departments didn’t want anything to do with. New and used units flooded the second-hand market, and for a while you could pick these interesting gadgets up for not much more than the cost of shipping. Thanks to considerable interest from the hacking community the prices for these boxes have climbed a bit on eBay, but they’re still a great way to get your feet wet with FPGA hacking.

Especially now, as Pano Logic fanatic [Skip Hansen] has figured out how to flash a new firmware on them without having to crack open the case and break out the JTAG or SPI programmer. For the seasoned hardware hacker that might not seem like a big deal, but if you’re new to the game or just more interested in the software side of the equation, this trick makes things considerably more accessible. Having an external programmer is still a good idea if things go south, but if you’re just looking to flash some demos and see what the hardware is capable of this is a huge quality of life improvement.

Even if you aren’t interested in fiddling with the orphaned products of a defunct Bay Area startup, the write-up is a fascinating look at practical software reverse engineering. As it turns out, [Skip] didn’t create this new firmware update tool from scratch. He actually opened up the official Linux update utility from Pano Logic in Ghidra and was able to figure out where the firmware image actually lived inside the program. He then wrote his own tool in C which will patch the update tool with a user-supplied firmware image.

After patching, all you need to do is follow the official update procedure, which Pano Logic helpfully documented in the YouTube video after the break. [Skip] mentions he didn’t find any clear license information in the official software he was fiddling with, and of course with the company out of business it’s not too likely anyone is going to come knocking down his door anyway. Still, he says the downloads for the Pano Logic updater are still floating around on the tubes out there for you to find, so he’s not distributing anyone’s code but his own in this project.

There are a number of hackers out there working to turn the Pano Logic thin clients into useful general purpose FPGA platforms, such as [Tom Verbeure], who’s incredible graphics demos got [Skip] inspired to grab his own unit off eBay. With support for USB and SDRAM added by [Wenting Zhang] while getting his FPGA GBA emulator running on the hardware, it seems there’s never been a better time to get on the Pano Logic train.

Continue reading “Pano Logic FGPA Hacking Just Got Easier”

Game Boy Recreated In Verilog

With the wide availability of Raspberry Pi hardware and pre-baked Linux distros with emulators ready to go, making a retro handheld is easier than ever. Emulation isn’t the only way to go about playing old games however. [Wenting Zhang] decided to instead recreate the Nintendo Game Boy in Verilog, and has documented the effort.

The project runs on a Spartan 6 FPGA. [Wenting] first developed the hardware to use a DualShock controller for input, and output video to a regular LCD monitor. However, work is now underway to produce a handheld VerilogBoy. This will feature a 320×320 LCD screen, with pixels being quadrupled from the original Game Boy 160×144 resolution, with some pixels to spare. [Wenting] is also looking at porting the code to some Pano Logic units, which we’ve discussed before. The thin clients pack FPGA hardware and lots of IO ports that make them perfect for such a project.

Code is available on Github for the curious tinkerers out there. While there are easier ways to play old handheld games, the amount of learning value of such a project should not be underestimated. We’ve seen FPGAs used for other Nintendo hijinx, too – like this NES cart that packs some serious muscle. Video after the break.

Continue reading “Game Boy Recreated In Verilog”

An FPGA Drives This Antique LCD Screen

If you’re reading this article on a desktop or laptop computer, you’re probably staring at millions of pixels on a TFT LCD display. TFT became a dominant technology due to its picture quality and fast response times, but it’s not the only way to build an LCD. There are cheaper technologies, such as STN and its color variant, CSTN. They’re rarely used nowadays, but [Wenting Zhang] had one lying around and wanted to take a crack at driving it.

Still scenes aren’t bad, but motion blur is readily apparent on any moving content.

The screen in question came courtesy of a 20th century laptop. It’s a Hitachi SX21V001-Z4, with a resolution of 640×480 pixels. Driver boards for CSTN screens were once readily available, however now such things are difficult to come by.

[Wenting] instead grabbed an FPGA and got to work. Driving displays can be taxing for small microcontrollers, so an FPGA is always a great choice when working on such projects. They’re easily capable of generating whatever weird and wacky signals are required, and can generate many such signals in parallel without breaking a sweat.

[Wenting] successfully got the screen up and running, and hooked up to a VGA input. Image quality is surprisingly passable for still images, though things absolutely go to pieces when motion is introduced. [Wenting]’s demo shows off the screen playing Breath of the Wild, and it’s a great showcase of how far technology has come since the mid-90s.

Driving strange LCDs is a hacker rite of passage, and we see plenty of efforts around these parts. Video after the break.

Continue reading “An FPGA Drives This Antique LCD Screen”

FPGA NES Looks Sharp On Perfboard

FPGAs are wonderful things, packed with logic cells that can be reconfigured as your heart desires. They excel at signal processing, anything requiring speed, and recreating vintage hardware. In that vein, [Jon Thomasson] decided to bring back the original Nintendo Entertainment System, in perfboard form.

The build uses a Spartan 6 from Xilinx, which [Jon] uses in the form of his own development board design. The NES core is courtesy of code by [Brian Bennett], sourced from Github. Games are loaded from an SD card by a Parallax Propeller, which passes the data to the FPGA over a serial connection. Display is on a sharp 800×480 LCD, with the 4:3 video output of the NES being displayed in a pillarboxed fashion.

The project is assembled on perfboard, with a pleasing handheld formfactor. Control is via tactile pushbuttons in the classic NES layout. Current draw is approximately 400 mA, giving a runtime of around 5 hours when running off four AA batteries.

We’ve seen the venerable NES implemented on FPGA platforms before. As development boards get cheaper and devices get more capable, expect to see ever more complex systems being implemented. Video after the break.

Continue reading “FPGA NES Looks Sharp On Perfboard”

Component Video For The Commodore 64

Of all the retro systems, the Commodore 64 had the best video system. The VIC-II chip in the C64 was the best example of why Commodore was the best, but in terms of video output, the C64 was still a consumer device: the only output was S-video, or composite video, or something like it. The professional stuff uses YPbPr, an RGB video signal that separates the red, green, and blue colors. On a modern LCD, the difference between composite and YPbPr is noticeable, and if you’re going to run your C64 on the big screen, it would be very helpful to use a professional video standard.

In an effort to bring the C64 into the future, [c0pperdragon] created an FPGA-based modification for the VIC-II chip. The end result is getting YPbPr signals directly from the computer, and outputting it to a TV in glorious 480p.

Inside the Commodore 64, the VIC-II creates the chrominance signal in a way that is impossible to convert it back to any form of RGB. The solution to get RGB out of this information is to listen in to 22 pins of the VIC-II to determine what signals it intends to generate. This is done with a smallish Altera FPGA connected to the VIC-II through a ribbon cable. On the FPGA, the luminescence and all the color information is generated, then converted into true YPbPr. For the complete mod, the RF modulator is removed, and the original A/V jack is still functional. This is effectively a very in-depth mod that rids the C64 of the TV connector and channel selector (that no one uses anymore) and replaces it with a professional-grade video output.

When it comes to C64 mods, we thought we’ve seen it all. We’ve seen C64s resurrected from the dead, and we’ve seen drop-in replacements for the SID that still don’t have working filters oh my god. This is on another level. This is using FPGAs to drag the C64 into the modern era, and if you don’t care about the rusting RF box, it’s a reversible mod.

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”