ReactOS  0.4.13-dev-563-g0561610
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 
23 static 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 
56 static VOID FASTCALL
58 {
59  UCHAR i;
60 
61  /* Update misc output register */
62  VideoPortWritePortUchar(MISC, Registers->Misc);
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  {
87  VideoPortWritePortUchar(CRTCDATA, Registers->CRT[i]);
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 
109 VOID
111 {
114 }
115 
116 VOID
118 {
120 }
#define CRTCDATA
Definition: blue.h:124
#define GRAPHICSDATA
Definition: blue.h:126
UCHAR Sequencer[5]
Definition: blue.c:51
static VGA_REGISTERS Mode12Regs
Definition: initvga.c:5
VGA_REGISTERS TextModeRegs
Definition: initvga.c:21
#define ATTRIB
Definition: blue.h:127
#define MISC
Definition: blue.h:120
#define FASTCALL
Definition: nt_native.h:50
VOID InitVGAMode(VOID)
Definition: initvga.c:110
static VOID FASTCALL vgaSaveRegisters(PVGA_REGISTERS Registers)
Definition: initvga.c:24
VPAPI UCHAR NTAPI VideoPortReadPortUchar(IN PUCHAR Port)
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
UCHAR Misc
Definition: blue.c:52
UCHAR Graphics[9]
Definition: blue.c:50
#define SEQ
Definition: blue.h:121
#define STATUS
Definition: blue.h:128
VOID VGAResetDevice(OUT PSTATUS_BLOCK StatusBlock)
Definition: initvga.c:117
UCHAR CRT[24]
Definition: blue.c:48
unsigned char UCHAR
Definition: xmlstorage.h:181
UCHAR Attribute[21]
Definition: blue.c:49
#define CRTC
Definition: blue.h:123
#define SEQDATA
Definition: blue.h:122
#define GRAPHICS
Definition: blue.h:125
#define OUT
Definition: typedefs.h:39
#define ATTRIBREAD
Definition: vgavideo.h:16
VPAPI VOID NTAPI VideoPortWritePortUchar(IN PUCHAR Port, IN UCHAR Value)
static VOID FASTCALL vgaSetRegisters(PVGA_REGISTERS Registers)
Definition: initvga.c:57