Release 970824
[wine/multimedia.git] / msdos / int25.c
blob8e9960961a403d8fd9f5d82485d72ed99a79eca4
1 /*
2 * DOS interrupt 25h handler
3 */
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <string.h>
8 #include "msdos.h"
9 #include "ldt.h"
10 #include "miscemu.h"
11 #include "drive.h"
12 #include "stddebug.h"
13 /* #define DEBUG_INT */
14 #include "debug.h"
16 /**********************************************************************
17 * INT_Int25Handler
19 * Handler for int 25h (absolute disk read).
21 void WINAPI INT_Int25Handler( CONTEXT *context )
23 BYTE *dataptr = PTR_SEG_OFF_TO_LIN( DS_reg(context), BX_reg(context) );
24 DWORD begin, length;
26 if (!DRIVE_IsValid(AL_reg(context)))
28 SET_CFLAG(context);
29 AX_reg(context) = 0x0101; /* unknown unit */
30 return;
33 if (CX_reg(context) == 0xffff)
35 begin = *(DWORD *)dataptr;
36 length = *(WORD *)(dataptr + 4);
37 dataptr = (BYTE *)PTR_SEG_TO_LIN( *(SEGPTR *)(dataptr + 6) );
39 else
41 begin = DX_reg(context);
42 length = CX_reg(context);
44 dprintf_int( stdnimp, "int25: abs diskread, drive %d, sector %ld, "
45 "count %ld, buffer %d\n",
46 AL_reg(context), begin, length, (int) dataptr);
48 memset(dataptr, 0, length * 512);
50 if (begin == 0 && length > 1) *(dataptr + 512) = 0xf8;
52 if (begin == 1) *dataptr = 0xf8;
54 RESET_CFLAG(context);