MiSTer DIY: Accurately Simulating Retro Game Consoles With FPGAs
Do-It-Yourself Retro Gaming On FPGA Power
It seems like it wasn't too long ago that we crowned the Raspberry Pi 4 as one of the best retro game consoles around. Indeed, the Raspberry Pi foundation's latest single-board computer still a low-cost DIY powerhouse. However, retro gamers are picky about one thing that haunts many software emulation solutions that run on the likes of the Pi 4 or an NVIDIA SHIELD Android TV -- and that's lag. Thanks to a talented group of developers and some off-the-shelf parts, the MiSTer project aims for a lag-free, higher quality, more accurate retro gaming experience.
Built on the Terasic DE10-nano (an Intel-based System-on-Chip (SoC) FPGA board), the MiSTer project strives to accurately recreate computers, consoles, and arcade hardware from the 1970s, 80s, and early 90s. Terasic's small development board is a staple in universities and technical schools worldwide as an educational tool. That means it's always in mass production and the resultant price is low enough to make a setup relatively affordable.
Now You're Playing With FPGA PowerField-programmable gate arrays, or FPGAs, are programmable chips (an array of configurable logic gates) that developers can use to simulate specific hardware functions at a very low level. Typically, engineers program FPGAs for simulating hardware during the prototyping phase, but unless a manufacturer is going to mass-produce a dedicated chip, that functionality might remain in FPGA form. NVIDIA's G-Sync module uses an FPGA, for example, and Analogue's line of retro consoles, like the Super Nt, Mega Sg, and upcoming Pocket, use FPGAs too.
FPGAs aren't magic and using one doesn't automatically guarantee an accurate or fun experience, however. It takes a talented engineer to reverse engineer a game system, figure out how it works, and translate it to the FPGA for processing and feature-complete functionality. Analogue's systems are accurate thanks to Kevin "kevtris" Horton's efforts. MiSTer is a platform upon which tons of retro systems live thanks to the hard work of its community spearheaded by project founder and hardware add-on designer Sorgelig. Without their time, money, and sweat investment, MiSTer would not exist as it does today.
Let's take a quick look at what you'll need to get MiSTer off the ground:
|Terasic DE10-nano FPGA Development Board||$130.00|
|Gadgeter Aluminum Heatsinks||$9.99|
|Micro USB OTG powered hub||$9.90|
|Samsung EVO Select 64 GB Micro SD card||$11.99|
|8Bitdo M30 2.4G for Sega Genesis Mini||$24.99|
|Logitech MK270 wireless keyboard and mouse||$20.99|
On the surface, a MiSTer setup looks somewhat pricey. While it's not an impulse buy, it's quite a steal next to other FPGA consoles. Analogue's systems and the RetroUSB AVS (an FPGA remake of the Nintendo Entertainment System), for example, all go for around $190 to recreate a single system, and don't include a controller. They also rely on original cartridges. We're getting by pretty cheaply here, considering all the value the MiSTer platform represents. This setup also doesn't cost much more than the high-end Raspberry Pi 4 with 4 GB of memory, since you'll need a controller, keyboard, and micro SD card either way you go.
The DE10-nano has a single micro USB port that works with USB OTG devices. That port also doesn't provide much power, so you'll want to plug our recommended hub into a USB wall charger. The 8bitdo M30 2.4G noted above is a wireless controller that uses 2.4 GHz radio signals to transmit to a dedicated receiver plugged into one of the USB ports, originally made for the Sega Genesis Mini microconsole. For controllers with six face buttons and two shoulder buttons, like the Saturn's controller, this is the gamepad to get. Wireless might seem counter-intuitive due to lag concerns, but RetroRGB measured the Genesis version at just three milliseconds of latency. If you like other controllers, you can get a wired gamepad or Bluetooth dongle and connect just about anything, including a Dual Shock 4 or Xbox One controller.
Optional MisTer Add-OnsTerasic outfitted the DE10-nano with an Altera Cyclone V FPGA, which runs the emulation cores. The DE10-nano also has two sets of 40-pin general-purpose I/O (GPIO) headers, and depending on your needs you might want to fill one of them with an SDRAM board. Some MiSTer cores require lower latency access to memory than the ARM cores of the Cyclone V can provide, so giving the FPGA its own dedicated memory pool is the best solution. Many cores run just fine without SDRAM, but some, like the Neo Geo, really need it. If you have the soldering skills, you can buy the board from PCBWay and the parts required for assembly.
If you can't solder tiny surface-mounted components (who would blame you), you could check out MiSTer Addons, which sells a 128 MB SDRAM board. MiSTer Addons also has tons of optional accessories, including Wi-Fi and Bluetooth adapters, case options, and purpose-built boards for USB and analog audio and video. None of this is necessary to enjoy a MiSTer setup, but folks who want CRTs or a tidy system might like them. My personal setup has both optional boards, to output to an Open Source Scan Converter (OSSC) and keep USB connections tidy. The official MiSTer community at Atari Forum has a list of other vendors if you're not in the US.
MiSTer FPGA Retro Gaming SetupOnce you've got the parts in hand, assembly is very straightforward. Even more straightforward is the setup process. The MiSTer Wiki has a setup guide, but all you really need is the installer EXE file. Simply plug your micro SD card into your PC running Windows and run the installer, which copies the barebones files required to get MiSTer off the ground. After that, plug the card into the DE10-nano and fire it up.
The first thing you'll want to do is configure your gamepad's buttons to navigate the menu system. You'll need the keyboard to get started, so just hit F12 and pick option to setup the controller from the menu. The updater script will automatically configure every supported system by connecting to a network via Ethernet or a Wi-Fi dongle. You can check out the MiSTer Wiki's Core Status page to see everything that's covered, but there are a ton of cores available. MiSTer includes the biggest consoles and computers of the 80s and 90s, including Nintendo, Sega, Commodore, and Apple. Even SNK's Neo Geo arcade/console hybrid is here.
As far as games, you'll need your own legally-obtained ROMs and place them into folders for each one. You can do that directly on the SD card, or via a network share. This process is no more difficult than setting up any other emulator. Once you place your ROMs into the correct folder, the core will automatically detect them, so they're ready to play.
Setting up the arcade cores requires specific MAME ROMs. To make that process easier, GitHub user RetroDriven maintains a script that automatically sets up boat loads of older arcade games up through the late 80s. Other arcade systems in the works include Jose Tejada's Capcom Play System (CPS-1) core, which is currently in development.
The Advantages Of Retro FPGA Console Games Vs Software EmulationThe whole point of the MiSTer platform is to recreate classic computers and consoles in a cycle-accurate (true to the hardware) way. Old consoles have inter-chip cycle rates that developers could use to do some neat tricks, but as mGBA developer Endrift documented, software emulators have traditionally had a hard time dealing with those. MiSTer attempts to sidestep these issues by replicating the system at a hardware level in the FPGA.
Since software emulators rely on the underlying OS for input, software emulators can struggle with input latency. The LibRetro team dealt with this in RetroArch by implementing Run Ahead, which is a brute-force method of running multiple emulation instances and trying to guess what the player will do next. However, that requires a pretty powerful PC. MiSTer's low-level "hardware" style of emulation side-steps this issue, and further mitigates it by offering 1 kHz USB polling. The result is very low latency for a much more accurate experience.
Another source of lag is audio latency, where sounds don't play with a frame as it's displayed, so sounds might be a few frames late. YouTubers My Life in Gaming covered this in depth with their NES Classic review, but this issue affects all of the popular small gaming platforms that run some form of software emulation. The only alternative would be to delay the video another four frames to sync it up with the audio, which would make the lag intolerable to many users. MiSTer also sidesteps this problem as well, by talking to its HDMI port directly via the FPGA.
MiSTer's hardware timeline stops in around 1992 for home consoles and 2001 for handhelds, which is its only downside. MiSTer cores for the PlayStation, Saturn, and Nintendo 64 aren't currently available, let alone newer systems like the PlayStation 2 or Dreamcast. That's where software emulators or real hardware are still necessary. It's possible that the development community will pump out cores for newer systems down the road, but we wouldn't advise buying a MiSTer setup for these un-developed cores currently.
How MiSTer Avoids Game LagThe MiSTer platform uses a simple but effective image scaling algorithm which upscales the native video output by the selected system to fit a modern HDTV. Like several other simple upscaling solutions which use an FPGA, like the OSSC, the image is converted on the fly. The upscaling algorithm then displays it to the TV. Audio and video come together across the HDMI cable converted from their hardware emulated components and without the need of additional driver pipelines.
Since analog signals aren't rigidly locked like digital HDMI signals, some systems updated the screen slightly faster or slower than exactly 60 Hz. For example, the Genesis runs at 59.8 Hz, and the SNES runs at a slightly faster 60.1 frames per second. MiSTer can output those slightly wonky refresh rates to the TV without using a frame buffer, resulting in lag of just a few microseconds. However, not all HDTVs can handle those slightly off-spec timings, so MiSTer defaults to a single frame buffer, which does technically introduce a little bit of latency for the sake of compatibility, but keeps lag to a minimum.
If your TV can handle it, you can go buffer-free for the lowest-latency experience. We found that our TCL 55P605 4K Roku TV can handle refresh rates as low as 59.7 Hz, but the Super Nintendo's faster-than-standard refresh rate required enabling the frame buffer, since the TV would lose sync every few seconds. A single frame buffer adds up to one frame of latency, which we could not feel. Normally when I play on the system, I use the IO Board's analog connectors with an OSSC, which does a better job compensating for those odd refresh rates and saves me an HDMI port on my TV. The lag-free option also works great on CRTs.
But How Does MiSTer Play That Retro Game Goodness?To really get a feel for MiSTer, we could describe the experience, but we think it's better to show the experience. To do so, we busted out our trusty AVerMedia Live Gamer Mini USB capture device and hooked up the DE10-nano. All of the video presented here is captured via the Live Gamer Mini at 720p at 60 frames per second. I like to run my MiSTer outputting at 720p over HDMI because it's an exact multiple of the 240p (224 lines active) image generated by so many classic consoles. This eliminates non-integer scaling and the majority of the black bars generated by integer scaling at 1080p, since those classic system scan only fill 960 lines at best. Without further ado, here's a sampling of what the MiSTer platform can do.
Gameplay from a whole bunch of retro systems in video form
The YouTube video starts a little after the dawn of video game history and runs up through the 16-bit era, closing out with some of the later Neo Geo titles to ever come out, King of Fighters 2002 and Garou: Mark of the Wolves. Throughout the video you can get a feel for how the MiSTer looks and sounds. We're quite impressed with the setup. I've actually boxed up a lot of my old gaming consoles over the last several months because there's just not as much need for them to be hooked up when this single machine can convincingly recreate them.
We also showed off some post-processing effects like the Genesis core's composite blending. This algorithm averages adjacent pixels to eliminate dithering. Games like Streets of Rage 2 and Sonic the Hedgehog have pseudo-transparency effects arranged in alternating pixels that gives the illusion of transparency. The effect also blends checkerboard patterns of alternating colors to create additional hues the Genesis couldn't do on its own. You can see these in our video.
For all systems, the scan line filter makes games feel like they're running on a CRT by alternating light and dark lines, just like the 240p progressive image on a CRT. In particular, the Soft Scanlines effect adds bloom to bright pixels, giving the image a warm analog feel. The LCD filter creates a "screen door" effect on Game Boy, Game Boy Advance, and Game Gear titles to make those games feel like they're running on their original displays.
Audio is perfectly in sync. Since you can slow down YouTube video to half-speed, it's easy to test. Just go back and play the video at 50% and watch and listen. Sound effects happen right with the action, which isn't the case on the Raspberry Pi or NVIDIA Shield. Those systems aren't bad, and many folks may not notice it, but some folks are particularly sensitive to that sort of timing issue (musicians, mostly) and it can be very distracting.
For folks who are interested in audio quality, several cores have configurable options. For example, the Genesis and Sega CD cores can apply different low-pass filters to sound like a model 1 or model 2 Genesis. The NES core supports external audio like the Akoumaju Densetsu, the Japanese version of Castlevania 3, which sounds amazing in our sample video.