Dosbox SVN r4019 + savestates Build (Alpha)

Developer's Forum, for discussion of bugs, code, and other developmental aspects of DOSBox.

Re: Dosbox SVN r4007 + savestates Build

Postby gandhig » 2017-5-17 @ 17:23

SedrynTyros wrote:Awesome! Thank you very much. :)

EDIT:

Patch seems to work for me in the few tests I ran. This is great! I've been hoping for this for a long time.


Your post on ZenJu's "Save States - Proof of concept" thread was also one of the reasons for this journey. Though ZenJu and tikalat have done a really wonderful job, there are random crashes occasionally. Troubleshooting such issues is simply above me.

Now that the diff is uploaded, don't expect anything more from this thread on release of new SVN's :lol: , especially at the rate Qbix is releasing one after the other :lol: . Thankfully no significant changes in the core dosbox code has helped this patch to stay alive with only minor modifications. So, anyone is welcome to take the diff and apply it to future SVN's themselves. It is not that hard, only tedious, to manually copy the savestate code to 70 odd files, once you have the diff as reference. 'Code Compare' helped a lot in this case for me. However keep in mind that this may not work in case of significant changes to the code.
User avatar
gandhig
Member
 
Posts: 329
Joined: 2014-2-12 @ 08:35

Re: Dosbox SVN + savestates Build (Alpha)

Postby mjnman » 2017-6-06 @ 13:07

I'm using Linux build but some games have a vsync problem. For example with Pinball Fantasies, Aladdin and Pinball Illusion. Is there a patch for vsync?
mjnman
Newbie
 
Posts: 2
Joined: 2017-2-07 @ 10:11

Re: Dosbox SVN + savestates Build (Alpha)

Postby gandhig » 2017-6-07 @ 04:54

Do you mean to say that the vsync issue only happens after loading a savestate in the games you mentioned?

Edit: On second thoughts, the above case is rather doubtful. Somehow the combination of pinball games and savestates seems odd i.e. unless you are trying to break some world record score :lol: . Assuming that the vsync problem you are facing is more general in nature and not particular to this dosbox+savestate build, please see this thread for possible solution to your problem(though it is for windows build). Topics abound if you search for 'vsync' in this forum. Please go through them and if your issue is still not resolved, it would be better to open a new thread in the appropriate sub-forum with full details.
User avatar
gandhig
Member
 
Posts: 329
Joined: 2014-2-12 @ 08:35

Re: Dosbox SVN + savestates Build (Alpha)

Postby mjnman » 2017-6-07 @ 13:20

I'm sorry, it's not about savestate but only at dosbox linux binary which I used. I'll change thread.
mjnman
Newbie
 
Posts: 2
Joined: 2017-2-07 @ 10:11

Re: Dosbox SVN + savestates Build (Alpha)

Postby James-F » 2017-6-07 @ 15:33

@gandhig, I'm having trouble patching DOSBox, it freezes or takes a long time.
What's your patching command? "patch -p0 < patch,diff" from the HOME (~) directory right?

Also the patch calls for having "r4019_plain" "r4019_sav" directories, wouldn't it better to have them from withing these directories?
Then you don't actually have to have a "r4019_sav" directory to patch.

For example to make a patch from within "r4019_sav" directory:
diff -Nurb ~/r4019_plain . > ~/nameofpatch.patch
User avatar
James-F
Oldbie
 
Posts: 1405
Joined: 2015-11-30 @ 04:10

Re: Dosbox SVN + savestates Build (Alpha)

Postby gandhig » 2017-6-07 @ 19:01

@James-F, as you might be aware, there are many different options for generating a diff / applying a patch(as per user's preferences).

In my case(to keep it simple),

1) copy patch file to your dosbox home directory (containing autogen.sh(no intention to demean :happy: , just to ensure we are on the same page))
2) cd to dosbox home directory in mingw/linux
3) execute command 'patch -p1 < nameofpatch.patch'
User avatar
gandhig
Member
 
Posts: 329
Joined: 2014-2-12 @ 08:35

Re: Dosbox SVN + savestates Build (Alpha)

Postby James-F » 2017-6-08 @ 04:18

Thanks it worked, I've been using -p0 with my patches and that included the first directory, -p1 ignores the first directory.
But compilation did not.

Am I missing a library?
They are all related to ZIP and Compression.

Code: Select all
C:\MinGW\msys\1.0\home\TESTER\r4019_sav\src/save_state.cpp:67: undefined referen
ce to `compressBound'
C:\MinGW\msys\1.0\home\TESTER\r4019_sav\src/save_state.cpp:73: undefined referen
ce to `compress2'
save_state.o: In function `ZN4Util10decompressERKNSt7__cxx1112basic_stringIcSt11
char_traitsIcESaIcEEE':
C:\MinGW\msys\1.0\home\TESTER\r4019_sav\src/save_state.cpp:99: undefined referen
ce to `uncompress'
minizip.o: In function `getFileCrc':
C:\MinGW\msys\1.0\home\TESTER\r4019_sav\src/minizip.c:180: undefined reference t
o `crc32'
C:\MinGW\msys\1.0\home\TESTER\r4019_sav\src/minizip.c:180: undefined reference t
o `crc32'
unzip.o: In function `unzReadCurrentFile':
C:\MinGW\msys\1.0\home\TESTER\r4019_sav\src/unzip.c:1784: undefined reference to
 `crc32'
C:\MinGW\msys\1.0\home\TESTER\r4019_sav\src/unzip.c:1854: undefined reference to
 `inflate'
