How To Write An Emulator