mirror of
https://github.com/joncampbell123/dosbox-x.git
synced 2025-05-09 03:41:10 +08:00
DOS: Add INT 21h AX=7305h extended absolute disk read/write to satisfy FORMAT.COM and SCANDISK.EXE shipped with Windows 98
This commit is contained in:
parent
43b0dc2d25
commit
9a76485bb0
@ -74,6 +74,9 @@ char * shiftjis_upcase(char * str) {
|
||||
return str;
|
||||
}
|
||||
|
||||
static Bitu DOS_25Handler_Actual(bool fat32);
|
||||
static Bitu DOS_26Handler_Actual(bool fat32);
|
||||
|
||||
unsigned char cpm_compat_mode = CPM_COMPAT_MSDOS5;
|
||||
|
||||
bool dos_in_hma = true;
|
||||
@ -2025,6 +2028,17 @@ static Bitu DOS_21Handler(void) {
|
||||
}
|
||||
rsize=false;
|
||||
}
|
||||
else if (reg_al == 5 && reg_cx == 0xFFFF && (dos.version.major > 7 || (dos.version.major == 7 && dos.version.minor >= 10))) {
|
||||
/* Windows 9x FAT32 extended disk read/write */
|
||||
reg_al = reg_dl - 1; /* INT 25h AL 0=A: 1=B: This interface DL 1=A: 2=B: */
|
||||
if (reg_si & 1)
|
||||
DOS_26Handler_Actual(true/*fat32*/); /* writing */
|
||||
else
|
||||
DOS_25Handler_Actual(true/*fat32*/); /* reading */
|
||||
|
||||
/* CF needs to be returned on stack or else it's lost */
|
||||
CALLBACK_SCF(!!(reg_flags & FLAG_CF));
|
||||
}
|
||||
else {
|
||||
LOG(LOG_DOSMISC,LOG_ERROR)("DOS:Unhandled call %02X al=%02X (MS-DOS 7.x function)",reg_ah,reg_al);
|
||||
CALLBACK_SCF(true);
|
||||
@ -2100,7 +2114,7 @@ static Bitu DOS_27Handler(void) {
|
||||
return CBRET_NONE;
|
||||
}
|
||||
|
||||
static Bitu DOS_25Handler(void) {
|
||||
static Bitu DOS_25Handler_Actual(bool fat32) {
|
||||
if (reg_al >= DOS_DRIVES || !Drives[reg_al] || Drives[reg_al]->isRemovable()) {
|
||||
reg_ax = 0x8002;
|
||||
SETFLAGBIT(CF,true);
|
||||
@ -2146,7 +2160,14 @@ static Bitu DOS_25Handler(void) {
|
||||
return CBRET_NONE;
|
||||
}
|
||||
|
||||
if (req_count == 0xFFFF) {
|
||||
if (fat32) {
|
||||
sector_num = mem_readd(ptr+0);
|
||||
req_count = mem_readw(ptr+4);
|
||||
Bit32u p = mem_readd(ptr+6);
|
||||
ptr = PhysMake(p >> 16u,p & 0xFFFFu);
|
||||
method = "Win95/FAT32";
|
||||
}
|
||||
else if (req_count == 0xFFFF) {
|
||||
sector_num = mem_readd(ptr+0);
|
||||
req_count = mem_readw(ptr+4);
|
||||
Bit32u p = mem_readd(ptr+6);
|
||||
@ -2157,11 +2178,20 @@ static Bitu DOS_25Handler(void) {
|
||||
method = "<32MB";
|
||||
}
|
||||
|
||||
if (fat32) {
|
||||
LOG(LOG_MISC,LOG_DEBUG)("INT 21h AX=7305h READ: sector=%lu count=%lu ptr=%lx method='%s'",
|
||||
(unsigned long)sector_num,
|
||||
(unsigned long)req_count,
|
||||
(unsigned long)ptr,
|
||||
method);
|
||||
}
|
||||
else {
|
||||
LOG(LOG_MISC,LOG_DEBUG)("INT 25h READ: sector=%lu count=%lu ptr=%lx method='%s'",
|
||||
(unsigned long)sector_num,
|
||||
(unsigned long)req_count,
|
||||
(unsigned long)ptr,
|
||||
method);
|
||||
}
|
||||
|
||||
SETFLAGBIT(CF,false);
|
||||
reg_ax = 0;
|
||||
@ -2199,7 +2229,12 @@ static Bitu DOS_25Handler(void) {
|
||||
}
|
||||
return CBRET_NONE;
|
||||
}
|
||||
static Bitu DOS_26Handler(void) {
|
||||
|
||||
static Bitu DOS_25Handler(void) {
|
||||
return DOS_25Handler_Actual(false);
|
||||
}
|
||||
|
||||
static Bitu DOS_26Handler_Actual(bool fat32) {
|
||||
if (reg_al >= DOS_DRIVES || !Drives[reg_al] || Drives[reg_al]->isRemovable()) {
|
||||
reg_ax = 0x8002;
|
||||
SETFLAGBIT(CF,true);
|
||||
@ -2245,7 +2280,14 @@ static Bitu DOS_26Handler(void) {
|
||||
return CBRET_NONE;
|
||||
}
|
||||
|
||||
if (req_count == 0xFFFF) {
|
||||
if (fat32) {
|
||||
sector_num = mem_readd(ptr+0);
|
||||
req_count = mem_readw(ptr+4);
|
||||
Bit32u p = mem_readd(ptr+6);
|
||||
ptr = PhysMake(p >> 16u,p & 0xFFFFu);
|
||||
method = "Win95/FAT32";
|
||||
}
|
||||
else if (req_count == 0xFFFF) {
|
||||
sector_num = mem_readd(ptr+0);
|
||||
req_count = mem_readw(ptr+4);
|
||||
Bit32u p = mem_readd(ptr+6);
|
||||
@ -2256,11 +2298,20 @@ static Bitu DOS_26Handler(void) {
|
||||
method = "<32MB";
|
||||
}
|
||||
|
||||
if (fat32) {
|
||||
LOG(LOG_MISC,LOG_DEBUG)("INT 21h AX=7305h WRITE: sector=%lu count=%lu ptr=%lx method='%s'",
|
||||
(unsigned long)sector_num,
|
||||
(unsigned long)req_count,
|
||||
(unsigned long)ptr,
|
||||
method);
|
||||
}
|
||||
else {
|
||||
LOG(LOG_MISC,LOG_DEBUG)("INT 26h WRITE: sector=%lu count=%lu ptr=%lx method='%s'",
|
||||
(unsigned long)sector_num,
|
||||
(unsigned long)req_count,
|
||||
(unsigned long)ptr,
|
||||
method);
|
||||
}
|
||||
|
||||
SETFLAGBIT(CF,false);
|
||||
reg_ax = 0;
|
||||
@ -2290,6 +2341,10 @@ static Bitu DOS_26Handler(void) {
|
||||
return CBRET_NONE;
|
||||
}
|
||||
|
||||
static Bitu DOS_26Handler(void) {
|
||||
return DOS_26Handler_Actual(false);
|
||||
}
|
||||
|
||||
bool enable_collating_uppercase = true;
|
||||
bool keep_private_area_on_boot = false;
|
||||
bool private_always_from_umb = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user