C:\MinGW\msys\1.0\home\TESTER\r4019_sav\src/unzip.c:1865: undefined reference to
 `crc32'
unzip.o: In function `unzCloseCurrentFile':
C:\MinGW\msys\1.0\home\TESTER\r4019_sav\src/unzip.c:2030: undefined reference to
 `inflateEnd'
unzip.o: In function `unzOpenCurrentFile3':
C:\MinGW\msys\1.0\home\TESTER\r4019_sav\src/unzip.c:1584: undefined reference to
 `inflateInit2_'
zip.o: In function `zipWriteInFileInZip':
C:\MinGW\msys\1.0\home\TESTER\r4019_sav\src/zip.c:1413: undefined reference to `
crc32'
C:\MinGW\msys\1.0\home\TESTER\r4019_sav\src/zip.c:1472: undefined reference to `
deflate'
zip.o: In function `zipCloseFileInZipRaw64':
C:\MinGW\msys\1.0\home\TESTER\r4019_sav\src/zip.c:1542: undefined reference to `
deflate'
C:\MinGW\msys\1.0\home\TESTER\r4019_sav\src/zip.c:1584: undefined reference to `
deflateEnd'
zip.o: In function `zipOpenNewFileInZip4_64':
C:\MinGW\msys\1.0\home\TESTER\r4019_sav\src/zip.c:1248: undefined reference to `
get_crc_table'
C:\MinGW\msys\1.0\home\TESTER\r4019_sav\src/zip.c:1220: undefined reference to `
deflateInit2_'
collect2.exe: error: ld returned 1 exit status
make[3]: *** [dosbox.exe] Error 1
make[3]: Leaving directory `/home/TESTER/r4019_sav/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/TESTER/r4019_sav/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/TESTER/r4019_sav'
User avatar
James-F
Oldbie
 
Posts: 1405
Joined: 2015-11-30 @ 04:10

Re: Dosbox SVN + savestates Build (Alpha)

Postby gandhig » 2017-6-08 @ 06:51

These 'undefined references' point to the libraries, 'lpng' & its dependency, 'zlib'. Have they been installed in your mingw environment? If yes, please check their versions too. For your ready reference, the details of the dependencies and its versions in my mingw win32 build are reproduced from one of the earlier posts:

Win32 Build Summary:
Code: Select all
1) Followed Building DOSBox wiki

2) Works in both WinXP and Win7 unlike the previous VS2017 build(WinXP - not a valid win32 application error)

3) Dependencies compiled:
   a) SDL (1.2.15) - library directly added
   b) Direct Draw - libraries directly added
   c) libpng (1.6.29) & its dependency zlib( 1.2.8 )
   d) SDL_net (1.2.8)
   e) libogg (1.3.2)
   f) libvorbis (1.3.5)
   g) SDL_sound (1.0.3)
User avatar
gandhig
Member
 
Posts: 329
Joined: 2014-2-12 @ 08:35

Re: Dosbox SVN r4019 + savestates Build (Alpha)

Postby bruenor41 » 2017-9-07 @ 08:49

Hi, I updated save states, some things were not saved, so I took missing stuff from daum build and I fixed some errors by myself, I don't understand why these errors didn't appear in daum... I use more enhanced version, so I merged changes to r4019, hope without errors. Sorry, I don't know how to create diff. With these changes increases significantly range of games which supports save/load states, but still not perfect. Dynrec needs more mork, it wont load everything correctly. Seems, it needs reset, like has _x86 version.
Attachments
r4019_save_states.zip
(2.56 MiB) Downloaded 15 times
bruenor41
Newbie
 
Posts: 11
Joined: 2013-4-22 @ 08:58

Re: Dosbox SVN r4019 + savestates Build (Alpha)

Postby gandhig » 2017-9-07 @ 18:25

Great job bruenor41. It would be helpful if you could list out the games that got fixed or performed better w.r.t savesate loads.
User avatar
gandhig
Member
 
Posts: 329
Joined: 2014-2-12 @ 08:35

Re: Dosbox SVN r4019 + savestates Build (Alpha)

Postby bruenor41 » 2017-9-08 @ 07:50

C&C1 and Red Alert - fixed segmentation faults
Fallout 1 - fixed crash when loading states through different areas
Earth 2140 - fixed crash
Wolfenstein 3d + SWOLF - fixes graphical glitches
Lands of Lore 1 - loads now correctly when loading through different areas, dynrec does not work here
etc

Games what I tested for a longer time and seems to be OK:
Warcraft 1,2
Albion - from beginning to the end I used states and works at 100%
Fallout 1
C&C1
Doom
Might and Magic 1
KKND
Ignition
Wacky wheels
Dangerous Dave
Bio Menace

Shortly tested :
Settlers 2
Realms of Arkania 1,2 (3rd part was not tested)
Monkey Island 1
Ultima 7 - states wont load during intro and menu, but in game it works
Duke 3D
Syndicate
Willy Beamish

Games which I cant get work :
Daggerfall
bruenor41
Newbie
 
Posts: 11
Joined: 2013-4-22 @ 08:58

Re: Dosbox SVN r4019 + savestates Build (Alpha)

Postby bruenor41 » 2017-9-11 @ 18:50

Hi people, here is newest version of save/load states. Because my knowledge of cpu is not so good, I asked M-HT for a help. He implemented missing dynrec cache reset. I send him big thanks. I merged that fix to version posted above. As far as I tried, all games tested by me were loaded correctly now. Please, if you find game what does not work correctly with save/load states, post here it's name and your dosbox configuration. I'll try look at this.

EDIT : Save states checks which exe file is currently loaded. Might happen that you try load save stated during intro, but intro might be another exe file loaded by main game file. In this case, states are loaded when intro finishes and is loaded correct exe file.
Attachments
r4019_savestate_dynrecfix.zip
(2.56 MiB) Downloaded 22 times
Last edited by bruenor41 on 2017-9-11 @ 19:01, edited 1 time in total.
bruenor41
Newbie
 
Posts: 11
Joined: 2013-4-22 @ 08:58

Re: Dosbox SVN r4019 + savestates Build (Alpha)

Postby Firtasik » 2017-9-11 @ 19:01

Compiled version would be great. :happy:
11 1 111 11 1 1 1 1 1 11 1 1 111 1 111 1 1 1 1 111
User avatar
Firtasik
Member
 
Posts: 378
Joined: 2013-7-21 @ 19:07

Re: Dosbox SVN r4019 + savestates Build (Alpha)

Postby gandhig » 2017-9-13 @ 18:57

bruenor41 wrote:Hi people, here is newest version of save/load states.

Thanks again bruenor41.

Firtasik wrote:Compiled version would be great. :happy:

Sorry for the delay...work :dead: . Bruneor's latest builds(lin & win) attached in the first post.
User avatar
gandhig
Member
 
Posts: 329
Joined: 2014-2-12 @ 08:35

Re: Dosbox SVN r4019 + savestates Build (Alpha)

Postby Firtasik » 2017-9-13 @ 19:50

There's no need to apologise. Thanks! :-D

Alien Carnage is still crashing.
11 1 111 11 1 1 1 1 1 11 1 1 111 1 111 1 1 1 1 111
User avatar
Firtasik
Member
 
Posts: 378
Joined: 2013-7-21 @ 19:07

Re: Dosbox SVN r4019 + savestates Build (Alpha)

Postby bruenor41 » 2017-9-14 @ 22:50

Yes, right. I am now on vacation, but I can look at this next week. Thanks for info
bruenor41
Newbie
 
Posts: 11
Joined: 2013-4-22 @ 08:58

Re: Dosbox SVN r4019 + savestates Build (Alpha)

Postby bruenor41 » 2017-9-18 @ 07:26

I checked Alien Carnage. Sorry, currently I don't know how to fix it. Problem is that this game creates temporary files like HARRY14.$$$, but temporary files are not stored in save states. And if game does not find them or makes decision that are invalid, then it crashes. Problem is that I don't know which file is temporary, game can create many files, like save files or config files which cant be included in save state. I need some game identifier, then I can make game specific fixes.

One way is to set somewhere (in config?) that game which you run is really alien carnage, but best would be to let dosbox recognize game automatically, but I dont know how

Does it work in daum?
bruenor41
Newbie
 
Posts: 11
Joined: 2013-4-22 @ 08:58

Re: Dosbox SVN r4019 + savestates Build (Alpha)

Postby Firtasik » 2017-9-18 @ 10:22

It doesn't work in Daum, but gandhig has made this:
viewtopic.php?f=32&t=53116#p573596
11 1 111 11 1 1 1 1 1 11 1 1 111 1 111 1 1 1 1 111
User avatar
Firtasik
Member
 
Posts: 378
Joined: 2013-7-21 @ 19:07

Re: Dosbox SVN r4019 + savestates Build (Alpha)

Postby bruenor41 » 2017-9-18 @ 13:07

will check it
bruenor41
Newbie
 
Posts: 11
Joined: 2013-4-22 @ 08:58

Re: Dosbox SVN r4019 + savestates Build (Alpha)

Postby gandhig » 2017-9-18 @ 17:03

It was more of a workaround than a fix actually and nothing brainy. As bruenor41 said, the issue was due to temporary files created by the game. The save/load code for dosfiles was just commented out for the Alien carnage specific build, as an attempt for an actual fix failed on my part due to insufficient knowledge. Hence the advice to use the save/load feature of the game itself between levels and to use savestate feature within a level.
User avatar
gandhig
Member
 
Posts: 329
Joined: 2014-2-12 @ 08:35

PreviousNext

Return to DOSBox Development

Who is online

Users browsing this forum: No registered users and 3 guests