Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] D drive custom .IMG mounting option #290

Closed
RaouleMenard opened this issue Jun 27, 2022 · 10 comments
Closed

[Feature Request] D drive custom .IMG mounting option #290

RaouleMenard opened this issue Jun 27, 2022 · 10 comments

Comments

@RaouleMenard
Copy link

RaouleMenard commented Jun 27, 2022

Hi again!

When running a Windows 9x OS currently, the D drive is a .SAV file with the same name as the CD ISO.

This system have a few issues such as 1GB limit, and difficulties coping files to it.

Can you please add an option in the core config such as "D Drive" = "Automatic/Custom".

Automatic mode is the current system.

Where in custom mode, the core will search for an .IMG file with the same name as the CD ISO file in the save folder instead of the .SAV file, and mount it as the D drive.

This will allow to create D drive .IMG files manually in the format that you need for each game.

You can create such images with "IMGMAKE hdd.img -t hd -size 2048" (for a 2GB drive).

You could also add a default custom .IMG file, for instance here's an image of 2GB in FAT16 format - it compress to a 2MB .ZIP file:
2GB-F16.zip

So, this system would fix all the current issues with the .SAV format, such as drive size, format, and it's very easy to edit / copy files from and to .IMG files.

Any chance you'd implement this feature? Thanks!

EDIT:
Actually, you don't even need an option for this: If the .IMG file exist for the CD, the core will use it, if not, it will just work as always with the .SAV system.

@schellingb
Copy link
Owner

Sorry I haven't replied to this yet. But I think this is a good idea, especially without the need for an option. If there is a .IMG next to a .ISO or .ZIP with the exact same file name, use it as is as the D: drive, otherwise generate the D: drive like it does now.

@RaouleMenard
Copy link
Author

Sorry I haven't replied to this yet. But I think this is a good idea, especially without the need for an option. If there is a .IMG next to a .ISO or .ZIP with the exact same file name, use it as is as the D: drive, otherwise generate the D: drive like it does now.

Yes that would work. Thanks!

schellingb added a commit that referenced this issue Jul 5, 2022
Instead of emulating a FAT file system from the mounted content, try to load a file with a .img extension next to the loaded content.
For example if loading 'GAME.zip', it will look for 'GAME.zip.img' and use that as the second hard drive if it exists
@schellingb
Copy link
Owner

I somewhat reluctantly put this into the newly released version 0.9.7. I say reluctantly because for now it's completely undocumented that this is possible except in the source code and in this issue. As mentioned in the commit message, if loading 'GAME.zip', it will look for 'GAME.zip.img' and use that as the second hard drive if it exists (make sure it's not just 'GAME.img'). Maybe give it a shot? :-)

@RaouleMenard
Copy link
Author

Hi @schellingb

I've just tested this by loading a game .iso, and using the 2GB .img I've provided. It's working fine.

I've copied a file into D drive within dosbox pure, and was able to access it on my desktop pc by reading the .img file with 7zip.

I think you should mention this feature because it will interest people making libraries of games such as EXODOS.

On a related note, I wonder if you could merge both the .img and .sav system:

Basically, installing a fresh game into the .img file and locking it, then saving all upcoming changes to D drive into the .sav file.

This would allow to have the installed games .img in the same folder as the CD isos, and the small .sav files in the save folder.

This will help those having their saves sync in cloud - for instance I have all my saves in Google Drive, but the current .sav system generate huge files - 1GB+, even if the change is a single 4KB savegame.

@ryz
Copy link

ryz commented Jul 8, 2022

I just stumbled upon this and would greatly appreciate this functionality as per @RaouleMenard's last post!

TBH, I was a bit confused in general on how to actually access content after installing it, i.e. if you always have to "Load Content" (e.g. the ISO of the game installed) in case you want to access the SAV file/partition/drive of the installed game. A clear guide outlining the intended use case would be great!

@RaouleMenard
Copy link
Author

I found a solution for the big .SAV files:

  • Use the empty .IMG file and install the game from the .ISO in it.
  • Extract the files in the .IMG to a .ZIP file using 7zip.
  • Remove the .IMG file and use the .ZIP file with the .ISO.

Now, the D drive is the .ZIP file, the .ISO is mounted as it should, and the changes to D are saved in a small .SAV file.

@ryz
Copy link

ryz commented Jul 8, 2022

  • Remove the .IMG file and use the .ZIP file with the .ISO.
    Now, the D drive is the .ZIP file, the .ISO is mounted as it should, and the changes to D are saved in a small .SAV file.

@RaouleMenard How do you achieve the last two steps? Do you put the ISO within the ZIP file? e.g:

game.zip
├── game.iso
└── game/
     ├── game.exe
     └── (other files)

Still trying to figure out the optimal way of configuring game setups.

@RaouleMenard
Copy link
Author

Nope:

  • Delete the .IMG file.
  • Load the .ZIP file with DosBox-Pure.
  • On the selection menu go to Disc Control and mount the .ISO.
  • Then run the installed OS.

@ryz
Copy link

ryz commented Jul 8, 2022

@RaouleMenard interesting, thanks. Good to know this approach works, wasn't aware one can load content AND mount a ISO file at the same time.

In theory this sounds good, but I think it has a few problems:

  • Setup requires quite some additional steps (IMG file, extraction/conversion, ...)
  • Starting a game requires quite a few extra steps in the right order (Load Content > Load New Disk > Insert Disk > Run OS)
    • Which also means autoboot doesn't work anymore (or can you auto-mount a disc?)
  • The game i tested for this approach (Road Rash) threw an error about missing DLLs when starting it from the ZIP file
  • Requires one more file to keep around (ISO, ZIP and SAV vs ZIP and SAV)

I'll do this for now:

  • Keep the ISO in a ZIP file (which is the content loaded with DOSBox-Pure)
    • This saves some space at least and the ZIP file can be directly loaded and autobooted
  • Install the game to the D drive, creating a SAV file that is of course larger
  • Load the content ZIP file with DOSBox-Pure

Curious, where do you see the benefits and/or storage savings? For me both approaches seem to have similar file sizes, just within different files.

What I do like though is the easy access to the ZIP file from the host OS. Maybe @schellingb will be able to use IMG files as storage or make SAV files readable by 7zip?

@RaouleMenard
Copy link
Author

After all the steps, you can put the .ISO into the .ZIP file, so you could mount it easily and auto-boot.

Though this will work only if the game doesn't require swapping CDs, as you can't select an .ISO from within a .ZIP with Disc Control.

My goal with this method is to have a small .SAV file, because my Saves folder is in the cloud - shared between my Windows and Android devices.

The difference in size is huge, the normal .SAV would take 500MB-1GB, but with this method only a few KBs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants