Learning to make a NES emulator in JavaScript