Hi everyone! After reading Racing the Beam a few months ago, the VCS started to captivate me and I got more and more interested in its hardware and its emulation, which eventually led me here.
The fact that the VCS games run so close to the metal essentially means that the emulator has to be cycle accurate, what some would call low level emulation. Yet despite its cycle accuracy, even the most accurate emulators such as Stella simulate the expected results and not the actual physical/electrical behavior of the circuits, like a SPICE engine or the DICE emulator do for old TTL arcade games.
This means the emulator has to be programmed to mimic all corner cases and catch up as they are found. It couldn’t expose a hardware bug by itself, or help discover a hardware trick like the HMOVE strobe (I suppose). It can only be programmed to mimic these artifacts once discovered on the real thing.
While emulating at transistor level is completely out of question for more complex hardware such as the NES - yet it has been attempted and there are working prototypes - I suspect this could be done in real time for the VCS.
The 6502/7 is only made of 3500 transistors, the TIA has 6193, the RIOT probably in between. That’s a likely total somewhere south of 15000 transistors, intimidating but for comparison, the NES PPU alone has more than 16K transistors, disregarding all its other chips. Plus the schematics are available and documented for each of the VCS chips so there's little to no reverse engineering required.
If horsepower would really happen to be an issue, then maybe :
- we could discard the real time approach and only emulate at the hardware level as a slow-motion debugging mode
- a hybrid approach with a traditional high level 6507 emulation and low level TIA emulation could be used (maybe as an optional engine in Stella)
- the emulation could happen a bit higher, at the logic gates level, so there's less circuit to model
Granted, a circuit level emulation wouldn’t be useful for perfect accuracy for a 3rd gen console like the NES since the hardware is much more abstracted and you get a framebuffer, so even the cycle accuracy isn’t vital.
But for a VCS, I suspect it could help finding, debugging and testing new hardware tricks right on his laptop without the need for a Harmony cart on the real thing, something even a real VCS couldn’t do unless there were logic probes on the chips and the ability to set breakpoints.
What do the pros here think? Could this be a worthy? I’m not a developer and wouldn’t be able to help much on the code if it happened, but I wanted to discuss this in case it could be an idea.
Further reading, including some transistor level 6502 and NES PPU emulation: