adding winetest from the vendor drop for usp10.dll
[reactos.git] / reactos / drivers / base / bootvid / vid.c
1 /*
2 * ReactOS Boot video driver
3 *
4 * Copyright (C) 2005 Filip Navara
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program 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
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20
21 /* INCLUDES ******************************************************************/
22
23 #include "bootvid.h"
24 #define NDEBUG
25 #include <debug.h>
26
27 /* GLOBALS *******************************************************************/
28
29 static PVID_FUNCTION_TABLE VidTable;
30 extern VID_FUNCTION_TABLE VidVgaTable;
31 extern VID_FUNCTION_TABLE VidVgaTextTable;
32 extern VID_FUNCTION_TABLE VidXboxTable;
33
34 /* FUNCTIONS *****************************************************************/
35
36 BOOLEAN NTAPI
37 VidInitialize(
38 IN BOOLEAN SetMode)
39 {
40 ULONG PciId;
41
42 /*
43 * Check for Xbox by identifying device at PCI 0:0:0, if it's
44 * 0x10de/0x02a5 then we're running on an Xbox.
45 */
46 CHECKPOINT;
47 WRITE_PORT_ULONG((PULONG)0xcf8, 0x80000000);
48 PciId = READ_PORT_ULONG((PULONG)0xcfc);
49 if (0x02a510de == PciId)
50 VidTable = &VidXboxTable;
51 else if (SetMode)
52 VidTable = &VidVgaTable;
53 else
54 VidTable = &VidVgaTextTable;
55 return VidTable->Initialize(SetMode);
56 }
57
58 VOID STDCALL
59 VidResetDisplay(VOID)
60 {
61 VidTable->ResetDisplay();
62 }
63
64 VOID NTAPI
65 VidCleanUp(VOID)
66 {
67 VidTable->CleanUp();
68 }
69
70 VOID NTAPI
71 VidBufferToScreenBlt(
72 IN PUCHAR Buffer,
73 IN ULONG Left,
74 IN ULONG Top,
75 IN ULONG Width,
76 IN ULONG Height,
77 IN ULONG Delta)
78 {
79 VidTable->BufferToScreenBlt(Buffer, Left, Top, Width, Height, Delta);
80 }
81
82 VOID NTAPI
83 VidScreenToBufferBlt(
84 OUT PUCHAR Buffer,
85 IN ULONG Left,
86 IN ULONG Top,
87 IN ULONG Width,
88 IN ULONG Height,
89 IN ULONG Delta)
90 {
91 VidTable->ScreenToBufferBlt(Buffer, Left, Top, Width, Height, Delta);
92 }
93
94 VOID NTAPI
95 VidBitBlt(
96 IN PUCHAR Buffer,
97 IN ULONG Left,
98 IN ULONG Top)
99 {
100 VidTable->BitBlt(Buffer, Left, Top);
101 }
102
103 VOID NTAPI
104 VidSolidColorFill(
105 IN ULONG Left,
106 IN ULONG Top,
107 IN ULONG Right,
108 IN ULONG Bottom,
109 IN ULONG Color)
110 {
111 VidTable->SolidColorFill(Left, Top, Right, Bottom, Color);
112 }
113
114 VOID NTAPI
115 VidDisplayString(
116 IN PCSTR String)
117 {
118 VidTable->DisplayString(String);
119 }