Closed rynorris closed 5 years ago
By basing the implementation on Serde we should be able to switch out serialization formats at will.
Implementation plan:
cpu.state
, apu.state
, etc)Serializable
, Deserializable
traits. Since these will be simple objects, we should be able to derive these traits automatically.Possibly don't even need to store PPU state for a v0. We don't reset it on reset for example and it always recovers itself. The downside being that if you load a save state with the emulator paused, it's not going to render anything until you unpause.
Changing my mind on the implementation plan. I think I would prefer to keep the serializable state objects totally separate in a separate package, and then just have methods to convert each thing into serializable form. This will make the save state API easier to track and thus easier to avoid breaking changes to the format.
Stuff to store
Format
Thinking about going with JSON, with base64 encoded blobs for the memory dumps. Or perhaps a binary format like msgpack?