Removed obsolete code.
[wine] / msdos / int11.c
1 /*
2  * BIOS interrupt 11h handler
3  *
4  * Copyright 1996 Alexandre Julliard
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include "config.h"
22 #include "wine/port.h"
23
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include <string.h>
27
28 #include "windef.h"
29 #include "miscemu.h"
30 #include "msdos.h"
31 #include "file.h"
32 #include "wine/unicode.h"
33 #include "wine/debug.h"
34
35 /**********************************************************************
36  *          INT_Int11Handler (WPROCS.117)
37  *
38  * Handler for int 11h (get equipment list).
39  */
40 void WINAPI INT_Int11Handler( CONTEXT86 *context )
41 {
42     int diskdrives = 0;
43     int parallelports = 0;
44     int serialports = 0;
45     int x;
46
47 /* borrowed from Ralph Brown's interrupt lists
48
49                     bits 15-14: number of parallel devices
50                     bit     13: [Conv] Internal modem
51                     bit     12: reserved
52                     bits 11- 9: number of serial devices
53                     bit      8: reserved
54                     bits  7- 6: number of diskette drives minus one
55                     bits  5- 4: Initial video mode:
56                                     00b = EGA,VGA,PGA
57                                     01b = 40 x 25 color
58                                     10b = 80 x 25 color
59                                     11b = 80 x 25 mono
60                     bit      3: reserved
61                     bit      2: [PS] =1 if pointing device
62                                 [non-PS] reserved
63                     bit      1: =1 if math co-processor
64                     bit      0: =1 if diskette available for boot
65 */
66 /*  Currently the only of these bits correctly set are:
67                 bits 15-14              } Added by William Owen Smith,
68                 bits 11-9               } wos@dcs.warwick.ac.uk
69                 bits 7-6
70                 bit  2                  (always set)  ( bit 2 = 4 )
71                 bit  1                  } Robert 'Admiral' Coeyman
72                         All *nix systems either have a math processor or
73                                 emmulate one.
74 */
75
76     if (GetDriveTypeA("A:\\") == DRIVE_REMOVABLE) diskdrives++;
77     if (GetDriveTypeA("B:\\") == DRIVE_REMOVABLE) diskdrives++;
78     if (diskdrives) diskdrives--;
79
80     for (x=0; x < 9; x++)
81     {
82         WCHAR temp[16];
83         WCHAR comW[] = {'C','O','M','?',0};
84         WCHAR lptW[] = {'L','P','T','?',0};
85         static const WCHAR serialportsW[] = {'s','e','r','i','a','l','p','o','r','t','s',0};
86         static const WCHAR parallelportsW[] = {'p','a','r','a','l','l','e','l','p','o','r','t','s',0};
87         static const WCHAR asteriskW[] = {'*',0};
88
89         comW[3] = '0' + x;
90         PROFILE_GetWineIniString(serialportsW, comW, asteriskW, temp, 16);
91         if(strcmpW(temp, asteriskW))
92             serialports++;
93
94         lptW[3] = '0' + x;
95         PROFILE_GetWineIniString(parallelportsW, lptW, asteriskW, temp, 16);
96         if(strcmpW(temp, asteriskW))
97             parallelports++;
98     }
99     if (serialports > 7)                /* 3 bits -- maximum value = 7 */
100         serialports=7;
101     if (parallelports > 3)              /* 2 bits -- maximum value = 3 */
102         parallelports=3;
103
104     SET_AX( context, (diskdrives << 6) | (serialports << 9) | (parallelports << 14) | 0x06 );
105 }