mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:23:07 +00:00
[NTOSKRNL][HAL][BOOTVID] Some more code refactoring
- Add boot video color constants
- Refactor palette initialization
- Move some common stuff in right place
- Get rid of some magic constants and hardcoded values
- Get rid of TopDelta variable (calculated at compile time)
- Update SAL annotations
Addendum to 5f2ca473
. CORE-16216 CORE-16219
This commit is contained in:
parent
909f50a857
commit
cd91271796
15 changed files with 367 additions and 426 deletions
|
@ -41,35 +41,7 @@ typedef struct tagBITMAPINFOHEADER
|
|||
#define BI_RGB 0
|
||||
#define BI_RLE4 2
|
||||
|
||||
typedef struct _PALETTE_ENTRY
|
||||
{
|
||||
UCHAR Red;
|
||||
UCHAR Green;
|
||||
UCHAR Blue;
|
||||
} PALETTE_ENTRY, *PPALETTE_ENTRY;
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
InitializePalette(VOID);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
DisplayCharacter(
|
||||
_In_ CHAR Character,
|
||||
_In_ ULONG Left,
|
||||
_In_ ULONG Top,
|
||||
_In_ ULONG TextColor,
|
||||
_In_ ULONG BackColor
|
||||
);
|
||||
|
||||
VOID
|
||||
PrepareForSetPixel(VOID);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
InitPaletteWithTable(
|
||||
_In_ PULONG Table,
|
||||
_In_ ULONG Count);
|
||||
typedef ULONG RGBQUAD;
|
||||
|
||||
/*
|
||||
* Globals
|
||||
|
@ -78,6 +50,23 @@ extern UCHAR VidpTextColor;
|
|||
extern ULONG VidpCurrentX;
|
||||
extern ULONG VidpCurrentY;
|
||||
extern ULONG VidpScrollRegion[4];
|
||||
extern UCHAR FontData[256 * BOOTCHAR_HEIGHT];
|
||||
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)))
|
||||
|
||||
#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
|
||||
|
||||
#endif /* _BOOTVID_PCH_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue