Save States - Proof of concept

Here you can discuss the development of patches.

Re: Save States - Proof of concept

Postby robertmo » 2012-6-20 @ 10:04

i think this may be sth for you
viewtopic.php?p=269783#269783
User avatar
robertmo
l33t
 
Posts: 4096
Joined: 2003-6-18 @ 10:35

Re: Save States - Proof of concept

Postby tikalat » 2012-6-21 @ 00:04

He's using an older (incompatible) save state build (beta9 is a long time ago, buggy enough). The save states themselves could be corrupting his game.

Then again, I may check it out sometime anyway to confirm.
tikalat
Member
 
Posts: 287
Joined: 2012-4-13 @ 16:39

Re: Save States - Proof of concept

Postby tikalat » 2012-6-21 @ 17:22

Code: Select all
svn-dosbox r3782

005
- Updated to r3782 (M.U.L.E., Settlers 2)
- Added DOS POD (basic stuff)


Fixes some problems with loadstate games off cdrom (Magic Carpet Plus).
- The svn-daum protected mode loadstate breaks. So that needs to be looked into. ^^

tester
You do not have the required permissions to view the files attached to this post.
tikalat
Member
 
Posts: 287
Joined: 2012-4-13 @ 16:39

Re: Save States - Proof of concept

Postby tikalat » 2012-6-22 @ 00:23

Dropping a note: found the svn-daum problem. Svn-dosbox somehow resets the pagehandlers to 'initial'. Svn-daum needs to do this on loadstate (temporary fix).

Going to make a Paging POD out of this later to be safe (needs more studying). And try to patch up some CMOS loadstate bugs with Magic Carpet Plus SVGA chooser.
tikalat
Member
 
Posts: 287
Joined: 2012-4-13 @ 16:39

Re: Save States - Proof of concept

Postby tikalat » 2012-6-23 @ 23:47

Code: Select all
011  svn-daum

Add DOS POD
- some extra basic stuff
- some restucturing

Redo paging into cpu POD
- done more correctly (vars)
- more usable (ex. Magic Carpet Plus)

Some midi_win32 changes
- midiOutReset on loadstate
- midiOutReset + midiOutClose (flush then close)
- Roland VSC crash protection

MUNT
- speed up savestates / loadstates (looks at partials used)

Accidental crash
- Safety check debugging sblaster code


The Roland VSC is the experimental flag (default off in code). Problem is that Dosbox doesn't always close the port correctly - buffer used, playing, sysex still around, other voodoo, misc whatever. Or app crashes and we lose the MIDI device until reboot (single-instance port hogger).
(midiOut not closed. So it gets orphaned in windows memory)

15 reboots in 2 days because VSC locks out. That will not do!

New approach creates a dll that manages midi creation for VSC only. On crash, windows keeps it around until it unloads. Force dll unload and port is closed. Seems stable enough for now - may be error'able still. Better than before.
(see: misc/midi_helper project)


tester
You do not have the required permissions to view the files attached to this post.
tikalat
Member
 
Posts: 287
Joined: 2012-4-13 @ 16:39

Re: Save States - Proof of concept

Postby nikiniki » 2012-7-08 @ 21:54

Dosbox crashes when saving states when playing Colemdos, a ColecoVision emulator for dos.
User avatar
nikiniki
Member
 
Posts: 179
Joined: 2010-1-20 @ 01:09

Re: Save States - Proof of concept

Postby tikalat » 2012-7-09 @ 01:48

Code: Select all
001 - svn-daum

pcjr / tandy - fix 'no dac' crash
midi - improve midi_helper (VSC only), reset GM / GS at startup, restore RPN correctly, cleanup
misc - compile fixes
pause - new idea that lets user save,load,change options while emu paused


TODO:
Check Barbarian
Check Colemdos
Check Pinball game (2x shift flippers)

test


edit:
Thanks for fixing the debugger!

Colemdos = no crashes
Barbarian = no crashes
You do not have the required permissions to view the files attached to this post.
tikalat
Member
 
Posts: 287
Joined: 2012-4-13 @ 16:39

Re: Save States - Proof of concept

Postby nikiniki » 2012-7-09 @ 15:22

PDCURSES.DLL not found.
User avatar
nikiniki
Member
 
Posts: 179
Joined: 2010-1-20 @ 01:09

Re: Save States - Proof of concept

Postby tikalat » 2012-7-09 @ 20:20

tikalat
Member
 
Posts: 287
Joined: 2012-4-13 @ 16:39

Re: Save States - Proof of concept

Postby nikiniki » 2012-7-09 @ 22:54

I leave dosbox and run it with colemdos again.

