VOGONS

Common searches


Dosbox SVN r4019 + savestates Build (Alpha)

Topic actions

Reply 20 of 106, by gandhig

User metadata
Rank Member
Rank
Member
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 🤣 , especially at the rate Qbix is releasing one after the other 🤣 . 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.

Dosbox SVN r4019 + savestates Build (Alpha)
1st thread & the only one related to the forum(?)...warning about modern-retro combo
Dead, but, Personal Favourite
Replacement for Candy Crush...Train the Brain

Reply 22 of 106, by gandhig

User metadata
Rank Member
Rank
Member

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 🤣 . 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.

Dosbox SVN r4019 + savestates Build (Alpha)
1st thread & the only one related to the forum(?)...warning about modern-retro combo
Dead, but, Personal Favourite
Replacement for Candy Crush...Train the Brain

Reply 24 of 106, by James-F

User metadata
Rank Oldbie
Rank
Oldbie

@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


my important / useful posts are here

Reply 25 of 106, by gandhig

User metadata
Rank Member
Rank
Member

@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 😀 , 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'

Dosbox SVN r4019 + savestates Build (Alpha)
1st thread & the only one related to the forum(?)...warning about modern-retro combo
Dead, but, Personal Favourite
Replacement for Candy Crush...Train the Brain

Reply 26 of 106, by James-F

User metadata
Rank Oldbie
Rank
Oldbie

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.

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'


my important / useful posts are here

Reply 27 of 106, by gandhig

User metadata
Rank Member
Rank
Member

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:

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)

Dosbox SVN r4019 + savestates Build (Alpha)
1st thread & the only one related to the forum(?)...warning about modern-retro combo
Dead, but, Personal Favourite
Replacement for Candy Crush...Train the Brain

Reply 28 of 106, by bruenor41

User metadata
Rank Newbie
Rank
Newbie

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

  • Filename
    r4019_save_states.zip
    File size
    2.56 MiB
    Downloads
    65 downloads
    File license
    Fair use/fair dealing exception

Reply 29 of 106, by gandhig

User metadata
Rank Member
Rank
Member

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.

Dosbox SVN r4019 + savestates Build (Alpha)
1st thread & the only one related to the forum(?)...warning about modern-retro combo
Dead, but, Personal Favourite
Replacement for Candy Crush...Train the Brain

Reply 30 of 106, by bruenor41

User metadata
Rank Newbie
Rank
Newbie

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

Reply 31 of 106, by bruenor41

User metadata
Rank Newbie
Rank
Newbie

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

Last edited by bruenor41 on 2017-09-11, 19:01. Edited 1 time in total.

Reply 33 of 106, by gandhig

User metadata
Rank Member
Rank
Member
bruenor41 wrote:

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

Thanks again bruenor41.

Firtasik wrote:

Compiled version would be great. 😀

Sorry for the delay...work 😵 . Bruneor's latest builds(lin & win) attached in the first post.

Dosbox SVN r4019 + savestates Build (Alpha)
1st thread & the only one related to the forum(?)...warning about modern-retro combo
Dead, but, Personal Favourite
Replacement for Candy Crush...Train the Brain

Reply 36 of 106, by bruenor41

User metadata
Rank Newbie
Rank
Newbie

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?

Reply 39 of 106, by gandhig

User metadata
Rank Member
Rank
Member

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.

Dosbox SVN r4019 + savestates Build (Alpha)
1st thread & the only one related to the forum(?)...warning about modern-retro combo
Dead, but, Personal Favourite
Replacement for Candy Crush...Train the Brain