summaryrefslogtreecommitdiffstats
path: root/private/ntos/nthals/halppc/ppc/pxvgaequ.h
blob: b8dfc9f141c87ddb079a2008838bdb881b11f407 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/*++

Copyright (c) 1995  International Business Machines Corporation

Module Name:

pxdisp.c

Abstract:

    This file contains all the VGA-specific definitions.  This
    is meant to be included by all modules that implement
    VGA support in the HAL.  At this time, that includes pxs3.c
    and pxwd.c.  It does not include pxp91.c or pxbbl.c because
    these video devices don't map VGA registers.

Author:

    Jake Oshins

Environment:

    Kernel mode

Revision History:

--*/




//VGA definitions

extern UCHAR DAC_Table[];
extern UCHAR DAC_Color[];
extern UCHAR VideoParam[];
extern UCHAR VGAFont8x16[];
extern UCHAR TextPalette[];

#define    TAB_SIZE            4


#define VERTICALRESOLUTION      768
#define HORIZONTALRESOLUTION    1024
#define OriginalPoint   0
#define BLUE 192
#define WHITE 255
#define CRT_OFFSET 2
#define SEQ_OFFSET 27
#define GRAPH_OFFSET 32
#define ATTR_OFFSET 41


//
// Define CRTC, VGA S3, SYS_CTRL Index : ( Out 3D4, Index )
//
// Define CRTC Controller Indexes
//

#define HORIZONTAL_TOTAL                    0
#define HORIZONTAL_DISPLAY_END              1
#define START_HORIZONTAL_BLANK              2
#define END_HORIZONTAL_BLANK                3
#define HORIZONTAL_SYNC_POS                 4
#define END_HORIZONTAL_SYNC                 5
#define VERTICAL_TOTAL                      6
#define CRTC_OVERFLOW                       7
#define PRESET_ROW_SCAN                     8
#define MAX_SCAN_LINE                       9
#define CURSOR_START                       10
#define CURSOR_END                         11
#define START_ADDRESS_HIGH                 12
#define START_ADDRESS_LOW                  13
#define CURSOR_LOCATION_HIGH               14
#define CURSOR_FCOLOR                      14
#define CURSOR_BCOLOR                      15
#define CURSOR_LOCATION_LOW                15
#define VERTICAL_RETRACE_START             16
#define VERTICAL_RETRACE_END               17
#define VERTICAL_DISPLAY_END               18
#define OFFSET_SCREEN_WIDTH                19
#define UNDERLINE_LOCATION                 20
#define START_VERTICAL_BLANK               21
#define END_VERTICAL_BLANK                 22
#define CRT_MODE_CONTROL                   23
#define LINE_COMPARE                       24
#define CPU_LATCH_DATA                     34
#define ATTRIBUTE_INDEX1                   36
#define ATTRIBUTE_INDEX2                   38

//
// Define VGA I/O address
//
#define     PORT_GEN_MISC_RD                0x03cc                      // GEN - MISC (Read port)
#define     PORT_GEN_MISC_WR                0x03c2                      //            (Write port)
#define     PORT_GEN_ISR0                   0x03c2                      // GEN - ISR0
#define     PORT_GEN_ISR1_M                 0x03ba                      // GEN - ISR1 (for Mono)
#define     PORT_GEN_ISR1_C                 0x03da                      //            (for Color)
#define     PORT_GEN_FEATURE_RD             0x03ca                      // GEN - FEARTURE (Read port for both)
#define     PORT_GEN_FEATURE_WR_M           0x03ba                      //                (Write port for Mono)
#define     PORT_GEN_FEATURE_WR_C           0x03da                      //                (Write port for Color)

#define     PORT_SEQ_INDEX                  0x03c4                      // SEQ - INDEX
#define     PORT_SEQ_DATA                   0x03c5                      // SEQ - DATA

#define     PORT_CRTC_INDEX_M               0x03b4                      // CRTC - INDEX (for Mono)
#define     PORT_CRTC_INDEX_C               0x03d4                      //              (for Color)
#define     PORT_CRTC_DATA_M                0x03b5                      // CRTC - DATA (for Mono)
#define     PORT_CRTC_DATA_C                0x03d5                      //             (for Color)

#define     PORT_GCR_INDEX                  0x03ce                      // GCR - INDEX
#define     PORT_GCR_DATA                   0x03cf                      // GCR - DATA

#define     PORT_ATTR_INDEX                 0x03c0                      // ATTR - INDEX
#define     PORT_ATTR_DATA_RD               0x03c1                      // ATTR - DATA (Read port)
#define     PORT_ATTR_DATA_WR               0x03c0                      //             (Write port)

#define     PORT_DAC_PIX_MASK               0x03c6                      //
#define     PORT_DAC_STATE                  0x03c7                      //
#define     PORT_DAC_READ_PIX_ADDR          0x03c7                      // (Write only port) - take care !
#define     PORT_DAC_WRITE_PIX_ADDR         0x03c8                      // (Read/Write port)
#define     PORT_DAC_DATA                   0x03c9                      // DAC - DATA port

#define     PORT_SYS_VGA_ENABLE             0x03c3                      // SYS - VGA Enable/Disable
#define     PORT_SYS_VIDEO_SUBSYSTEM        0x46e8                      // SYS - Video Subsystem Enable/Disable

//
// Define Sequencer Indexes  ( out 3C4, Index)
//

#define  RESET                 0
#define  CLOCKING_MODE         1
#define  ENABLE_WRITE_PLANE    2
#define  CHARACTER_FONT_SELECT 3
#define  MEMORY_MODE_CONTROL   4

//
//  Misc. registers
//
#define Setup_OP             0x102         // R/W