Save States - Proof of concept

Here you can discuss the development of patches.

Re: Save States - Proof of concept

Postby ykhwong » 2013-7-19 @ 05:36

tikalat wrote:http://www.vogons.org/viewtopic.php?p=296379#p296379
Patch to integrate MUNT library into svn-daum (May 2013)

1) Download MUNT 1.2 source. Apply munt-master-savestate.diff
- Add partial limits
- Add mt32ram dump / load

1a) Compile as static library
- mt32emu_stat.lib

2) Download ykhwong's May 2013 build. Apply daum-savestate.diff
- Removes MUNT files. Treat as external lib
- Copy new MUNT header files
- Run MUNT through MIDI savestate code
- Rework MIDI save / load
--- new features: NRPN
--- bug fixes: controller 79h (RPN), correct MIDI / sysex status, other noticeable problems

2a) Add mt32emu_stat.lib to linker
2b) Compile and run


Not fully tested. Works rather well so far.
That shouldn't happen. ^^


Wow, thanks. :) I will try it.
ykhwong
Oldbie
 
Posts: 627
Joined: 2004-3-17 @ 15:35

Re: Save States - Proof of concept

Postby ykhwong » 2013-7-23 @ 18:39

I noticed that recently MT32EMU_DEFAULT_MAX_PARTIALS is implemented while MT32EMU_MAX_PARTIALS and MT32EMU_MAX_POLY are deprecated. Also two more parameters are added to Synth::open(). I had to modify code a bit to successfully compile dosbox with static libmt32emu.

However, munt is working very unstable. Crashes occur too often while mididevice=mt32 is set regardless of saving/loading state feature. I had to add "midi_state[0].init = false; MIDI_State_LoadMessage();" to godefault: in "class MIDI:public Module_base" in order to reduce the frequency of crashes, but that's not the best solution.
ykhwong
Oldbie
 
Posts: 627
Joined: 2004-3-17 @ 15:35

Re: Save States - Proof of concept

Postby tikalat » 2013-7-26 @ 13:08

Hmm. ^^ Take a deeper look when I get a chance.
tikalat
Member
 
Posts: 287
Joined: 2012-4-13 @ 16:39

Re: Save States - Proof of concept

Postby tikalat » 2013-8-12 @ 01:06

Updated my svn-daum from 2012 --> 2013-07.

MT-32 crashes a lot. So.
- Compile latest MUNT svn from github (August 2013)
- Copy mt32emu_stat.lib to svn-daum lib area

