Add cpu emulation loop