ReactOS  0.4.14-dev-115-g4576127
initvga.c File Reference
#include "vgamp.h"
#include "vgavideo.h"
Include dependency graph for initvga.c:

Go to the source code of this file.

Functions

static VOID FASTCALL vgaSaveRegisters (PVGA_REGISTERS Registers)
 
static VOID FASTCALL vgaSetRegisters (PVGA_REGISTERS Registers)
 
VOID InitVGAMode (VOID)
 
VOID VGAResetDevice (OUT PSTATUS_BLOCK StatusBlock)
 

Variables

static VGA_REGISTERS Mode12Regs
 
VGA_REGISTERS TextModeRegs
 

Function Documentation

◆ InitVGAMode()

VOID InitVGAMode ( VOID  )

Definition at line 110 of file initvga.c.

111 {
114 }
static VGA_REGISTERS Mode12Regs
Definition: initvga.c:5
VGA_REGISTERS TextModeRegs
Definition: initvga.c:21
static VOID FASTCALL vgaSaveRegisters(PVGA_REGISTERS Registers)
Definition: initvga.c:24
static VOID FASTCALL vgaSetRegisters(PVGA_REGISTERS Registers)
Definition: initvga.c:57

Referenced by VGASetCurrentMode().

◆ VGAResetDevice()

VOID VGAResetDevice ( OUT PSTATUS_BLOCK  StatusBlock)

Definition at line 117 of file initvga.c.

118 {
120 }
VGA_REGISTERS TextModeRegs
Definition: initvga.c:21
static VOID FASTCALL vgaSetRegisters(PVGA_REGISTERS Registers)
Definition: initvga.c:57

Referenced by VGAStartIO().

◆ vgaSaveRegisters()

static VOID FASTCALL vgaSaveRegisters ( PVGA_REGISTERS  Registers)
static

Definition at line 24 of file initvga.c.

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 }
#define CRTCDATA
Definition: blue.h:124
#define GRAPHICSDATA
Definition: blue.h:126
UCHAR Sequencer[5]
Definition: blue.c:51
#define ATTRIB
Definition: blue.h:127
#define MISC
Definition: blue.h:120
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
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 ATTRIBREAD
Definition: vgavideo.h:16
VPAPI VOID NTAPI VideoPortWritePortUchar(IN PUCHAR Port, IN UCHAR Value)

Referenced by InitVGAMode().

◆ vgaSetRegisters()

static VOID FASTCALL vgaSetRegisters ( PVGA_REGISTERS  Registers)
static

Definition at line 57 of file initvga.c.

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 }
#define CRTCDATA
Definition: blue.h:124
#define GRAPHICSDATA
Definition: blue.h:126
UCHAR Sequencer[5]
Definition: blue.c:51
#define ATTRIB
Definition: blue.h:127
#define MISC
Definition: blue.h:120
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
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
VPAPI VOID NTAPI VideoPortWritePortUchar(IN PUCHAR Port, IN UCHAR Value)

Referenced by InitVGAMode(), and VGAResetDevice().

Variable Documentation

◆ Mode12Regs

VGA_REGISTERS Mode12Regs
static
Initial value:
=
{
{0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0x0B, 0x3E, 0x00, 0x40, 0x00, 0x00,
0x00, 0x00, 0x00, 0x59, 0xEA, 0x8C, 0xDF, 0x28, 0x00, 0xE7, 0x04, 0xE3},
{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
0x0C, 0x0D, 0x0E, 0x0F, 0x81, 0x00, 0x0F, 0x00, 0x00},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x05, 0x0F, 0xFF},
{0x03, 0x01, 0x0F, 0x00, 0x06},
0xE3
}

Definition at line 5 of file initvga.c.

Referenced by InitVGAMode().

◆ TextModeRegs

VGA_REGISTERS TextModeRegs

Definition at line 21 of file initvga.c.

Referenced by InitVGAMode(), and VGAResetDevice().