MiSTer FPGA: Recreate classic computers using modern hardware
mister-devel.github.io
mister-devel.github.io
I don't know what super fancy data flows are. That probably means we don't use them.
Hardware emulation has a pretty small niche between software emulation and real hardware. If you care about accuracy at all costs, real hardware is usually still available and not too expensive, and if you care about convenience, software emulation is better.
I all depends. There's a "retro" bubble currently and people ask silly money for the original hardware. Then capacitors burst, original hardware needs maintenance, and is not something everybody can do.
The MISTer provides an experience that gets very close to the original hardware, without all those nuances.
Playing earthbound a few years ago I was constantly savescumming. My recently replay on mister without savetsates was way more enjoyable because the stakes were higher.
Wouldn’t want to play a Mario World rom hack without them though
A good HDMI scaler is hundreds of dollars, plus you need RGB-modded consoles to get good output.
There are better scalers and mods for possibly cleaner audio and video for nearly all consoles, but with few exceptions an OSSC or RetroTink will get you 99% of the way there. The last 1% is chasing audiophile levels of quality improvement for audiophile levels of money, imho.
RetroRGB and My Life in Gaming are fantastic resources for nearly all retro gamers of any budget. You don’t have to spend a lot to get old hardware looking really great and low latency on modern displays.
Where the FPGA comes in handy is in concurrent logic and a fixed clock. This makes synchronization easy, and that is what makes software emulators much more demanding.
https://www.retrorgb.com/furrtek-maps-the-pc-engine-huc6270-...
1: https://dolphin-emu.org/blog/2022/09/13/dolphin-progress-report-july-and-august-2022/#50-16901-flush-command-buffers-after-multiple-efb-copies-by-tellowkrinkle
(the linked example also highlights how variations in hardware memory architecture present real hard challenges for software emulation, which would be simple to overcome in an FPGA)As willis936 points out, decapping can let us see the exact logic a chip uses, but only a minority of chips are decapped. It's extremely expensive and analysis is time-consuming. Most stuff is reverse-engineered. That doesn't mean it's all HLE, we can infer a lot of behavior, and the composite timing is known, so it's close enough to use, but not to archive the design for future generations.
While it's not intrinsic to software emulation, modern PC and mobile operating systems tend to be somewhat bad about input lag by default. This can be overcome, but it's work, and vendors seem to invent an exciting new way to fuck it up every few years.
Similarly, a lot of old-school hardware ran at oddball frame rates that modern systems won't do without a bit of coercion (e.g. NTSC SNES runs at around 60.09 Hz in most modes), so you're usually forced to choose between running the system at a slightly inaccurate speed or allowing periodic stuttering. That being said, modern displays don't necessarily support the original refresh rates either, so FPGA-based systems have needed to make the same compromises, just less often than software emulators.
Monitors generally don't hit 60Hz exactly anyway. A lot of cheap monitors have really inaccurate default refresh rates, like 59.93Hz instead of 60. Some may use 59.94Hz to match NTSC's rate.
It doesn't matter how fast your emulator is, throughput-wise. Your operating system (and other stuff) sits between it and output and input devices. And usually adds multiple frames worth of latency. There's ways to improve this, certainly, but you won't get that experience "out of the box."
Now, it's also possible to accomplish this by running emulators "bare metal" or "close to the metal" like my friend Randy did with his BMC64 project: https://github.com/randyrossi/bmc64
As long as the correct output signals are generated before the clock edge, there is little meaningful difference between software or hardware implementations.
A cycle-accurate software emulator can actually replace a hardware CPU. Consider this example of a cycle-accurate software emulator running on a 600 MHz Teensy/ARM microcontroller board plugged into the CPU socket of an Apple II:
https://microcorelabs.wordpress.com/2021/01/08/mcl65-worlds-...
The 8088 version (an impressive achievement, though he had to overclock the microcontroller to 800MHz) apparently also worked as a drop-in replacement for MiSTer's FPGA implementation - he suggests that graphical bugs in the area 5150 demo were not due to the CPU but due to timing issues with MiSTer's PC XT peripheral implementations.
https://microcorelabs.wordpress.com/2022/08/12/area5150-runn...
Total time, from input to physical display on the screen is not under the user space programmer's control if you're running an emulator on a Linux or Mac or Windows system.
You can be cycle accurate all you want. That doesn't get you past the windowing system, GPU, display controller, HDMI interface, etc. any faster. All of that sits between you and pixels.
It is possible, on an FPGA (or under any hardware you control directly, really) to go straight from framebuffer to HDMI (or etc) signals without pauses inbetween. In some ways it's easiest on FPGA.
Your example is running on custom hardware. That is entirely feasible, yes. But isn't what was being asked about. That's similar to the BMC64 example I gave.
Note that Linux (which I'm familiar with) makes it fairly easy to bypass much of the OS for real-time applications, but you can get most of the benefit by simply running a single process (i.e. just run the kernel and a single emulator process.)
My point is similar to yours actually: that as long as you calculate the output signals on time (e.g. before the clock edge) there is not a meaningful difference between hardware and software implementations.
[1] http://www.radanpro.com/Radan2400/mikrokontroleri/rtvideo5.h...
Presumably native graphics and games already need to sync with fixed rate displays to avoid tearing (or buffer and pay a latency price.) The fact that tearing exists would seem to indicate that you can update a frame while it is being scanned out.
I imagine that racing the beam (or video signal scanout in the case of non-CRTs) might actually work, especially with VGA where you could set to an appropriate resolution.
> Let's take a well-known emulator, UAE, emulating an Amiga. On a Raspberry Pi 3, you can run some Amiga CPU benchmarks and get crazy numbers like 100 times the original 68000 processor. So you may assume you have an emulated Amiga that is 100 times faster than real one. No, you don't. If you run different kinds of demos or games, you will see the video stutters sometimes. For example, if you play the well-known "State of The Art" demo by Spaceballs, you will notice video stuttering at some points, while a real Amiga 600 with 1x CPU speed plays the whole demo very smoothly.
https://mister-devel.github.io/MkDocs_MiSTer/basics/faq/#why...
Mister FPGA: The Future of Game and Computer Emulation - https://news.ycombinator.com/item?id=29439279 - Dec 2021 (64 comments)
MiSTer FPGA GBA Splitscreen Multiplayer - https://news.ycombinator.com/item?id=27547848 - June 2021 (9 comments)
But Terasic have the FPGA board listed for pre-order with estimated shipping at the end of this month. I haven't had opportunity to get one before either, so I'm not sure how the availability for expansion cards has been.
1: https://www.youtube.com/watch?v=qxgM9NPrhqwTerasic has been getting stock pretty regularly though and their pre-order dates don't seem to be too far off reality.