Simplified the mainloop of the emulator to gain a few more FPS.