I get "No saved file for the slot. Aborted" when loading the state from the menu but it works fine when pressing Alt+F9 in game.
User avatar
nikiniki
Member
 
Posts: 179
Joined: 2010-1-20 @ 01:09

Re: Save States - Proof of concept

Postby tikalat » 2012-7-09 @ 23:53

uhm... >.< ..!? Using any frontends?


Colemdos okay here (using menubar).

Went from CMOS -> colemdos (loadstate) -> Win 3.1 PQ4 (loadstate) -> colemdos (loadstate) in 1 session. :|


Please try this build (debug info when loadstate fail):
http://www.sendspace.com/file/pw0r1o
tikalat
Member
 
Posts: 287
Joined: 2012-4-13 @ 16:39

Re: Save States - Proof of concept

Postby nikiniki » 2012-7-10 @ 00:04

Your last version of dosbox runs fine.

I don't use frontends but I use .bat files to run dosbox like this:

go.bat
c:\dosboxsave2\dosbox C:\coleco -conf dosbox-0.74.conf

I run dos games this way.
User avatar
nikiniki
Member
 
Posts: 179
Joined: 2010-1-20 @ 01:09

Re: Save States - Proof of concept

Postby tikalat » 2012-7-10 @ 00:13

Hmm. Okay. Shouldn't be problem most of the time. Sometimes windows gets confused and looks for files in wrong directories though (not often).


Dev note:
If bug happens enough, get dosbox program absolute path and work file paths from there.

Note that I changed 2 lines after last 001 patch:
Code: Select all
if(check_title.fail()) throw Error("No saved file for this slot. Aborted.") + "   File: " + program_temp.c_str();
if(check_file.fail()) throw Error("No saved file for this slot. Aborted.") + "  File:" + realtemp;
tikalat
Member
 
Posts: 287
Joined: 2012-4-13 @ 16:39

Re: Save States - Proof of concept

Postby red46 » 2012-7-17 @ 09:19

Tried with the latest patch, gta crashes when saving state, this happens only when using the 3dfx version of the game as the 8 bit and 24 bit one, will save and load fine.
Using nglide as wrapper, didn't see this mentioned anywhere else, so perhaps might be something to look into.
red46
Newbie
 
Posts: 1
Joined: 2010-12-29 @ 20:33
Location: IT

Re: Save States - Proof of concept

Postby tikalat » 2012-7-17 @ 12:54

No 3dfx save support - should be buggy. Not sure if doable.
tikalat
Member
 
Posts: 287
Joined: 2012-4-13 @ 16:39

Re: Save States - Proof of concept

Postby isamu » 2012-8-09 @ 07:32

Just wanna say thanks again for all the hard work :)
isamu
Newbie
 
Posts: 9
Joined: 2010-7-21 @ 06:54

Re: Save States - Proof of concept

Postby tikalat » 2012-9-26 @ 14:09

Patching up 2 long-time bugs.

dos_files.cpp
- save stdin, stdout, stderr refcnts

cpu.cpp
- hlt loadstate crash


#1 = some random dos crashes, glitches
#2 = random program loadstate deaths (ex. playmid)


3dfx = not likely yet. Many variables to learn. Retrieving texture uploads would be more questionable.
You do not have the required permissions to view the files attached to this post.
tikalat
Member
 
Posts: 287
Joined: 2012-4-13 @ 16:39

Re: Save States - Proof of concept

Postby Arlo » 2013-3-12 @ 03:00

Has anyone released a fixed version of this code compilable on 64-bit Ubuntu? I'm having a similar problem as Serious Callers Only had on pages 3 and 4 of this thread. but I'm afraid I don't have the expertise to follow all the changes he was instructed to make in order to get this working.
Arlo
Newbie
 
Posts: 23
Joined: 2011-9-20 @ 12:10
Location: New York

Re: Save States - Proof of concept

Postby copytco » 2013-4-10 @ 09:24

I've got a question about how the save states work. When I save a state during game I can load it any time I want, but when I close a game and fire up DOSBox once again save state is empty, so nothing loads - this happens everytime I close & open DOSBox. Should it be like that? :)
copytco
Newbie
 
Posts: 3
Joined: 2013-4-10 @ 09:20

Re: Save States - Proof of concept

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

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.



[quote]
I've got a question about how the save states work. When I save a state during game I can load it any time I want, but when I close a game and fire up DOSBox once again save state is empty, so nothing loads - this happens everytime I close & open DOSBox. Should it be like that? :)
[/quote]

That shouldn't happen. ^^
You do not have the required permissions to view the files attached to this post.
tikalat
Member
 
Posts: 287
Joined: 2012-4-13 @ 16:39

PreviousNext

Return to DOSBox Patches

Who is online

Users browsing this forum: No registered users and 1 guest