ReactOS 0.4.16-dev-2104-gb84fa49
pc.h
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: VGA definitions
5 * COPYRIGHT: Copyright 2007 Alex Ionescu <alex.ionescu@reactos.org>
6 */
7
8#pragma once
9
10#include "vga.h"
11
13extern ULONG_PTR VgaBase;
14extern const USHORT AT_Initialization[];
15extern const USHORT VGA_640x480[];
16extern const UCHAR PixelMask[8];
17
18#define __inpb(Port) \
19 READ_PORT_UCHAR((PUCHAR)(VgaRegisterBase + (Port)))
20
21#define __inpw(Port) \
22 READ_PORT_USHORT((PUSHORT)(VgaRegisterBase + (Port)))
23
24#define __outpb(Port, Value) \
25 WRITE_PORT_UCHAR((PUCHAR)(VgaRegisterBase + (Port)), (UCHAR)(Value))
26
27#define __outpw(Port, Value) \
28 WRITE_PORT_USHORT((PUSHORT)(VgaRegisterBase + (Port)), (USHORT)(Value))
29
30VOID
34
35VOID
37
39VOID
41 _In_ ULONG Left,
44{
45 PUCHAR PixelPosition;
46
47 /* Calculate the pixel position */
48 PixelPosition = (PUCHAR)(VgaBase + (Left >> 3) + (Top * (SCREEN_WIDTH / 8)));
49
50 /* Select the bitmask register and write the mask */
52
53 /* Dummy read to load latch registers */
54 (VOID)READ_REGISTER_UCHAR(PixelPosition);
55
56 /* Set the new color */
57 WRITE_REGISTER_UCHAR(PixelPosition, Color);
58}
#define VOID
Definition: acefi.h:82
#define PrepareForSetPixel()
Definition: arm.h:21
static LPHIST_ENTRY Top
Definition: history.c:53
#define GRAPH_ADDRESS_PORT
Definition: vga.h:81
#define IND_BIT_MASK
Definition: vga.h:114
#define VGA_BASE_IO_PORT
Definition: vga.h:38
ASMGENDATA Table[]
Definition: genincdata.c:61
#define _In_reads_(s)
Definition: no_sal2.h:168
#define _In_
Definition: no_sal2.h:158
int Count
Definition: noreturn.cpp:7
#define SCREEN_WIDTH
Definition: pc98video.c:24
ULONG_PTR VgaRegisterBase
Definition: vga.c:68
#define __outpw(Port, Value)
Definition: pc.h:27
const USHORT VGA_640x480[]
Definition: bootdata.c:47
const USHORT AT_Initialization[]
Definition: bootdata.c:16
ULONG_PTR VgaBase
Definition: vga.c:69
FORCEINLINE VOID SetPixel(_In_ ULONG Left, _In_ ULONG Top, _In_ UCHAR Color)
Definition: pc.h:40
VOID InitPaletteWithTable(_In_reads_(Count) const ULONG *Table, _In_ ULONG Count)
Definition: bootvid.c:220
const UCHAR PixelMask[8]
Definition: vga.c:37
unsigned short USHORT
Definition: pedump.c:61
uint32_t ULONG_PTR
Definition: typedefs.h:65
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define FORCEINLINE
Definition: wdftypes.h:67
NTKERNELAPI VOID NTAPI WRITE_REGISTER_UCHAR(IN PUCHAR Register, IN UCHAR Value)
NTKERNELAPI UCHAR NTAPI READ_REGISTER_UCHAR(IN PUCHAR Register)
unsigned char UCHAR
Definition: xmlstorage.h:181