OpenRakis / Spice86

Reverse engineer and rewrite real mode DOS programs!
Apache License 2.0
217 stars 18 forks source link

Support for savestates #16

Open maximilien-noal opened 2 years ago

maximilien-noal commented 2 years ago

Savestates would be very helpful to easily and reliably reproduce and investigate / debug a program. Memory, CPU state, and devices states would need to have save / restore capabilities for this to work.

Original issue: https://github.com/kevinferrare/spice86/issues/9

maximilien-noal commented 1 year ago

https://github.com/RobertPeip/FPGBASharp (GBA has nothing to do with DOS/X86, but this C# emulator implements save states)

articles:

https://www.gregorygaines.com/blog/adding-save-states-to-an-emulator/

There's a patch floating around on VOGONS that implements save states for DOSBox, but it's incomplete, experimental, and Spice86 is very different.

maximilien-noal commented 1 year ago

DOSBox Pure (libretro core) implements save states: https://github.com/schellingb/dosbox-pure#save-states

maximilien-noal commented 1 year ago

DOSBox-X implements it: https://github.com/joncampbell123/dosbox-x

maximilien-noal commented 1 year ago

This may be useful:

https://github.com/Cysharp/MemoryPack OR https://github.com/DouglasDwyer/PowerSerializer OR https://github.com/skbkontur/GroBuf

maximilien-noal commented 1 year ago

Savestates very well may not work with C# overrides of assembly code, since the stack isn't emulated when overriding...

A shortcut would be to disable them if any override is used.

maximilien-noal commented 1 year ago

This PC emulator has savestates, extensive ones: https://github.com/barotto/IBMulator

maximilien-noal commented 1 year ago

A Clone method source generator might be useful: https://github.com/mostmand/Cloneable