- *** IMPORTANT *** Copy all munt/mt32emu/src/*.h files to svn-daum/src/gui/*.h
Had lots of crashes, instability until this happened

- Then copy these fixed up synth.h, mt32emu.h files to svn-daum (partial limit, ram loadstate)
http://s000.tinyupload.com/index.php?fi ... 8108954315


Not having problems. No other changes made.



Rest of uncommitted changes from last patch were for Roland GS savestates. Loading different tracks from Duke Nukem 3D, Star Trek would sometimes throw out weird noises because NRPN, Sysex modes and misc values weren't being reset.

Could redo that patch if it's important.
tikalat
Member
 
Posts: 287
Joined: 2012-4-13 @ 16:39

Re: Save States - Proof of concept

Postby ravine » 2013-8-23 @ 17:11

Hello,

is it possible (or will it be) to load saved state from the command line? I'm trying to build a demo-machine w/o keyboard.

thx
ravine
Newbie
 
Posts: 0
Joined: 2013-8-23 @ 17:08

Re: Save States - Proof of concept

Postby ravine » 2013-10-12 @ 23:49

Hi,

i just tried the DAUM version on TinyCore linux, and save/load states not working. It can save, but when i want to load it, the error is:
"Aborted. Check your memory size."
I've tried on an other machine, same thing.
Then i found out, that this check was added at 2012 november. Tried an earlier version, and that worked. Is it a bug? Cannot find any info about this.

thx
ravine
Newbie
 
Posts: 0
Joined: 2013-8-23 @ 17:08

Re: Save States - Proof of concept

Postby ravine » 2013-11-25 @ 16:31

Wow! Just noticed the newer release of DAUM build. Tried it, saved a state, and the load works! Still got a warning (WARNING: check your memory size), but the state loaded!
BIG thanks to the bugfixer! :)
R.
ravine
Newbie
 
Posts: 0
Joined: 2013-8-23 @ 17:08

Re: Save States - Proof of concept

Postby pal1000 » 2014-1-01 @ 16:22

Random load state issue - Quake 1

It happens pretty random, the more you resort to Dosbox save / load state over the built-in save feature, the greater the chance is to get the page fault to occur. Once it happens there is still a good chance for the load state to be successful if you restart Quake and retry loading. I collected 2 different screenshots of the issue occurring. There is also a chance for Dosbox to freeze completely but is extremely rare. I estimated that you usually need around 15 attempts to get it to happen. Setting CPU core to normal suppresses the problem from occurring,
I run the game from Quake.bat. This is the directory tree on my system:
C:\Users\Guest\Software\dos\apps\
Quake
nc
Mario
\emu\
I use the ykhwong build from Nov. 17. 2013 variant without installer. I attached a copy of the game including a few save states and the 2 screenshots. WARNING: I am playing the game at hard level.

Screenshots;
Image

Image

Download Quake with save states and internal saves included: don't share copyrighted materials

The configuration file hasn't been altered except for autoexec section. Game specific configuration is incorporated in the game batch launcher.

Autoexec:
mount c ..\apps
mount s .\save
c:
cd nc
nc
exit

Game launcher batch source:
move *.sav s:\
config -set "cpu core=normal"
config -set "cpu cycles=auto"
quake.exe
config -set "cpu core=auto"
config -set "cpu cycles=auto"
move s:\*.sav .

-move commands swap save states between games;
-cpu core set to normal suppresses the problem from occurring but causes major slowdown.
pal1000
Newbie
 
Posts: 1
Joined: 2014-1-01 @ 15:44

Re: Save States - Proof of concept

Postby Rekrul » 2014-2-14 @ 10:34

I've been playing around with the latest Daum SVN version. Save states work for me, but sometimes it refuses to load a save state if I've closed DOSBox and run it again.

For example, I set it up to play Alien Trilogy. I ripped the audio tracks to Ogg and the data track to bin, and then mounted it in the DOSBox conf file. The game works perfectly.

When I use the save states, they work up until I quite DOSBox. The files are saved, I can see them in the Save directory, but when I run DOSBox again and press Alt-F9, nothing happens. No error message, no indication that it has done anything. Same result if I use the menu in windowed mode. The menu shows that slot as being used, it just won't load it.

I can save and load as much as I want while the game is running, but it won't load states between sessions.

It's better than nothing as you can save between levels, but I'm still puzzled over what changes between sessions that causes it to not load the state. Doesn't loading a save state override everything in DOSBox's memory and registers? If so, why should loading within the same session be any different than loading during a different session?
Rekrul
Member
 
Posts: 294
Joined: 2005-2-10 @ 23:14

Re: Save States - Proof of concept

Postby Jorpho » 2014-2-14 @ 16:30

Rekrul wrote:Doesn't loading a save state override everything in DOSBox's memory and registers?
Evidently not. ;)

If I had to take a wild guess, I would suggest using a straight bin/cue image rather than using ogg and a bin. Or perhaps it makes a difference if you restart the game and start playing a level before trying to reload the save state?
User avatar
Jorpho
l33t++
 
Posts: 6924
Joined: 2003-2-14 @ 19:50
Location: Canada

Re: Save States - Proof of concept

Postby Rekrul » 2014-2-15 @ 00:23

Jorpho wrote:If I had to take a wild guess, I would suggest using a straight bin/cue image rather than using ogg and a bin. Or perhaps it makes a difference if you restart the game and start playing a level before trying to reload the save state?


No difference with a full disc image or the actual disc.

After much testing, I've come to the conclusion that it works when it feels like it. Yesterday I couldn't get it to work at all and today I can't get it to fail with any regularity! I may have found one piece of the puzzle though...

Alien Trilogy is hard-coded so that moving the mouse forward & back makes you move in the game. This makes the game feel like you're wearing ice skates and I end up sliding all over the place. To stop this I use a small DOS program called NoVert.com which suppresses vertical mouse movement.

When it fails to load the save state, the console window says "Aborted. Check your program name: TRILOGY". So it seems like the fact that I'm loading NoVert.com before Trilogy.exe, sometimes causes it to become confused, even though both programs are being loaded every time.

I've also noticed that if I load the game with NoVert active, save it, then re-run the game without first running NoVert, when I load the state, NoVert is apparently included in the save because vertical mouse movements are still suppressed.
Rekrul
Member
 
Posts: 294
Joined: 2005-2-10 @ 23:14

Re: Save States - Proof of concept

Postby retro1975 » 2014-7-17 @ 08:33

Awesome and i've never seen like it before...... thanks man!!!!
User avatar
retro1975
Newbie
 
Posts: 1
Joined: 2014-7-17 @ 08:28

Re: Save States - Proof of concept

Postby isamu » 2014-8-07 @ 00:28

Keep up the excellent work, gentlemen :)
isamu
Newbie
 
Posts: 9
Joined: 2010-7-21 @ 06:54

Re: Save States - Proof of concept

Postby bulbulz » 2014-10-30 @ 21:38

Works with Double Dragon. Thank you so much!
bulbulz
Newbie
 
Posts: 1
Joined: 2014-10-30 @ 21:31

Re: Save States - Proof of concept

Postby Floppy » 2014-11-02 @ 08:54

Hello, i downloaded the two file that was attached in the first page, but i don't know how i could use it.
Could someone throw some light.
User avatar
Floppy
Newbie
 
Posts: 25
Joined: 2010-6-11 @ 13:24

Re: Save States - Proof of concept

Postby Jorpho » 2014-11-03 @ 14:33

The files in the OP are probably somewhat out of date. You should get the SVN Daum build, which also integrates the support for save states.
User avatar
Jorpho
l33t++
 
Posts: 6924
Joined: 2003-2-14 @ 19:50
Location: Canada

Re: Save States - Proof of concept

Postby Floppy » 2014-11-04 @ 12:12

Jorpho wrote:The files in the OP are probably somewhat out of date. You should get the SVN Daum build, which also integrates the support for save states.

Where do i get that SVN Daum build, and how do i use it?
ANy help would be great. I am trying to make a video of some dos games.
User avatar
Floppy
Newbie
 
Posts: 25
Joined: 2010-6-11 @ 13:24

Re: Save States - Proof of concept

Postby emendelson » 2014-11-04 @ 13:35

Where do i get that SVN Daum build, and how do i use it?


Have you tried a Google search for

dosbox svn daum

?
emendelson
Oldbie
 
Posts: 627
Joined: 2010-2-14 @ 02:00

Re: Save States - Proof of concept

Postby Floppy » 2014-11-04 @ 14:08

emendelson wrote:
Where do i get that SVN Daum build, and how do i use it?

Have you tried a Google search for
dosbox svn daum
?

Yeah i tried and found a site, i downloaded and what do you know, it can save a game file and make a avi videos. Just what i needed from my need.
DOSBOX should incorporate these feature into GUI interface, for more ease , instead of traditional .conf files.
Thank you for sheding some light, you guys rock.
User avatar
Floppy
Newbie
 
Posts: 25
Joined: 2010-6-11 @ 13:24

Re: Save States - Proof of concept

Postby andwan0 » 2015-11-11 @ 11:29

Just found this post and realised it was posted in 2010. Now it's almost 6 years, just wondering what's the current state of things. Will DOSBox officially get save-states implemented?

Will this patch work with the latest SVN 0.74? Also, will it work in multiplayer IPX tunnelled games? That would be awesome idea. IPX-tunnel save state. If all players saved state at the same time.

Then next day (after PC reboot), both players at same time load saved state (maybe after success IPX reconnection ?

Will this work?
andwan0
Newbie
 
Posts: 22
Joined: 2009-4-17 @ 20:07

PreviousNext

Return to DOSBox Patches

Who is online

Users browsing this forum: No registered users and 1 guest