mirror of
https://github.com/reactos/reactos.git
synced 2026-05-24 00:00:41 +08:00
105 lines
2.4 KiB
C
105 lines
2.4 KiB
C
/*
|
|
* PROJECT: ReactOS Boot Video Driver
|
|
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
|
* PURPOSE: Precompiled header
|
|
* COPYRIGHT: Copyright 2007 Alex Ionescu <alex.ionescu@reactos.org>
|
|
* Copyright 2020 Dmitry Borisov <di.sean@protonmail.com>
|
|
* Copyright 2020 Stanislav Motylkov <x86corez@gmail.com>
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <ntifs.h>
|
|
#include <ndk/halfuncs.h>
|
|
#include <drivers/bootvid/bootvid.h>
|
|
|
|
/* Module-specific header */
|
|
#ifdef MODULE_HEADER
|
|
#include MODULE_HEADER
|
|
#endif
|
|
|
|
/* Define if FontData has upside-down characters */
|
|
#undef CHAR_GEN_UPSIDE_DOWN
|
|
|
|
#define BOOTCHAR_HEIGHT 13
|
|
#define BOOTCHAR_WIDTH 8 // Each character line is encoded in a UCHAR.
|
|
|
|
/* Bitmap Header */
|
|
typedef struct tagBITMAPINFOHEADER
|
|
{
|
|
ULONG biSize;
|
|
LONG biWidth;
|
|
LONG biHeight;
|
|
USHORT biPlanes;
|
|
USHORT biBitCount;
|
|
ULONG biCompression;
|
|
ULONG biSizeImage;
|
|
LONG biXPelsPerMeter;
|
|
LONG biYPelsPerMeter;
|
|
ULONG biClrUsed;
|
|
ULONG biClrImportant;
|
|
} BITMAPINFOHEADER, *PBITMAPINFOHEADER;
|
|
|
|
/* Supported bitmap compression formats */
|
|
#define BI_RGB 0
|
|
#define BI_RLE4 2
|
|
|
|
typedef ULONG RGBQUAD;
|
|
|
|
typedef struct _URECT
|
|
{
|
|
ULONG Left;
|
|
ULONG Top;
|
|
ULONG Right;
|
|
ULONG Bottom;
|
|
} URECT;
|
|
|
|
/*
|
|
* Globals
|
|
*/
|
|
extern UCHAR VidpTextColor;
|
|
extern ULONG VidpCurrentX;
|
|
extern ULONG VidpCurrentY;
|
|
extern URECT VidpScrollRegion;
|
|
extern const UCHAR VidpFontData[256 * BOOTCHAR_HEIGHT];
|
|
extern const RGBQUAD VidpDefaultPalette[BV_MAX_COLORS];
|
|
|
|
#define RGB(r, g, b) ((RGBQUAD)(((UCHAR)(b) | ((USHORT)((UCHAR)(g))<<8)) | (((ULONG)(UCHAR)(r))<<16)))
|
|
|
|
#define GetRValue(quad) ((UCHAR)(((quad)>>16) & 0xFF))
|
|
#define GetGValue(quad) ((UCHAR)(((quad)>>8) & 0xFF))
|
|
#define GetBValue(quad) ((UCHAR)((quad) & 0xFF))
|
|
|
|
#define InitializePalette() InitPaletteWithTable((PULONG)VidpDefaultPalette, BV_MAX_COLORS)
|
|
|
|
#ifdef CHAR_GEN_UPSIDE_DOWN
|
|
# define GetFontPtr(_Char) (&VidpFontData[(_Char) * BOOTCHAR_HEIGHT] + BOOTCHAR_HEIGHT - 1)
|
|
# define FONT_PTR_DELTA (-1)
|
|
#else
|
|
# define GetFontPtr(_Char) (&VidpFontData[(_Char) * BOOTCHAR_HEIGHT])
|
|
# define FONT_PTR_DELTA (1)
|
|
#endif
|
|
|
|
|
|
VOID
|
|
PreserveRow(
|
|
_In_ ULONG CurrentTop,
|
|
_In_ ULONG Height,
|
|
_In_ BOOLEAN Restore);
|
|
|
|
VOID
|
|
DoScroll(
|
|
_In_ ULONG Scroll);
|
|
|
|
VOID
|
|
DisplayCharacter(
|
|
_In_ CHAR Character,
|
|
_In_ ULONG Left,
|
|
_In_ ULONG Top,
|
|
_In_ ULONG TextColor,
|
|
_In_ ULONG BackColor);
|
|
|
|
VOID
|
|
ResetDisplay(
|
|
_In_ BOOLEAN SetMode);
|