Attempting to write NES emulator