Removed trailing whitespace.
[wine] / dlls / winedos / ioports.c
1 /*
2  * Emulation of processor ioports.
3  *
4  * Copyright 1995 Morten Welinder
5  * Copyright 1998 Andreas Mohr, Ove Kaaven
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  */
21
22 #include "config.h"
23
24 #include "windef.h"
25 #include "dosexe.h"
26 #include "vga.h"
27
28
29 /**********************************************************************
30  *          DOSVM_inport
31  */
32 BOOL WINAPI DOSVM_inport( int port, int size, DWORD *res )
33 {
34     switch (port)
35     {
36     case 0x60:
37         *res = DOSVM_Int09ReadScan(NULL);
38         break;
39     case 0x22a:
40     case 0x22c:
41     case 0x22e:
42         *res = (DWORD)SB_ioport_in( port );
43         break;
44     case 0x3ba:
45     case 0x3da:
46         *res = (DWORD)VGA_ioport_in( port );
47         break;
48     case 0x00:
49     case 0x01:
50     case 0x02:
51     case 0x03:
52     case 0x04:
53     case 0x05:
54     case 0x06:
55     case 0x07:
56     case 0xC0:
57     case 0xC2:
58     case 0xC4:
59     case 0xC6:
60     case 0xC8:
61     case 0xCA:
62     case 0xCC:
63     case 0xCE:
64     case 0x87:
65     case 0x83:
66     case 0x81:
67     case 0x82:
68     case 0x8B:
69     case 0x89:
70     case 0x8A:
71     case 0x487:
72     case 0x483:
73     case 0x481:
74     case 0x482:
75     case 0x48B:
76     case 0x489:
77     case 0x48A:
78     case 0x08:
79     case 0xD0:
80     case 0x0D:
81     case 0xDA:
82         *res = (DWORD)DMA_ioport_in( port );
83         break;
84     default:
85         return FALSE;  /* not handled */
86     }
87     return TRUE;  /* handled */
88 }
89
90
91 /**********************************************************************
92  *          DOSVM_outport
93  */
94 BOOL WINAPI DOSVM_outport( int port, int size, DWORD value )
95 {
96     switch (port)
97     {
98     case 0x20:
99         DOSVM_PIC_ioport_out( port, (BYTE)value );
100         break;
101     case 0x226:
102     case 0x22c:
103         SB_ioport_out( port, (BYTE)value );
104         break;
105     case 0x3c8:
106     case 0x3c9:
107         VGA_ioport_out( port, (BYTE)value );
108         break;
109     case 0x00:
110     case 0x01:
111     case 0x02:
112     case 0x03:
113     case 0x04:
114     case 0x05:
115     case 0x06:
116     case 0x07:
117     case 0xC0:
118     case 0xC2:
119     case 0xC4:
120     case 0xC6:
121     case 0xC8:
122     case 0xCA:
123     case 0xCC:
124     case 0xCE:
125     case 0x87:
126     case 0x83:
127     case 0x81:
128     case 0x82:
129     case 0x8B:
130     case 0x89:
131     case 0x8A:
132     case 0x487:
133     case 0x483:
134     case 0x481:
135     case 0x482:
136     case 0x48B:
137     case 0x489:
138     case 0x48A:
139     case 0x08:
140     case 0xD0:
141     case 0x0B:
142     case 0xD6:
143     case 0x0A:
144     case 0xD4:
145     case 0x0F:
146     case 0xDE:
147     case 0x09:
148     case 0xD2:
149     case 0x0C:
150     case 0xD8:
151     case 0x0D:
152     case 0xDA:
153     case 0x0E:
154     case 0xDC:
155         DMA_ioport_out( port, (BYTE)value );
156         break;
157     default:
158         return FALSE;  /* not handled */
159     }
160     return TRUE;  /* handled */
161 }