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”

AI Bot Plays Castlevania So You Don’t Have To

We’re not allowed to have TV here in the Hackaday Wonder Bunker, but occasionally we’ll pool together the bandwidth credits they pay us in and gather ’round the old 3.5 inch TFT LCD to watch whatever Netflix assures us is 93% to our liking. That’s how we found out they’ve made a show based on, of all things, one of the Castlevania games for the NES. We wanted to play the game to understand the backstory, but since it hails from the era of gaming where primitive graphics had to be supplemented with soul-crushing difficulty, we didn’t get very far.

But thanks to a very impressive project developed by [Michael Birken] maybe we’ll have it all figured out by the time we’ve saved enough credits to watch Season 2 (no spoilers, please). The software, which he’s quick to point out is not an example of machine learning, is an attempt to condense his personal knowledge of how to play Castlevania into a plugin for the Nintaco NES emulator. The end result is CastlevaniaBot, which is capable of playing through the original Castlevania from start to finish without human intervention. You can even stop and start it at will, so it can play through the parts you don’t want to do yourself.

[Michael] started this project with a simple premise: if he could make a bot successfully navigate the many levels of Dracula’s castle, then getting it to kill a few monsters along the way should be easy enough. Accordingly, he spent a lot of time perfecting the path-finding for CastlevaniaBot, which included manually playing through the entire game in order to get an accurate map of the background images. These images were then analyzed to identify things like walls and stairs, so the bot would know where it could and couldn’t move protagonist Simon Belmont. No matter what the bot is doing during the game it always considers where it is and where it needs to be going, as there’s a time limit for each stage to contend with. Continue reading “AI Bot Plays Castlevania So You Don’t Have To”

Wheel Of Fortune Gets Infinite Puzzles On NES

Wheel of Fortune is a television game show, born in the distant year of 1975. Like many popular television properties of the era, it spawned a series of videogames on various platforms. Like many a hacker, [Chris] had been loading up the retro NES title on his Raspberry Pi when he realized that, due to the limitations of the cartridge format, he was playing the same puzzles over and over again. There was nothing for it, but to load a hex editor and get to work.

[Chris’s] initial investigation involved loading up the ROM in a hex editor and simply searching for ASCII strings of common puzzles in the game. Initial results were positive, turning up several scraps of plaintext. Eventually, it became apparent that the puzzles were stored in ASCII, but with certain most-significant-bits changed in order to mark the line breaks and ends of puzzles. [Chris] termed the format wheelscii, and developed an encoder that could turn new puzzles into the same format.

After some preliminary experimentation involving corrupting the puzzles and testing various edge cases, [Chris] decided to implement a complete fix. Puzzles were sourced from the Wheel of Fortune Puzzle Compendium, which should have plenty of fresh content for all but the most addicted viewers. A script was then created that would stuff 1000 fresh puzzles into the ROM at load time to minimize the chances of seeing duplicate puzzles.

ROM hacks are always fun, and this is a particularly good example of how simple tools can be used to make entertaining modifications to 30-year-old software. For another take, check out this hack that lets the Mario Bros. play together.

Little Emulators Do 8 Bits At A Time

Have you ever wondered how many, for example, Commodore 64s it would take to equal the processing power in your current PC? This site might not really answer that, but it does show that your machine can easily duplicate all the old 8-bit computers from Commodore, Sinclair, Acorn, and others. By our count, there are 86 emulators on the page, although many of those are a host machine running a particular application such as Forth or Digger.

If you are in the US, you might not recognize all the references to the KC85, this was an East German computer based on a Z80 clone. Very few of these were apparently available for personal purchase, but they were very popular in schools and industry. These were made by Robotron, and there are some other Robotron models on the page, too.

Continue reading “Little Emulators Do 8 Bits At A Time”

SNES Controller Has A Pi Zero In The Trunk

We’re no stranger to seeing people jam a Raspberry Pi into an old gaming console to turn it into a RetroPie system. Frankly, at this point it seems like we’ve got to be getting close to seeing all possible permutations of the concept. According to the bingo card we keep here at Hackaday HQ we’re just waiting for somebody to put one into an Apple Bandai Pippin, creating the PiPi and achieving singularity. Get it done, people.

That being said, we’re still occasionally surprised by what people come up with. The Super GamePad Zero by [Zach Levine] is a fairly compelling take on the Pi-in-the-controller theme that we haven’t seen before, adding a 3D printed “caboose” to the stock Super Nintendo controller. The printed case extension, designed by Thingiverse user [Sigismond0], makes the controller about twice as thick, but that’s still not bad compared to modern game controllers.

