ReactOS  0.4.14-dev-552-g2fad488
bootdata.c
Go to the documentation of this file.
1 #include "precomp.h"
2 
3 //
4 // Minimal Attribute Controller Registers initialization command stream.
5 // Compatible EGA.
6 //
8 {
9  /* Reset ATC to index mode */
10  IB,
11  VGA_BASE_IO_PORT + ATT_INITIALIZE_PORT_COLOR /* INPUT_STATUS_1_COLOR */,
12 
13  /* Write the AC registers */
15  VGA_BASE_IO_PORT + ATT_ADDRESS_PORT /* ATT_DATA_WRITE_PORT */,
16  16, 0, // Values Count and Start Index
17  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Palette indices 0-5
18  0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, // Palette indices 6-11
19  0x0C, 0x0D, 0x0E, 0x0F, // Palette indices 12-15
20 
21  /* Reset ATC to index mode */
22  IB,
23  VGA_BASE_IO_PORT + ATT_INITIALIZE_PORT_COLOR /* INPUT_STATUS_1_COLOR */,
24 
25  /* Enable screen and disable palette access */
26  OB,
27  VGA_BASE_IO_PORT + ATT_ADDRESS_PORT /* ATT_DATA_WRITE_PORT */,
29 
30  /* End of Stream */
31  EOD
32 };
33 
34 //
35 // 640x480 256-color 60Hz mode (BIOS mode 12) set command stream for VGA.
36 // Adapted from win32ss/drivers/miniport/vga_new/vgadata.c
37 //
39 {
40  /* Write the Sequencer Registers */
41  OWM,
43  VGA_NUM_SEQUENCER_PORTS, // Values Count (5)
44  // HI: Value in SEQ_DATA_PORT, LO: Register index in SEQ_ADDRESS_PORT
45  0x0100, // Synchronous reset on
46  0x0101, // 8-Dot Mode
47  0x0F02, // Memory Plane Write Enable on all planes 0-3
48  0x0003, // No character set selected
49  0x0604, // Disable Odd/Even host mem addressing; Enable Extended Memory
50 
51  /* Write the Miscellaneous Register */
52  OB,
54  0xE3, // V/H-SYNC polarity, Odd/Even High page select, RAM enable,
55  // I/O Address select (1: color/graphics adapter)
56 
57  /* Enable Graphics Mode */
58  OW,
60  // HI: Value in GRAPH_DATA_PORT, LO: Register index in GRAPH_ADDRESS_PORT
61  0x506, // Select A0000h-AFFFFh memory region, Disable Alphanumeric mode
62 
63  /* Synchronous reset off */
64  OW,
66  // HI: Value in SEQ_DATA_PORT, LO: Register index in SEQ_ADDRESS_PORT
67  0x0300, // Synchronous reset off (LO: IND_SYNC_RESET, HI: END_SYNC_RESET_VALUE)
68 
69  /* Unlock CRTC registers 0-7 */
70  OW,
72  0x511,
73 
74  /* Write the CRTC registers */
77  VGA_NUM_CRTC_PORTS, 0, // Values Count (25) and Start Index
78  0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00,
79  0x00, 0x00, 0x00, 0x00, 0xEA, 0x8C, 0xDF, 0x28, 0x00, 0xE7, 0x04, 0xE3,
80  0xFF,
81 
82  /* Reset ATC to index mode */
83  IB,
84  VGA_BASE_IO_PORT + ATT_INITIALIZE_PORT_COLOR /* INPUT_STATUS_1_COLOR */,
85 
86  /* Write the AC registers */
88  VGA_BASE_IO_PORT + ATT_ADDRESS_PORT /* ATT_DATA_WRITE_PORT */,
89  VGA_NUM_ATTRIB_CONT_PORTS, 0, // Values Count (21) and Start Index
90  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, // Palette indices 0-5
91  0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, // Palette indices 6-11
92  0x0C, 0x0D, 0x0E, 0x0F, // Palette indices 12-15
93  0x01, 0x00, 0x0F, 0x00, 0x00,
94 
95  /* Write the GC registers */
98  VGA_NUM_GRAPH_CONT_PORTS, 0, // Values Count (9) and Start Index
99  0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
100  0x05, 0x0F, 0xFF,
101 
102  /* Set the PEL mask */
103  OB,
105  0xFF,
106 
107  /* Reset ATC to index mode */
108  IB,
109  VGA_BASE_IO_PORT + ATT_INITIALIZE_PORT_COLOR /* INPUT_STATUS_1_COLOR */,
110 
111  /* Enable screen and disable palette access */
112  OB,
113  VGA_BASE_IO_PORT + ATT_ADDRESS_PORT /* ATT_DATA_WRITE_PORT */,
114  VIDEO_ENABLE,
115 
116  /* End of Stream */
117  EOD
118 };
#define METAOUT
Definition: cmdcnst.h:62
#define VGA_NUM_GRAPH_CONT_PORTS
Definition: vga.h:210
#define DAC_PIXEL_MASK_PORT
Definition: vga.h:71
#define VGA_NUM_ATTRIB_CONT_PORTS
Definition: vga.h:211
USHORT AT_Initialization[]
Definition: bootdata.c:7
#define MISC_OUTPUT_REG_WRITE_PORT
Definition: vga.h:63
#define VGA_BASE_IO_PORT
Definition: vga.h:38
#define ATT_ADDRESS_PORT
Definition: vga.h:57
#define CRTC_ADDRESS_PORT_COLOR
Definition: vga.h:84
#define VIDEO_ENABLE
Definition: vga.h:134
#define GRAPH_ADDRESS_PORT
Definition: vga.h:81
#define IB
Definition: cmdcnst.h:87
#define OW
Definition: cmdcnst.h:84
#define INDXOUT
Definition: cmdcnst.h:75
#define VGA_NUM_CRTC_PORTS
Definition: vga.h:209
#define SEQ_ADDRESS_PORT
Definition: vga.h:69
unsigned short USHORT
Definition: pedump.c:61
#define VGA_NUM_SEQUENCER_PORTS
Definition: vga.h:208
#define ATCOUT
Definition: cmdcnst.h:76
#define OWM
Definition: cmdcnst.h:85
#define EOD
Definition: cmdcnst.h:60
#define OB
Definition: cmdcnst.h:82
USHORT VGA_640x480[]
Definition: bootdata.c:38
#define ATT_INITIALIZE_PORT_COLOR
Definition: vga.h:90