- Check that all pins have been closed when the last filter reference is gone
[reactos.git] / reactos / 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 <string.h>
12 #include <stdio.h>
13 #include <stdlib.h>
14
15 #ifndef TAG
16 #define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
17 #endif
18
19 #define TAG_BLUE TAG('B', 'L', 'U', 'E')
20
21 typedef struct _CFHEADER
22 {
23 ULONG Signature; // File signature 'MSCF' (CAB_SIGNATURE)
24 ULONG Reserved1; // Reserved field
25 ULONG CabinetSize; // Cabinet file size
26 ULONG Reserved2; // Reserved field
27 ULONG FileTableOffset; // Offset of first CFFILE
28 ULONG Reserved3; // Reserved field
29 USHORT Version; // Cabinet version (CAB_VERSION)
30 USHORT FolderCount; // Number of folders
31 USHORT FileCount; // Number of files
32 USHORT Flags; // Cabinet flags (CAB_FLAG_*)
33 USHORT SetID; // Cabinet set id
34 USHORT CabinetNumber; // Zero-based cabinet number
35 } CFHEADER, *PCFHEADER;
36
37 typedef struct _CFFILE
38 {
39 ULONG FileSize; // Uncompressed file size in bytes
40 ULONG FileOffset; // Uncompressed offset of file in the folder
41 USHORT FileControlID; // File control ID (CAB_FILE_*)
42 USHORT FileDate; // File date stamp, as used by DOS
43 USHORT FileTime; // File time stamp, as used by DOS
44 USHORT Attributes; // File attributes (CAB_ATTRIB_*)
45 /* After this is the NULL terminated filename */
46 } CFFILE, *PCFFILE;
47
48 #define CAB_SIGNATURE 0x4643534D // "MSCF"
49
50 #define VIDMEM_BASE 0xb8000
51 #define BITPLANE_BASE 0xa0000
52
53 #define CRTC_COMMAND ((PUCHAR)0x3d4)
54 #define CRTC_DATA ((PUCHAR)0x3d5)
55
56 #define CRTC_COLUMNS 0x01
57 #define CRTC_OVERFLOW 0x07
58 #define CRTC_ROWS 0x12
59 #define CRTC_SCANLINES 0x09
60 #define CRTC_CURSORSTART 0x0a
61 #define CRTC_CURSOREND 0x0b
62 #define CRTC_CURSORPOSHI 0x0e
63 #define CRTC_CURSORPOSLO 0x0f
64
65 #define SEQ_COMMAND ((PUCHAR)0x3c4)
66 #define SEQ_DATA ((PUCHAR)0x3c5)
67
68 #define GCT_COMMAND ((PUCHAR)0x3ce)
69 #define GCT_DATA ((PUCHAR)0x3cf)
70
71 /* SEQ regs numbers*/
72 #define SEQ_RESET 0x00
73 #define SEQ_ENABLE_WRT_PLANE 0x02
74 #define SEQ_MEM_MODE 0x04
75
76 /* GCT regs numbers */
77 #define GCT_READ_PLANE 0x04
78 #define GCT_RW_MODES 0x05
79 #define GCT_GRAPH_MODE 0x06
80
81 #define ATTRC_WRITEREG ((PUCHAR)0x3c0)
82 #define ATTRC_READREG ((PUCHAR)0x3c1)
83 #define ATTRC_INPST1 ((PUCHAR)0x3da)
84
85 #define TAB_WIDTH 8
86
87 #define MISC (PUCHAR)0x3c2
88 #define SEQ (PUCHAR)0x3c4
89 #define SEQDATA (PUCHAR)0x3c5
90 #define CRTC (PUCHAR)0x3d4
91 #define CRTCDATA (PUCHAR)0x3d5
92 #define GRAPHICS (PUCHAR)0x3ce
93 #define GRAPHICSDATA (PUCHAR)0x3cf
94 #define ATTRIB (PUCHAR)0x3c0
95 #define STATUS (PUCHAR)0x3da
96 #define PELMASK (PUCHAR)0x3c6
97 #define PELINDEX (PUCHAR)0x3c8
98 #define PELDATA (PUCHAR)0x3c9
99
100 void ScrLoadFontTable(UINT32 CodePage);
101 NTSTATUS ExtractFont(UINT32 CodePage, PUCHAR FontBitField);