my situation is this: when my program tries to read (or write) to a
floppy disk and the drive is not ready (ie the disk is missing or
the door is not closed) my nice clean display gets cluttered up with
'INT 24 critical error...drive not ready retry,abort,fail ?'
any suggestions would be helpful although i would rather not hook
in my own interrupt...i would rather just test for this condition...
thank you
daniel
--
-------------------->Need a SVGA Graphics Library?<---------------------
- Try SVGACC20.ZIP (MS & Borland C); SVGAPV20.ZIP (MS VBDOS & MS PDS); -
- or SVGAQB20.ZIP (MS QuickBASIC 4.x) -
----------------Daniel A. Sill si...@zoe.as.utexas.edu----------------
: my situation is this: when my program tries to read (or write) to a
: floppy disk and the drive is not ready (ie the disk is missing or
: the door is not closed) my nice clean display gets cluttered up with
: 'INT 24 critical error...drive not ready retry,abort,fail ?'
: any suggestions would be helpful although i would rather not hook
: in my own interrupt...i would rather just test for this condition...
Hi, I think this is something you wanted...
int checkfloppy(int drive)
{
struct REGPACK reg;
unsigned drivebyte, i=0, retvalue;
if(drive=='a') drive='A';
else if(drive=='b') drive='B';
drivebyte=(drive-0x41)&0x7F;
reg.r_ax = 0x00 << 8;
reg.r_dx = drivebyte;
intr(0x13, ®);
reg.r_flags=1;
while((reg.r_flags & 1) && (i<3)){
i++;
reg.r_flags=0x0000;
reg.r_ax=0x0401;
reg.r_cx=0x0001;
reg.r_dx=drivebyte;
intr(0x13, ®);
}
if ((reg.r_flags & 1) == 0)
retvalue=1;
else
retvalue=0;
reg.r_ax = 0x00 << 8;
reg.r_dx = drivebyte;
intr(0x13, ®);
return retvalue;
}
--
+-----------------------------+----------------------------------------+
| Tomi Mikkonen | Espoo-Vantaa Institute of Technology |
| email: tom...@evitech.fi | CSWI Creative SoftWorks Inc.redible |
+-----------------------------+----------------------------------------+
Everybody wants to go to heaven, but nobody wants to die.