dosbox-pure icon indicating copy to clipboard operation
dosbox-pure copied to clipboard

Possible Cause Found for Repeated Recreation of Might and Magic VI-896F6745.sav — Requesting Review

Open gaoyimin1980 opened this issue 5 months ago • 3 comments

I enabled OS Disk: save difference per content in the Dosbox-pure core. When I launch a Windows 98 game like Might and Magic VI for the first time in RetroArch, it creates two files: Might and Magic VI-CDRIVE.sav and Might and Magic VI-896F6745.sav. That part is expected and not the main issue.

The problem arises when I close that game and launch another Windows 98 game without exiting RetroArch. In this scenario, there is a chance that Windows 98 will throw an error during boot — sometimes even a critical error that forces it into Safe Mode. It seems like the Win98 image is corrupted, though in fact it’s not. If I force-close the game and restart it again, everything works fine. However, if I exit RetroArch entirely after the first game and only then launch the second one, I never encounter this issue.

This leads me to suspect that the Dosbox-pure core might be caching or extracting temporary data while running Win98 games, and sometimes fails to properly clean up these temporary files. As a result, when launching another game, it may reuse leftover data from the previous session, causing Win98 to crash or enter Safe Mode. Restarting or quitting RetroArch seems to clear this cache and fix the issue.

More importantly — and this is just a hypothesis — I wonder if this same bug is also the reason why Might and Magic VI-896F6745.sav keeps getting recreated. Perhaps Dosbox-pure incorrectly detects changes on the C: drive and keeps generating a new D: drive .sav file, even though no real changes were made.

I hope this observation can help in tracking down this persistent issue.

gaoyimin1980 avatar Jul 13 '25 09:07 gaoyimin1980

Are you fully shutting down the emulated Windows 98 before switching content? If not, there is always a chance that Windows 98 hasn't fully written everything to disk and the files or the file system end up in a corrupt state. Just like on real hardware when a computer unexpectedly loses power. Modern operating systems and file systems are more resilient to sudden power loss, but back then corruption was very common.

schellingb avatar Jul 28 '25 03:07 schellingb

Are you fully shutting down the emulated Windows 98 before switching content? If not, there is always a chance that Windows 98 hasn't fully written everything to disk and the files or the file system end up in a corrupt state. Just like on real hardware when a computer unexpectedly loses power. Modern operating systems and file systems are more resilient to sudden power loss, but back then corruption was very common.

First of all, I'd like to add some details: I’ve packaged each game into a separate .dosz file, and each one boots individually through a Windows 98 image, creating its own separate save.

As you mentioned, I haven’t been shutting down Windows 98 properly. Instead, I’ve been using the RetroArch menu to forcefully close the DOSBox Pure core, then immediately launch another .dosz. Occasionally, this causes the system to crash.

However, interestingly, this kind of corruption or instability doesn’t seem to be permanent — if I fully exit RetroArch or even just restart the same .dosz, everything works normally again.

gaoyimin1980 avatar Jul 29 '25 18:07 gaoyimin1980

Are you fully shutting down the emulated Windows 98 before switching content? If not, there is always a chance that Windows 98 hasn't fully written everything to disk and the files or the file system end up in a corrupt state. Just like on real hardware when a computer unexpectedly loses power. Modern operating systems and file systems are more resilient to sudden power loss, but back then corruption was very common.

By the way, I just remembered — I’ve set up separate C and D drive saves for each .dosz. Also, both my win98.img and the .dosz files are set to read-only.

So even if there’s a sudden power loss that causes the C drive image for one game (for example, 123.dosz) to become corrupted, the C drive save for another game (like 456.dosz) remains unaffected. They’re completely independent from each other with no shared data.

gaoyimin1980 avatar Jul 29 '25 18:07 gaoyimin1980