#NVIDIA CUDA EMULATOR CODE#
My PTX ISA code is certainly not correct, but it's just to count the LD/ST and ALU instructions, in order to do the math: only the GTX 680 would be powerfull enough to sustain the number of LD/ST instructions plus the necessary memory bandwidth. Video would be pure 60 fps (good for the PC), all 65 cycles would be the exact same duration (not a longer 65th cycle anymore), but the whole retraces timings and cycles would be still perfect, so it should not disturb any program that is doing any sync with the video: well programmed games should have no flickering, no jittering (just there are globally -0.1% slower).Ħ5 cycles x 262 scan lines x 14 Hz = 14 305 200 Hzĭivided by 14 = 1 021 800 Hz for the 6502 (1.022 MHz)Īnyway the original crystal wasn't that precise, it could run faster if very hot, or slower if cold. I would simplify the global frequency to 14 305 200 Hz, so that the video would be a perfect 60 Hz, instead of the standard 14 318 180 (4x NTSC frequency): that's a global -0,1% speed decrease only, but it simplifies many things. The GPU would do all the 6502 simulation, the CPU would emulate the rest (I/O, memory, display) at 1 MHz. That would be run at 14 MHz, and the simulation run 14 times (1 MHz cycle for the CPU) before sending the table to CPU. Have a 8 bits table for previous values (1 bit only used in the each byte)Īnd have an other 8 bits table for the results Have a 2x 16 bits pointers table for circuits connections (but on spare time only: it will probably take me a year) I'll try to program that, at least do a proof of concept. (I compared my actual GTX 570, and the new mid-range GTX 660 Ti, along with the top-of-the-line GTX 680) It shall be possible to emulate the 6502 (at circuit level 14 MHz signaling), in realtime, using the last GeForce GTX 680 graphic card. I've just made the math quickly, and on paper, it fits!