ReactOS 0.4.15-dev-7907-g95bf896
initvga.c
Go to the documentation of this file.
1#include "vgamp.h"
2
3#include "vgavideo.h"
4
6{
7 /* CRT Controller Registers */
8 {0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00,
9 0x00, 0x00, 0x00, 0x59, 0xEA, 0x8C, 0xDF, 0x28, 0x00, 0xE7, 0x04, 0xE3},
10 /* Attribute Controller Registers */
11 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
12 0x0C, 0x0D, 0x0E, 0x0F, 0x81, 0x00, 0x0F, 0x00, 0x00},
13 /* Graphics Controller Registers */
14 {0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x05, 0x0F, 0xFF},
15 /* Sequencer Registers */
16 {0x03, 0x01, 0x0F, 0x00, 0x06},
17 /* Misc Output Register */
18 0xE3
19};
20
22
23static VOID FASTCALL
25{
26 UCHAR i;
27
28 for (i = 0; i < sizeof(Registers->CRT); i++)
29 {
31 Registers->CRT[i] = VideoPortReadPortUchar(CRTCDATA);
32 }
33
34 for (i = 0; i < sizeof(Registers->Attribute); i++)
35 {
39 }
40
41 for (i = 0; i < sizeof(Registers->Graphics); i++)
42 {
45 }
46
47 for (i = 0; i < sizeof(Registers->Sequencer); i++)
48 {
51 }
52
53 Registers->Misc = VideoPortReadPortUchar(MISC);
54}
55
56static VOID FASTCALL
58{
59 UCHAR i;
60
61 /* Update misc output register */
63
64 /* Synchronous reset on */
67
68 /* Write sequencer registers */
69 for (i = 1; i < sizeof(Registers->Sequencer); i++)
70 {
73 }
74
75 /* Synchronous reset off */
78
79 /* Deprotect CRT registers 0-7 */
81 VideoPortWritePortUchar(CRTCDATA, Registers->CRT[0x11] & 0x7f);
82
83 /* Write CRT registers */
84 for (i = 0; i < sizeof(Registers->CRT); i++)
85 {
88 }
89
90 /* Write graphics controller registers */
91 for (i = 0; i < sizeof(Registers->Graphics); i++)
92 {
95 }
96
97 /* Write attribute controller registers */
98 for (i = 0; i < sizeof(Registers->Attribute); i++)
99 {
103 }
104
105 /* Renable screen. */
107}
108
109VOID
111{
114}
115
116VOID
118{
120}
#define SEQDATA
Definition: blue.h:110
#define GRAPHICSDATA
Definition: blue.h:114
#define GRAPHICS
Definition: blue.h:113
#define STATUS
Definition: blue.h:116
#define CRTC
Definition: blue.h:111
#define ATTRIB
Definition: blue.h:115
#define SEQ
Definition: blue.h:109
#define CRTCDATA
Definition: blue.h:112
#define MISC
Definition: blue.h:108
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
VGA_REGISTERS TextModeRegs
Definition: initvga.c:21
static VOID FASTCALL vgaSaveRegisters(PVGA_REGISTERS Registers)
Definition: initvga.c:24
VOID InitVGAMode(VOID)
Definition: initvga.c:110
static VGA_REGISTERS Mode12Regs
Definition: initvga.c:5
VOID VGAResetDevice(OUT PSTATUS_BLOCK StatusBlock)
Definition: initvga.c:117
static VOID FASTCALL vgaSetRegisters(PVGA_REGISTERS Registers)
Definition: initvga.c:57
#define ATTRIBREAD
Definition: vgavideo.h:16
#define FASTCALL
Definition: nt_native.h:50
VPAPI UCHAR NTAPI VideoPortReadPortUchar(IN PUCHAR Port)
VPAPI VOID NTAPI VideoPortWritePortUchar(IN PUCHAR Port, IN UCHAR Value)
UCHAR CRT[24]
Definition: blue.c:46
UCHAR Attribute[21]
Definition: blue.c:47
UCHAR Sequencer[5]
Definition: blue.c:49
UCHAR Misc
Definition: blue.c:50
UCHAR Graphics[9]
Definition: blue.c:48
#define OUT
Definition: typedefs.h:40
unsigned char UCHAR
Definition: xmlstorage.h:181