add emulator.c & modify files.