I wonder if bare metal emulators can achieve similar latency for software emulation.
I wonder if bare metal emulators can achieve similar latency for software emulation.
If you make a keyboard that can send signals fast-clocked over wire to PCI interface card and use polling in the driver you can go as fast as you want. A microsecond poll is not a burden for the CPU core.
It’s usually all about the latencies involved in getting graphics onto the screen after responding to the input.
Even an FPGA-based ‘emulator’ or real retro hardware with the fanciest low-latency upscaler won’t feel truly responsive if connected to an LCD TV that adds 60-100ms of latency (yes, some are really that bad, especially if not in ‘game mode’)
We didn't design modern stacks to handle lowest latencies possible. Because everything is a tradeoff.
Take a look at audio I/O on normal PC in 2000s. Although input digitizing and output de-digitizing were always fast enough, the "DSP" (moving data to userspace, processing, and out) was slow. Because in software design it was given that millisecond latencies aren't a thing, we used a lot of locks and copying around to ensure the system works correctly for average use which isn't realtime IO. However when someone desired realtime IO they enhanced the drivers and/or the audio software stack.
That approach worked because there were no issues in electronics, so to speak. With gaming you have slow USB input and slow HDMI/whatever output.
In my view that is peripheral issue and not architecture issue, although you can also say it is a platform issue. The question is not that straightforward.
Now if they just would have made multiprocessor C64s so that one could have been dedicated to that tight loop ...
But (as mentioned in reply above) good Ethernet cards have way less inherent I/O latency than USB input device<->HDMI screen chain.
So, I see the solution in a PCIx graphics card that can generate VGA signal and take PS/2 input via poll mode drivers. If you connect "real" peripherals to it you can go low-latency, if you connect HDMI/USB stuff via adapters you'll have arbitrary latency.
a Pi etc has a huge advantage in raw clock speed. FPGAs are pretty slow. at least the ones that you and i can afford
I wouldn't expect the experience to be identical nor quite as accurate [1], but if audio and input latency could be made indistinguishable between a Raspberry Pi and a Mister FPGA that would already be quite a significant feat :)
[1] FPGA emulation is not intrinsically more accurate, but most Mister cores are considered to be more accurate than popular Retropie cores.
Same with USB input stack, though I guess MiST/Mister has that too.
Same with SID emulation, which would render into audio buffer samples of certain size (and therefore latency), whereas a hardware or FPGA SID could drive the DAC directly.
The key latencies you describe (frame buffer, audio) aren’t really an issue in the DSP scenario. Also, non linear components like the SID are going to be harder to reimplement in discrete circuits and in fact I’d expect DSP would do better.
DSP wins every time in all domains. Problem is you need to have a much more fine-grained knowledge of the physical underpinnings of the system, not just the system itself.
Why do you need more?
When you get into higher spec machines, esp from the 90s, FPGA starts to not be the best choice $$ per clock.