Release 950620
[wine/multimedia.git] / miscemu / int25.c
blob6ebc32ea45a6a7bc6d2556b6334c4b7382fee842
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include "registers.h"
5 #include "msdos.h"
6 #include "ldt.h"
7 #include "wine.h"
8 #include "miscemu.h"
9 #include "dos_fs.h"
10 #include "stddebug.h"
11 /* #define DEBUG_INT */
12 #include "debug.h"
14 int do_int25(struct sigcontext_struct *context)
16 BYTE *dataptr = PTR_SEG_OFF_TO_LIN(DS, BX);
17 DWORD begin, length;
19 if(!DOS_ValidDrive(AL))
21 SetCflag;
22 AX = 0x0101; /* unknown unit */
24 /* push flags on stack */
25 SP -= sizeof(WORD);
26 setword(PTR_SEG_OFF_TO_LIN(SS,SP), (WORD) EFL);
27 return 1;
30 if (CX == 0xffff) {
31 begin = getdword(dataptr);
32 length = getword(&dataptr[4]);
33 dataptr = (BYTE *) PTR_SEG_TO_LIN(getdword(&dataptr[6]));
35 } else {
36 begin = DX;
37 length = CX;
39 dprintf_int(stdnimp, "int25: abs diskread, drive %d, sector %ld, "
40 "count %ld, buffer %d\n", AL, begin, length, (int) dataptr);
42 memset(dataptr, 0, length * 512);
44 if (begin == 0 && length > 1)
45 *(dataptr + 512) = 0xf8;
47 if (begin == 1)
48 *dataptr = 0xf8;
50 ResetCflag;
52 /* push flags on stack */
53 SP -= sizeof(WORD);
54 setword(PTR_SEG_OFF_TO_LIN(SS,SP), (WORD) EFL);
56 return 1;