1
0
Fork 0

Add basic support for INT 13 call 15. Used by korean powerdolls to detect harddrive.

SF bug #477

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4091
This commit is contained in:
Peter Veenstra 2018-04-04 11:14:03 +00:00
parent 48611d6141
commit a4373c0995

View file

@ -497,6 +497,46 @@ static Bitu INT13_DiskHandler(void) {
reg_ah = 0x00;
CALLBACK_SCF(false);
break;
case 0x15: /* Get disk type */
/* Korean Powerdolls uses this to detect harddrives */
LOG(LOG_BIOS,LOG_WARN)("INT13: Get disktype used!");
if (any_images) {
if(driveInactive(drivenum)) {
last_status = 0x07;
reg_ah = last_status;
CALLBACK_SCF(true);
return CBRET_NONE;
}
Bit32u tmpheads, tmpcyl, tmpsect, tmpsize;
imageDiskList[drivenum]->Get_Geometry(&tmpheads, &tmpcyl, &tmpsect, &tmpsize);
Bit64u largesize = tmpheads*tmpcyl*tmpsect*tmpsize;
largesize/=512;
Bit32u ts = static_cast<Bit32u>(largesize);
reg_ah = (drivenum <2)?2:3;
reg_cx = static_cast<Bit16u>(ts >>16);
reg_dx = static_cast<Bit16u>(ts & 0xffff);
CALLBACK_SCF(false);
} else {
if (drivenum <DOS_DRIVES && (Drives[drivenum] != 0 || drivenum <2)) {
if (drivenum <2) {
//TODO use actual size (using 1.44 for now).
reg_ah = 0x2; // type
reg_cx = 0;
reg_dx = 0x2880;
} else {
//TODO use actual size (using 105 mb for now).
reg_ah = 0x3; // type
reg_cx = 3;
reg_dx = 0x4800;
}
CALLBACK_SCF(false);
} else {
LOG(LOG_BIOS,LOG_WARN)("INT13: no images, but invalid drive for call 15");
reg_ah=0xff;
CALLBACK_SCF(true);
}
}
break;
case 0x17: /* Set disk type for format */
/* Pirates! needs this to load */
killRead = true;