1
0
Fork 0

Improve disk image mounting: cycle disks only for the drive being mounted, make B: drive usable for BIOS access, and be insensitive to the order that drive letters are mounted.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4129
This commit is contained in:
ripsaw8080 2018-07-10 15:51:16 +00:00
parent 30ef5aefe9
commit be146f5c44
3 changed files with 34 additions and 29 deletions

View file

@ -169,26 +169,28 @@ void DriveManager::CycleDisk(bool pressed) {
}
*/
void DriveManager::CycleAllDisks(void) {
for (int idrive=0; idrive<DOS_DRIVES; idrive++) {
int numDisks = (int)driveInfos[idrive].disks.size();
if (numDisks > 1) {
// cycle disk
int currentDisk = driveInfos[idrive].currentDisk;
DOS_Drive* oldDisk = driveInfos[idrive].disks[currentDisk];
currentDisk = (currentDisk + 1) % numDisks;
DOS_Drive* newDisk = driveInfos[idrive].disks[currentDisk];
driveInfos[idrive].currentDisk = currentDisk;
// copy working directory, acquire system resources and finally switch to next drive
strcpy(newDisk->curdir, oldDisk->curdir);
newDisk->Activate();
Drives[idrive] = newDisk;
LOG_MSG("Drive %c: disk %d of %d now active", 'A'+idrive, currentDisk+1, numDisks);
}
void DriveManager::CycleDisks(int drive, bool notify) {
int numDisks = (int)driveInfos[drive].disks.size();
if (numDisks > 1) {
// cycle disk
int currentDisk = driveInfos[drive].currentDisk;
DOS_Drive* oldDisk = driveInfos[drive].disks[currentDisk];
currentDisk = (currentDisk + 1) % numDisks;
DOS_Drive* newDisk = driveInfos[drive].disks[currentDisk];
driveInfos[drive].currentDisk = currentDisk;
// copy working directory, acquire system resources and finally switch to next drive
strcpy(newDisk->curdir, oldDisk->curdir);
newDisk->Activate();
Drives[drive] = newDisk;
if (notify) LOG_MSG("Drive %c: disk %d of %d now active", 'A'+drive, currentDisk+1, numDisks);
}
}
void DriveManager::CycleAllDisks(void) {
for (int idrive=0; idrive<DOS_DRIVES; idrive++) CycleDisks(idrive, true);
}
int DriveManager::UnmountDrive(int drive) {
int result = 0;
// unmanaged drive