Small fixes.
[wine/multimedia.git] / msdos / int11.c
blob08ce32d2705c4d4c3d0b9b8b1e82ea688f06b65e
1 /*
2 * BIOS interrupt 11h handler
3 */
5 #include <stdlib.h>
6 #include "miscemu.h"
7 #include "msdos.h"
8 #include "drive.h"
9 #include "debug.h"
11 /**********************************************************************
12 * INT_Int11Handler
14 * Handler for int 11h (get equipment list).
16 void WINAPI INT_Int11Handler( CONTEXT *context )
18 int diskdrives = 0;
19 int parallelports = 0;
20 int serialports = 0;
21 int x;
23 /* borrowed from Ralph Brown's interrupt lists
25 bits 15-14: number of parallel devices
26 bit 13: [Conv] Internal modem
27 bit 12: reserved
28 bits 11- 9: number of serial devices
29 bit 8: reserved
30 bits 7- 6: number of diskette drives minus one
31 bits 5- 4: Initial video mode:
32 00b = EGA,VGA,PGA
33 01b = 40 x 25 color
34 10b = 80 x 25 color
35 11b = 80 x 25 mono
36 bit 3: reserved
37 bit 2: [PS] =1 if pointing device
38 [non-PS] reserved
39 bit 1: =1 if math co-processor
40 bit 0: =1 if diskette available for boot
42 /* Currently the only of these bits correctly set are:
43 bits 15-14 } Added by William Owen Smith,
44 bits 11-9 } wos@dcs.warwick.ac.uk
45 bits 7-6
46 bit 2 (always set)
49 if (DRIVE_IsValid(0)) diskdrives++;
50 if (DRIVE_IsValid(1)) diskdrives++;
51 if (diskdrives) diskdrives--;
53 for (x=0; x!=MAX_PORTS; x++)
55 if (COM[x].devicename)
56 serialports++;
57 if (LPT[x].devicename)
58 parallelports++;
60 if (serialports > 7) /* 3 bits -- maximum value = 7 */
61 serialports=7;
62 if (parallelports > 3) /* 2 bits -- maximum value = 3 */
63 parallelports=3;
65 AX_reg(context) = (diskdrives << 6) | (serialports << 9) |
66 (parallelports << 14) | 0x02;