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

Issue with Selecting Disc Images (Including IMG Files) on the Start Menu

Open gaoyimin1980 opened this issue 7 months ago • 2 comments

I am playing a game on Windows 98 using DOSBoxPure, and I have compressed the game into a DOSZ package, for example, dragon.dosz. The game contains several IMG files, which are not disc image files, but are necessary game files for the game to run. However, when I load the game through the Start Menu in DOSBoxPure, it adds IMG files larger than 3MB to the list of disc images to be loaded. Even though I choose not to mount them, once I enter the Windows 98 environment, these IMG files that previously appeared in the disc image list are missing from the simulated D drive (even though I did not choose to mount them in the Start Menu). This causes the game to fail to run.

Could it be changed so that, if I don't mount these IMG files, they won't disappear when I enter Windows 98, but will remain in their original location? While games with multiple IMG files are rare, there are still a few games designed this way.

gaoyimin1980 avatar May 09 '25 02:05 gaoyimin1980

You're right, it's not a good idea to hide potentially mountable files from the simulated D drive.

Very unfortunately though it is a bit difficult to change this now because it would invalidate any kind of D-drive modifications that have already been made with the core since the feature was introduced... So I'm a bit unsure what to do.

These are all the file extensions that are assumed to be disc/disk images and thus hidden from the simulated D-drive in Windows 9x: ISO, CHD, CUE, INS, IMG, IMA, VHD, JRC, TC

Though there's further special rules depending on the extension:

  • IMG/IMA: Don't treat as disk image if file size is smaller than 160 KB
  • IMG/IMA: Don't treat as disk image if size is less than 1880 KB file size isn't perfectly divisible by 20 KB
  • INS: Make sure it's content is an actual CUE file

We could strengthen these rules, and add more for other file types to avoid false positives like your .IMG files. This would still invalidate D-drive modifications for users but hopefully only in cases where things were already broken due to there being false positives like your case.

Alternative would be to introduce a new format of some sort for changes made to the D-drive and don't exclude disk images when simulating the D-drive when using the new format. I was always interested in making changes to the D-drive a regular ZIP file like we do for the C-drive in DOS. Though this was and is still quite a complicated endeavor.

schellingb avatar May 09 '25 05:05 schellingb

You're right, it's not a good idea to hide potentially mountable files from the simulated D drive.

Very unfortunately though it is a bit difficult to change this now because it would invalidate any kind of D-drive modifications that have already been made with the core since the feature was introduced... So I'm a bit unsure what to do.

These are all the file extensions that are assumed to be disc/disk images and thus hidden from the simulated D-drive in Windows 9x: ISO, CHD, CUE, INS, IMG, IMA, VHD, JRC, TC

Though there's further special rules depending on the extension:

  • IMG/IMA: Don't treat as disk image if file size is smaller than 160 KB
  • IMG/IMA: Don't treat as disk image if size is less than 1880 KB file size isn't perfectly divisible by 20 KB
  • INS: Make sure it's content is an actual CUE file

We could strengthen these rules, and add more for other file types to avoid false positives like your .IMG files. This would still invalidate D-drive modifications for users but hopefully only in cases where things were already broken due to there being false positives like your case.

Alternative would be to introduce a new format of some sort for changes made to the D-drive and don't exclude disk images when simulating the D-drive when using the new format. I was always interested in making changes to the D-drive a regular ZIP file like we do for the C-drive in DOS. Though this was and is still quite a complicated endeavor.

I found a workaround to bypass this issue. Here's what I did: I created a CUE file with the same name for each IMG file that appeared in the Start Menu list, and pointed it to the same disc image (e.g., 123.iso). Of course, it would work without the reference, but an error message will pop up during startup saying that the CUE file couldn't find the disc image.

With this method, only the CUE files appear in the Start Menu list instead of the IMG files, and the IMG files remain intact. This way, the game runs without any issues. I hope this somewhat unconventional method can inspire you to find ways around things that require complex modifications to achieve. Haha.

gaoyimin1980 avatar May 09 '25 05:05 gaoyimin1980