Cycle-accurate 6502 emulator in Javascript