Moved scrollbar tracking code to scroll.c.
[wine] / msdos / int25.c
1 /*
2  * DOS interrupt 25h handler
3  */
4
5 #include <stdlib.h>
6 #include <string.h>
7 #include <fcntl.h>
8 #include <unistd.h>
9 #include "msdos.h"
10 #include "miscemu.h"
11 #include "drive.h"
12 #include "debugtools.h"
13
14 DEFAULT_DEBUG_CHANNEL(int);
15
16
17 /**********************************************************************
18  *          INT_Int25Handler (WPROCS.137)
19  *
20  * Handler for int 25h (absolute disk read).
21  */
22 void WINAPI INT_Int25Handler( CONTEXT86 *context )
23 {
24     BYTE *dataptr = CTX_SEG_OFF_TO_LIN( context, context->SegDs, context->Ebx );
25     DWORD begin, length;
26
27     if (!DRIVE_IsValid(LOBYTE(context->Eax)))
28     {
29         SET_CFLAG(context);
30         AX_reg(context) = 0x0201;        /* unknown unit */
31         return;
32     }
33
34     if (LOWORD(context->Ecx) == 0xffff)
35     {
36         begin   = *(DWORD *)dataptr;
37         length  = *(WORD *)(dataptr + 4);
38         dataptr = (BYTE *)CTX_SEG_OFF_TO_LIN( context,
39                                         *(WORD *)(dataptr + 8), *(DWORD *)(dataptr + 6) );
40     }
41     else
42     {
43         begin  = LOWORD(context->Edx);
44         length = LOWORD(context->Ecx);
45     }
46     TRACE("int25: abs diskread, drive %d, sector %ld, "
47                  "count %ld, buffer %p\n",
48           LOBYTE(context->Eax), begin, length, dataptr);
49
50     DRIVE_RawRead(LOBYTE(context->Eax), begin, length, dataptr, TRUE);
51     RESET_CFLAG(context);
52 }
53