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