In his guide [Zach] walks the reader through installing the Raspberry Pi running RetroPie in the expanded case. This includes putting a power LED where the controller’s cable used to go, and connecting the stock controller PCB to the Pi’s GPIO pins. This is an especially nice touch that not only saves you time and effort, but retains the original feel of the D-Pad and buttons. Just make sure the buttons on your donor controller aren’t shot before you start the build.

Adding a little more breathing room for your wiring isn’t the only reason to use the 3D printed bottom, either. It implements a very clever “shelf” design that exposes the Pi’s USB and HDMI ports on the rear of the controller. This allows you to easily connect power and video to the device without spoiling the overall look. With integrated labels for the connectors and a suitably matching filament color, the overall effect really does look like it could be a commercial product.

The SNES controller is an especially popular target for hacks and modifications. From commercially available kits to the wide array of homebrew builds, it there’s plenty of people who want to keep this legendary piece of gaming gear going strong into the 21st century

Continue reading “SNES Controller Has A Pi Zero In The Trunk”

A New Take On Building A Portable N64

When home consoles go mobile, whether in the form of modded original hardware or emulation, they usually take a pretty standard shape. A screen in the middle, with buttons either on the sides or below it. Basically the same layout Nintendo popularized with born-handheld systems such as the Game & Watch series and original Game Boy. Like the saying goes, if it ain’t broke…

But [Le Nerdarto] had a different idea. He came across a broken N64 and wanted to turn it into a portable console, but not necessarily a handheld one. Noticing the cartridge was about the perfect size to contain a small LCD and in an ideal position, he set out to make what is arguably the most literal interpretation of “portable N64” we’ve ever seen. It might not be the most practical iteration of this concept, but it definitely gets extra points for style.

After he stripped the N64 of its original hardware, he installed a Raspberry Pi 3 and an RC battery eliminator circuit (BEC) to get 5V out of the internal 6200 mAh 7.4V battery. [Le Nerdarto] says this provides power for the Pi, the LCD, and the various lighting systems for up to 10 hours. He’s also added USB ports in the front of the system for controllers, and an HDMI port on the back so he can still connect the system up to a TV when not on the move.

The 3.5 inch LCD in the cartridge is arguably the centerpiece of the build, and while it might be on the small side, we can’t deny it’s a clever idea. [Le Nerdarto] had the good sense to tilt the it back a few degrees to put the display at a more comfortable angle, but otherwise it looks stock since he was able to fit everything in without cutting the back of his donor cartridge out. For those who might be wondering, the “cartridge” can’t be removed, but we’ll admit that would have been a killer feature to add especially with the HDMI port on the back.

Of course, since it’s running emulators on a Raspberry Pi, this isn’t only a portable N64. The front mounted USB ports allow him to plug in all sorts of controllers and emulate classics from pretty much any console that’s older than the N64 itself. Ironically the Raspberry Pi 3 isn’t exactly an ideal choice for N64 emulation, but a good chunk of titles are at least playable.

If you’re more of a purist and want a true portable N64, we’ve covered plenty of those over the years to get you inspired.

Continue reading “A New Take On Building A Portable N64”

Metroid, Zelda, And Castelvania Auto-Mapped With NES Emulation & Heuristics

The NES was one of the flagship consoles of the glorious era that was the 1980s. Many of the most popular games on the platform involved some sort of adventure through scrolling screens — Metroid, Super Mario, and Zelda all used this common technique. For many games, keeping track of the map was a huge chore and meant mapping by hand on graph paper or using the screenshots published in Nintendo Power magazine. These day’s there’s a better way. [Daniel] set out to automatically map these huge two-dimensional worlds, developing software he calls WideNES to do it.

WideNES is an add-on to [Daniel]’s own NES emulator, ANESE. As part of the emulator, WideNES can easily read the various registers of the NES’s Picture Processing Unit, or PPU. The registers of the PPU are used to control the display of the background and sprite layers of NES graphics, and by monitoring these, it is possible to detect and map out the display of levels in various NES games.

It’s an interesting piece of software that relies on a thorough understanding of the NES display hardware, as well as the implementation of some neat tricks to deal with edge cases such as vertical scrolling in The Legend of Zelda or room changes in games like Castlevania — the use of perceptual hashing is particularly genius. There’s source and more available on the project page, including a GitHub link, if you’re interested in getting down to brass tacks.

We’re impressed by the manner in which WideNES is able to so neatly map out these games of yesteryear, and can’t wait to see where the project goes next. [Daniel] notes that it should be possible to integrate into more popular emulators without too much trouble. If that’s not enough, check out this reverse-emulation Nintendo hack.

[Thanks to Michael for the tip!]