Skip to content

Commit

Permalink
Merge pull request #4756 from maron2000/fix_pc98_boot
Browse files Browse the repository at this point in the history
Change PC-98 floppy boot behavior when Drive 2 is mounted before Drive 1
  • Loading branch information
joncampbell123 authored Jan 14, 2024
2 parents fe9b696 + 557e4d1 commit b46f324
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/dos/dos_programs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4819,14 +4819,19 @@ bool AttachToBiosByLetter(imageDisk* image, const char drive) {
}
LOG_MSG("BIOS: Warning: Four hard drives (Disk no. 2-5) attached to BIOS already. Drive %c not attached", drive);
}
#if 0
else if (IS_PC98_ARCH) {
// FIX_ME: This code is not correct. PC-98 boots from Drive 2 only if Drive 1 is empty.
// Currently disable this code since DOSBox-X supports only Drive A (Drive 1) as floppy boot drive anyway.

//for pc-98 machines, mount floppies at first available index
for (int index = 0; index < 2; index++) {
if (imageDiskList[index] == NULL) {
return AttachToBiosByIndex(image, index);
}
}
}
#endif
else if ((drive - 'A') < 2) {
//for PCs, mount floppies only if A: or B: is specified, and then if so, at specified index
return AttachToBiosByIndex(image, drive - 'A');
Expand All @@ -4844,14 +4849,20 @@ bool AttachToBiosAndIdeByLetter(imageDisk* image, const char drive, const unsign
}
LOG_MSG("BIOS: Warning: Four hard drives (Disk no. 2-5) attached to BIOS already. Drive %c not attached", drive);
}
#if 0
else if (IS_PC98_ARCH) {
// FIX_ME: This code is not correct. PC-98 boots from Drive 2 only if Drive 1 is empty.
// Currently disable this code since DOSBox-X supports only Drive A (Drive 1) as floppy boot drive anyway.

//for pc-98 machines, mount floppies at first available index
for (int index = 0; index < 2; index++) {
if (imageDiskList[index] == NULL) {
return AttachToBiosByIndex(image, index);
}
}
} else if ((drive - 'A') < 2) {
}
#endif
else if ((drive - 'A') < 2) {
//for PCs, mount floppies only if A: or B: is specified, and then if so, at specified index
return AttachToBiosByIndex(image, drive - 'A');
}
Expand Down

0 comments on commit b46f324

Please sign in to comment.