2023-07-12 15:12:55 +00:00
|
|
|
/*
|
|
|
|
* 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>
|
|
|
|
*/
|
|
|
|
|
2014-02-06 11:18:34 +00:00
|
|
|
#ifndef _BOOTVID_PCH_
|
|
|
|
#define _BOOTVID_PCH_
|
|
|
|
|
2019-06-23 00:29:01 +00:00
|
|
|
#include <ntifs.h>
|
|
|
|
#include <ndk/halfuncs.h>
|
2014-01-26 20:24:59 +00:00
|
|
|
#include <drivers/bootvid/bootvid.h>
|
2009-10-12 03:35:35 +00:00
|
|
|
|
2020-04-08 05:42:05 +00:00
|
|
|
/* Arch specific includes */
|
|
|
|
#if defined(_M_IX86) || defined(_M_AMD64)
|
2020-05-14 10:36:55 +00:00
|
|
|
#if defined(SARCH_PC98)
|
|
|
|
#include "i386/pc98/pc98.h"
|
2020-05-12 14:32:37 +00:00
|
|
|
#elif defined(SARCH_XBOX)
|
2020-08-26 13:58:01 +00:00
|
|
|
#include "i386/xbox/xbox.h"
|
2020-05-14 10:36:55 +00:00
|
|
|
#else
|
2020-04-08 05:42:05 +00:00
|
|
|
#include "i386/pc/vga.h"
|
|
|
|
#include "i386/pc/pc.h"
|
2020-05-14 10:36:55 +00:00
|
|
|
#endif
|
2020-04-08 05:42:05 +00:00
|
|
|
#elif defined(_M_ARM)
|
|
|
|
#include "arm/arm.h"
|
|
|
|
#else
|
|
|
|
#error Unknown architecture
|
|
|
|
#endif
|
|
|
|
|
2009-10-12 03:35:35 +00:00
|
|
|
/* Define if FontData has upside down characters */
|
|
|
|
#undef CHAR_GEN_UPSIDE_DOWN
|
|
|
|
|
2019-12-22 13:09:43 +00:00
|
|
|
#define BOOTCHAR_HEIGHT 13
|
|
|
|
#define BOOTCHAR_WIDTH 8 // Each character line is encoded in a UCHAR.
|
|
|
|
|
2014-01-26 20:24:59 +00:00
|
|
|
/* Bitmap Header */
|
2009-10-12 03:35:35 +00:00
|
|
|
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;
|
|
|
|
|
2014-08-31 23:00:29 +00:00
|
|
|
/* Supported bitmap compression formats */
|
|
|
|
#define BI_RGB 0
|
|
|
|
#define BI_RLE4 2
|
|
|
|
|
2020-05-09 14:20:57 +00:00
|
|
|
typedef ULONG RGBQUAD;
|
2019-06-23 00:29:01 +00:00
|
|
|
|
2020-04-08 05:42:05 +00:00
|
|
|
/*
|
|
|
|
* Globals
|
|
|
|
*/
|
|
|
|
extern UCHAR VidpTextColor;
|
|
|
|
extern ULONG VidpCurrentX;
|
|
|
|
extern ULONG VidpCurrentY;
|
|
|
|
extern ULONG VidpScrollRegion[4];
|
2020-05-09 14:20:57 +00:00
|
|
|
extern 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)))
|
|
|
|
|
2022-04-28 01:08:57 +00:00
|
|
|
#define GetRValue(quad) ((UCHAR)(((quad)>>16) & 0xFF))
|
|
|
|
#define GetGValue(quad) ((UCHAR)(((quad)>>8) & 0xFF))
|
|
|
|
#define GetBValue(quad) ((UCHAR)((quad) & 0xFF))
|
2020-05-09 14:20:57 +00:00
|
|
|
|
2022-04-28 01:08:57 +00:00
|
|
|
#define InitializePalette() InitPaletteWithTable((PULONG)VidpDefaultPalette, BV_MAX_COLORS)
|
2020-05-09 14:20:57 +00:00
|
|
|
|
|
|
|
#ifdef CHAR_GEN_UPSIDE_DOWN
|
2022-04-28 01:08:57 +00:00
|
|
|
# define GetFontPtr(_Char) (&VidpFontData[(_Char) * BOOTCHAR_HEIGHT] + BOOTCHAR_HEIGHT - 1)
|
|
|
|
# define FONT_PTR_DELTA (-1)
|
2020-05-09 14:20:57 +00:00
|
|
|
#else
|
2022-04-28 01:08:57 +00:00
|
|
|
# define GetFontPtr(_Char) (&VidpFontData[(_Char) * BOOTCHAR_HEIGHT])
|
|
|
|
# define FONT_PTR_DELTA (1)
|
2020-05-09 14:20:57 +00:00
|
|
|
#endif
|
2019-06-23 00:29:01 +00:00
|
|
|
|
2014-02-06 11:18:34 +00:00
|
|
|
#endif /* _BOOTVID_PCH_ */
|