Visual 6502 in JavaScript
visual6502.org
visual6502.org
https://floooh.github.io/visual6502remix/
Check Help -> About for a list of dependencies used in that project (lots of good stuff in there), the two most important being the original data sets from visual6502, and a C re-implementation of the transistor-level simulation, called perfect6502 https://github.com/mist64/perfect6502)
But when clicking the "play" button it's throttled to one half-cycle per 60 Hz display frame (requestanimationframe) so "usually" it should run at 30 Hz.
I haven't checked how fast the WASM version would run unthrottled compared against a natively compiled version of perfect6502, but performance should be somewhat close (much closer than to the JS version anyway).
As far as I have seen, the C rewrite in perfect6502 uses a handful compact arrays for the simulation state, unlike the Javascript version which seems to be more like a huge graph of linked nodes, where each node is a JS object, so the C version should be a lot more cache-friendly.
The reason is, German keyboards use the QWERTZ layout and as you can tell from the name, the 'z' key is in the upper row, right in the middle.
Maybe use 'w' and 's' instead? That's the default in first-person-type games. Actually, never mind, that doesn't work for the French who have AZERTY...
However, I was really, really hoping that we'd have a version for the Z80 by now.
http://www.visual6502.org/JSSim/expert-z80.html
But AFAIK nobody really knows yet whether it works in all situations, because not all of the "trap transistors" had been found yet which the Zilog designers put in to make reverse engineering harder.
...maybe it would have been better to decap one of the "unlicensed clones" of the Z80, like the East German U880, because that definitely had the trap transistors fixed ;) The U880 had some minor differences in the undocumented behaviour too though.
http://www.visual6502.org/JSSim/expert.html
a nice throwback for sure!
It looks like that subroutine they call at $0010 has a special hook that writes to the console whenever they write to memory address $0f.
Couldn’t live without it <3
For comparison, the C reimplementation of the transistor level simulation, running unthrottled and without visualization (I think that's the main performance killer) is about 150x slower on a modern CPU (according to the readme here: https://github.com/mist64/perfect6502)
Maybe this linear algorithm can be converted to some sort of parallel "cellular automata", which would then probably be a much better fit for GPUs than CPUs.