sync emulatr.c changes