News for hackers. Stuff that matters.
Re:Nes emulator written in go by atesti on Monday March 23, 2015 @02:47AM (#9249745)
Here's a very clean and clever NES emulator in C++ by Bisqwit of TAS fame: https://www.youtube.com/watch?v=y71lli8MS8s

He presents the code in the style of a tool assisted run, typing it in in high speed. I never saw templates used like that to create the unrolled CPU dispatcher

Re:Nes emulator written in go by kibwen on Monday March 23, 2015 @03:51AM (#9249867)
The code for the CPU dispatcher begins at 1:26 in the linked video, for those not willing to watch the whole thing.

A comment elsewhere in the thread mentions Sprocketnes, written in Rust, which takes a different tack here: it uses a hygienic macro to implement opcode dispatching, which allows the giant block of dispatching logic to be reused for both the emulator and the disassembler: https://github.com/pcwalton/sprocketnes/blob/master/cpu.rs#L...