VOGONS


Suspend/Restore patch

Topic actions

First post, by miargep

User metadata
Rank Newbie
Rank
Newbie

Hi everyone,
I have written a patch against dosbox-cvs dated from 2004/03/31. I probably won't fiddle with it any longer, but if you want to play with this here is the patch attached. I do not have a clue if it compiles with windows.
I don't know if it will patch the current cvs version. Since it modifies several files, the chances are high that you will have to modify something to have it working.
Basically, all the patch does is to save every global variable from the most important files to one file. These files concern cpu (except dynamicX86), paging, iohandling, memory and pic. I also had to mess with several other files (mainly to be able to resolve/reload handlers).
Since the patch does not save vga/audio/whatever state, restoring only works if the dos program is in the same mode when you suspended dosbox. To suspend dosbox, press + on the keypad. This creates a file "/tmp/dosbox.suspend". There is not (yet) a way to suspend to a different file. To restore, press the / (divide) on the keypad.
The patch allowed me to save/reload game states for dos games that don't allow saving themselves. It is not stable. Saving always produces a dosbox.state file, but restoring freezes dosbox once in a while (maybe every 10th attempt). probably this is due to a inconsistency in the state of dosbox-hardware/game-software, which the patch does not save.
have fun with it,
miargep

Reply 1 of 3, by icemann

User metadata
Rank Member
Rank
Member

So save states ARE possible with dos 😀. Nice work there miargep.

Two stones, two crosses, the rest is just icing. - 7th Guest

Reply 2 of 3, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

It's an emulator for crying out load. It is software for G. sake. Everything is *possible* It is just a matter of decide *who* should make it possible.

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 3 of 3, by *orz*

User metadata
Rank Newbie
Rank
Newbie

edit: this was accidentally posted to the wrong thead