1
0
Fork 0

Support some installer disk detection methods: block device count, and specific MBR/boot sector contents. Fixes (original) SimCity, Amberstar, and later MicroProse installers.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4120
This commit is contained in:
ripsaw8080 2018-06-21 17:46:52 +00:00
parent 823242560c
commit 66b813ef9c
4 changed files with 32 additions and 7 deletions

View file

@ -840,6 +840,9 @@ static Bitu DOS_21Handler(void) {
reg_bx=dos.psp();
break;
case 0x52: { /* Get list of lists */
Bit8u count=2; // floppy drives always counted
while (count<DOS_DRIVES && Drives[count] && !Drives[count]->isRemovable()) count++;
dos_infoblock.SetBlockDevices(count);
RealPt addr=dos_infoblock.GetPointer();
SegSet16(es,RealSeg(addr));
reg_bx=RealOff(addr);
@ -1171,22 +1174,28 @@ static Bitu DOS_27Handler(void) {
}
static Bitu DOS_25Handler(void) {
if (Drives[reg_al] == 0){
if (reg_al >= DOS_DRIVES || !Drives[reg_al] || Drives[reg_al]->isRemovable()) {
reg_ax = 0x8002;
SETFLAGBIT(CF,true);
} else {
if (reg_cx == 1 && reg_dx == 0) {
if (reg_al >= 2) {
PhysPt ptr = PhysMake(SegValue(ds),reg_bx);
// write some BPB data into buffer for MicroProse installers
mem_writew(ptr+0x1c,0x3f); // hidden sectors
}
} else {
LOG(LOG_DOSMISC,LOG_NORMAL)("int 25 called but not as disk detection drive %u",reg_al);
}
SETFLAGBIT(CF,false);
if ((reg_cx != 1) ||(reg_dx != 1))
LOG(LOG_DOSMISC,LOG_NORMAL)("int 25 called but not as diskdetection drive %X",reg_al);
reg_ax = 0;
reg_ax = 0;
}
SETFLAGBIT(IF,true);
return CBRET_NONE;
}
static Bitu DOS_26Handler(void) {
LOG(LOG_DOSMISC,LOG_NORMAL)("int 26 called: hope for the best!");
if (Drives[reg_al] == 0){
if (reg_al >= DOS_DRIVES || !Drives[reg_al] || Drives[reg_al]->isRemovable()) {
reg_ax = 0x8002;
SETFLAGBIT(CF,true);
} else {