[USB-BRINGUP-TRUNK]
[reactos.git] / drivers / setup / blue / blue.h
1 /*
2 * PROJECT: ReactOS Setup Driver
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: drivers/setup/blue/font.h
5 * PURPOSE: Loading specific fonts into VGA
6 * PROGRAMMERS: Aleksey Bragin (aleksey@reactos.org)
7 */
8
9 /* DEFINITIONS ***************************************************************/
10
11 #include <ntddk.h>
12
13 typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES;
14
15 // Define material that normally comes from PSDK
16 // This is mandatory to prevent any inclusion of
17 // user-mode stuff.
18 typedef struct tagCOORD {
19 SHORT X;
20 SHORT Y;
21 } COORD, *PCOORD;
22
23 typedef struct tagSMALL_RECT {
24 SHORT Left;
25 SHORT Top;
26 SHORT Right;
27 SHORT Bottom;
28 } SMALL_RECT;
29
30 typedef struct tagCONSOLE_SCREEN_BUFFER_INFO {
31 COORD dwSize;
32 COORD dwCursorPosition;
33 USHORT wAttributes;
34 SMALL_RECT srWindow;
35 COORD dwMaximumWindowSize;
36 } CONSOLE_SCREEN_BUFFER_INFO, *PCONSOLE_SCREEN_BUFFER_INFO;
37
38 typedef struct tagCONSOLE_CURSOR_INFO {
39 ULONG dwSize;
40 BOOLEAN bVisible;
41 } CONSOLE_CURSOR_INFO, *PCONSOLE_CURSOR_INFO;
42
43 #define ENABLE_PROCESSED_OUTPUT 0x0001
44 #define ENABLE_WRAP_AT_EOL_OUTPUT 0x0002
45
46 #include <blue/ntddblue.h>
47 #include <ndk/inbvfuncs.h>
48
49 #define TAG_BLUE 'EULB'
50
51 typedef struct _CFHEADER
52 {
53 ULONG Signature; // File signature 'MSCF' (CAB_SIGNATURE)
54 ULONG Reserved1; // Reserved field
55 ULONG CabinetSize; // Cabinet file size
56 ULONG Reserved2; // Reserved field
57 ULONG FileTableOffset; // Offset of first CFFILE
58 ULONG Reserved3; // Reserved field
59 USHORT Version; // Cabinet version (CAB_VERSION)
60 USHORT FolderCount; // Number of folders
61 USHORT FileCount; // Number of files
62 USHORT Flags; // Cabinet flags (CAB_FLAG_*)
63 USHORT SetID; // Cabinet set id
64 USHORT CabinetNumber; // Zero-based cabinet number
65 } CFHEADER, *PCFHEADER;
66
67 typedef struct _CFFILE
68 {
69 ULONG FileSize; // Uncompressed file size in bytes
70 ULONG FileOffset; // Uncompressed offset of file in the folder
71 USHORT FileControlID; // File control ID (CAB_FILE_*)
72 USHORT FileDate; // File date stamp, as used by DOS
73 USHORT FileTime; // File time stamp, as used by DOS
74 USHORT Attributes; // File attributes (CAB_ATTRIB_*)
75 /* After this is the NULL terminated filename */
76 } CFFILE, *PCFFILE;
77
78 #define CAB_SIGNATURE 0x4643534D // "MSCF"
79
80 #define VIDMEM_BASE 0xb8000
81 #define BITPLANE_BASE 0xa0000
82
83 #define CRTC_COMMAND ((PUCHAR)0x3d4)
84 #define CRTC_DATA ((PUCHAR)0x3d5)
85
86 #define CRTC_COLUMNS 0x01
87 #define CRTC_OVERFLOW 0x07
88 #define CRTC_ROWS 0x12
89 #define CRTC_SCANLINES 0x09
90 #define CRTC_CURSORSTART 0x0a
91 #define CRTC_CURSOREND 0x0b
92 #define CRTC_CURSORPOSHI 0x0e
93 #define CRTC_CURSORPOSLO 0x0f
94
95 #define SEQ_COMMAND ((PUCHAR)0x3c4)
96 #define SEQ_DATA ((PUCHAR)0x3c5)
97
98 #define GCT_COMMAND ((PUCHAR)0x3ce)
99 #define GCT_DATA ((PUCHAR)0x3cf)
100
101 /* SEQ regs numbers*/
102 #define SEQ_RESET 0x00
103 #define SEQ_ENABLE_WRT_PLANE 0x02
104 #define SEQ_MEM_MODE 0x04
105
106 /* GCT regs numbers */
107 #define GCT_READ_PLANE 0x04
108 #define GCT_RW_MODES 0x05
109 #define GCT_GRAPH_MODE 0x06
110
111 #define ATTRC_WRITEREG ((PUCHAR)0x3c0)
112 #define ATTRC_READREG ((PUCHAR)0x3c1)
113 #define ATTRC_INPST1 ((PUCHAR)0x3da)
114
115 #define TAB_WIDTH 8
116
117 #define MAX_PATH 260
118
119 #define MISC (PUCHAR)0x3c2
120 #define SEQ (PUCHAR)0x3c4
121 #define SEQDATA (PUCHAR)0x3c5
122 #define CRTC (PUCHAR)0x3d4
123 #define CRTCDATA (PUCHAR)0x3d5
124 #define GRAPHICS (PUCHAR)0x3ce
125 #define GRAPHICSDATA (PUCHAR)0x3cf
126 #define ATTRIB (PUCHAR)0x3c0
127 #define STATUS (PUCHAR)0x3da
128 #define PELMASK (PUCHAR)0x3c6
129 #define PELINDEX (PUCHAR)0x3c8
130 #define PELDATA (PUCHAR)0x3c9
131
132 void ScrLoadFontTable(UINT32 CodePage);
133 NTSTATUS ExtractFont(UINT32 CodePage, PUCHAR FontBitField);