Serialize the emulator state.
Serialize the emulator state.