ReactOS 0.4.17-dev-1344-g1103f43
pc.h File Reference
#include "vga.h"
Include dependency graph for pc.h:

Go to the source code of this file.

Macros

#define __inpb(Port)    READ_PORT_UCHAR((PUCHAR)(VgaRegisterBase + (Port)))
 
#define __inpw(Port)    READ_PORT_USHORT((PUSHORT)(VgaRegisterBase + (Port)))
 
#define __outpb(Port, Value)    WRITE_PORT_UCHAR((PUCHAR)(VgaRegisterBase + (Port)), (UCHAR)(Value))
 
#define __outpw(Port, Value)    WRITE_PORT_USHORT((PUSHORT)(VgaRegisterBase + (Port)), (USHORT)(Value))
 

Enumerations

enum  VGA_GRAPHICS_CONTROLLER_STATE { VGA_GC_STATE_UNINITIALIZED , VGA_GC_STATE_READ_PIXELS , VGA_GC_STATE_WRITE_PIXELS , VGA_GC_STATE_COPY_PIXELS }
 

Functions

VOID InitPaletteWithTable (_In_reads_(Count) const ULONG *Table, _In_ ULONG Count)
 
VOID PrepareForSetPixel (VOID)
 
FORCEINLINE VOID SetPixel (_In_ ULONG Left, _In_ ULONG Top, _In_ UCHAR Color)
 

Variables

VGA_GRAPHICS_CONTROLLER_STATE VgaGCState
 
ULONG_PTR VgaRegisterBase
 
ULONG_PTR VgaBase
 
const USHORT AT_Initialization []
 
const USHORT VGA_640x480 []
 
const UCHAR PixelMask [8]
 

Macro Definition Documentation

◆ __inpb

#define __inpb (   Port)     READ_PORT_UCHAR((PUCHAR)(VgaRegisterBase + (Port)))

Definition at line 27 of file pc.h.

◆ __inpw

#define __inpw (   Port)     READ_PORT_USHORT((PUSHORT)(VgaRegisterBase + (Port)))

Definition at line 30 of file pc.h.

◆ __outpb

#define __outpb (   Port,
  Value 
)     WRITE_PORT_UCHAR((PUCHAR)(VgaRegisterBase + (Port)), (UCHAR)(Value))

Definition at line 33 of file pc.h.

◆ __outpw

#define __outpw (   Port,
  Value 
)     WRITE_PORT_USHORT((PUSHORT)(VgaRegisterBase + (Port)), (USHORT)(Value))

Definition at line 36 of file pc.h.

Enumeration Type Documentation

◆ VGA_GRAPHICS_CONTROLLER_STATE

Enumerator
VGA_GC_STATE_UNINITIALIZED 
VGA_GC_STATE_READ_PIXELS 
VGA_GC_STATE_WRITE_PIXELS 
VGA_GC_STATE_COPY_PIXELS 

Definition at line 12 of file pc.h.

13{
VGA_GRAPHICS_CONTROLLER_STATE
Definition: pc.h:13
@ VGA_GC_STATE_UNINITIALIZED
Definition: pc.h:14
@ VGA_GC_STATE_COPY_PIXELS
Definition: pc.h:17
@ VGA_GC_STATE_READ_PIXELS
Definition: pc.h:15
@ VGA_GC_STATE_WRITE_PIXELS
Definition: pc.h:16

Function Documentation

◆ InitPaletteWithTable()

VOID InitPaletteWithTable ( _In_reads_(Count) const ULONG *  Table,
_In_ ULONG  Count 
)

Definition at line 220 of file bootvid.c.

223{
225}
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15

◆ PrepareForSetPixel()

VOID PrepareForSetPixel ( VOID  )

Definition at line 116 of file vga.c.

117{
119 return;
121
122 /* Select read mode 1 and write mode 2 */
123 ReadWriteMode(0xA);
124
125 /* Enable all memory planes */
127
128 /* Clear the color don't care register, so read mode 1 reads always return 0xFF */
130}
static VOID ReadWriteMode(_In_ UCHAR Mode)
Definition: vga.c:75
VGA_GRAPHICS_CONTROLLER_STATE VgaGCState
Definition: vga.c:68
#define SEQ_ADDRESS_PORT
Definition: vga.h:69
#define GRAPH_ADDRESS_PORT
Definition: vga.h:81
#define IND_MAP_MASK
Definition: vga.h:116
#define VGA_BASE_IO_PORT
Definition: vga.h:38
#define __outpw(Port, Value)
Definition: pc.h:36

◆ SetPixel()

FORCEINLINE VOID SetPixel ( _In_ ULONG  Left,
_In_ ULONG  Top,
_In_ UCHAR  Color 
)

Definition at line 49 of file pc.h.

53{
54 PUCHAR PixelPosition;
55
56 /* Calculate the pixel position */
57 PixelPosition = (PUCHAR)(VgaBase + (Left >> 3) + (Top * (SCREEN_WIDTH / 8)));
58
59 /* Select the bitmask register and write the mask */
61
62 /* Dummy read to load latch registers */
63 (VOID)READ_REGISTER_UCHAR(PixelPosition);
64
65 /* Set the new color */
66 WRITE_REGISTER_UCHAR(PixelPosition, Color);
67}
#define VOID
Definition: acefi.h:82
static LPHIST_ENTRY Top
Definition: history.c:53
#define IND_BIT_MASK
Definition: vga.h:114
#define SCREEN_WIDTH
Definition: pc98video.c:24
ULONG_PTR VgaBase
Definition: vga.c:70
const UCHAR PixelMask[8]
Definition: vga.c:37
unsigned char * PUCHAR
Definition: typedefs.h:53
NTKERNELAPI VOID NTAPI WRITE_REGISTER_UCHAR(IN PUCHAR Register, IN UCHAR Value)
NTKERNELAPI UCHAR NTAPI READ_REGISTER_UCHAR(IN PUCHAR Register)

Variable Documentation

◆ AT_Initialization

const USHORT AT_Initialization[]
extern

Definition at line 16 of file bootdata.c.

Referenced by ResetDisplay(), and VidInitialize().

◆ PixelMask

const UCHAR PixelMask[8]
extern

Definition at line 37 of file vga.c.

Referenced by DisplayCharacter(), and SetPixel().

◆ VGA_640x480

const USHORT VGA_640x480[]
extern

Definition at line 47 of file bootdata.c.

Referenced by ResetDisplay(), and VidInitialize().

◆ VgaBase

◆ VgaGCState

◆ VgaRegisterBase

ULONG_PTR VgaRegisterBase
extern

Definition at line 69 of file vga.c.

Referenced by VgaInterpretCmdStream(), and VidInitialize().