When the only tool you have is a hammer, all problems look like nails. And if your goal is to emulate the behavior of an FPGA but your only tools are FPGAs, then your nail-and-hammer issue starts getting a little bit interesting. That’s at least what a group of students at Cornell recently found when learning about the Xilinx FPGA used by a researcher in the 1990s by programming its functionality into another FPGA.
Using outdated hardware to recreate a technical paper from decades ago might be possible, but an easier solution was simply to emulate the Xilinx in a more modern FPGA, the Cyclone V FPGA from Terasic. This allows much easier manipulation of I/O as well as reducing the hassle required to reprogram the device. Once all of that was set up, it was much simpler to perform the desired task originally set up in that 90s paper: using evolutionary algorithms to discriminate between different inputs.
While we will leave the investigation into the algorithms and the I/O used in this project as an academic exercise for the reader, this does serve as a good reminder that we don’t always have to have the exact hardware on hand to get the job done. Old computers can be duplicated on less expensive, more modern equipment, and of course video games from days of yore are a snap to play on other hardware now too.
Join editors Mike Szczys and Elliot Williams as they recount a week of fascinating hacks. We take a good look at the PMS150C, a microcontroller that literally costs pennies but can only be flashed once. SNES emulators have a new trick up their sleeves to make low-def a lot less low, and you retro enthusiasts will either hate or love the NES zapper chandelier. Elliot’s enamored by a bike computer running Android core, and both Mike and Elliot delve into the food hacking scene, be it meat, chocolate, coffee, or of course frosting!
Take a look at the links below if you want to follow along, and as always, tell us what you think about this episode in the comments!
This is likely not to come as much of a shock to you, but the ESP8266 is pretty popular. At this point, we’re more surprised when a project that hits the tip line doesn’t utilize this incredibly cheap WiFi-enabled microcontroller. If you’re making a gadget that needs to connect to the Internet, there’s a good chance some member of the ESP family is going to be a good choice. But is it a one-trick MCU?
Well, judging by software frameworks like the “Little Game Engine” created by [Igor], it looks like the ESP is expanding its reach into offline projects as well. While it might not turn the ESP8266 into a next-gen gaming powerhouse, we’ve got to admit that the demos shown off so far are pretty impressive. When paired with a couple of buttons and a TFT display such as the ILI9341, the ESP could make for a particularly pocket-friendly game system.
The game engine that [Igor] has developed provides the programmer with a virtual screen resolution of 128×128, a background layer, and 32 sprites which offer built-in tricks like collision detection and rotation. All while running at a respectable 20 frames per second. This environment is ideal for the sort of 2D scrolling games that dominated the 8 and 16-bit era of gaming, and as seen in the video after the break, it can even pull off a fairly decent clone of “Flappy Bird”.
In addition, [Igor] created an online emulator and compiler which allows you to develop games using his engine right in your web browser. You can load up a selection of example programs and execute them to see what the engine is capable of, then try your hand at developing your own game before ever having to put the hardware together. Incidentally, the performance of this online development environment is fantastic; with even the fairly complex “Flappy Bird” example code compiling and starting in the emulator nearly instantaneously.
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.
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 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.
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.