Skip to content

Commit

Permalink
Add "[dos] automount drive directories" option
Browse files Browse the repository at this point in the history
  • Loading branch information
aybe committed Jul 4, 2024
1 parent 22e5f1d commit 6e84f44
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
NEXT
- add "[dos] automount drive directories" option, this will mount
existing drive directories, from C drive to Y drive (aybe).
2024.07.01
- Correct Hercules InColor memory emulation. Read and write planar
behavior was incorrect due to a misunderstanding of available
Expand Down
26 changes: 26 additions & 0 deletions src/dos/dos_programs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9335,6 +9335,28 @@ void Add_VFiles(bool usecp) {
VFILE_RegisterBuiltinFileBlob(bfb_EGA_CPX, "/CPI/");
}

void Add_Existing_Drive_Directories()
{
for(auto drive = 'C'; drive < 'Y'; drive++)
{
auto name = std::string("drive");
auto path = std::string(".");

name += drive;
path += CROSS_FILESPLIT;
path += name;

getdrivezpath(path, name);

if (path.empty())
continue;

LOG_MSG("Mounting directory 'drive%c' found in DOSBox-X directory as drive %c.\n", static_cast<char>(drive + 32), drive);

MountHelper(drive, path.c_str(), "LOCAL");
}
}

void DOS_SetupPrograms(void) {
/*Add Messages */

Expand Down Expand Up @@ -9865,4 +9887,8 @@ void DOS_SetupPrograms(void) {

/*regular setup*/
Add_VFiles(false);

if (dos_section->Get_bool("automount drive directories")) {
Add_Existing_Drive_Directories();
}
}
3 changes: 3 additions & 0 deletions src/dosbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4426,6 +4426,9 @@ void DOSBOX_SetupConfigSections(void) {
Pstring->Set_help("The files or directories listed here (separated by space) will be either hidden or removed from the Z drive.\n"
"Files with leading forward slashes (e.g. \"/DEBUG\\BIOSTEST.COM\") will become hidden files (DIR /A will list them).");

Pbool = secprop->Add_bool("automount drive directories",Property::Changeable::OnlyAtStart, false);
Pbool->Set_help("If set, DOSBox-X will automatically mount existing drive directories from C drive to Y drive, e.g. \"DriveC\".");

Pbool = secprop->Add_bool("hidenonrepresentable",Property::Changeable::WhenIdle,true);
Pbool->Set_help("If set, DOSBox-X will hide files on local drives that are non-representative in the current DOS code page.\n"
"This may be required for some programs such as Windows 3.x Setup if the drives contain international filenames.");
Expand Down

0 comments on commit 6e84f44

Please sign in to comment.