[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:
Stanislav Motylkov 2020-05-09 17:20:57 +03:00
parent 909f50a857
commit cd91271796
No known key found for this signature in database
GPG key ID: AFE513258CBA9E92
15 changed files with 367 additions and 426 deletions

View file

@ -14,29 +14,34 @@
BOOLEAN
NTAPI
VidInitialize(IN BOOLEAN SetMode);
VidInitialize(
_In_ BOOLEAN SetMode);
VOID
NTAPI
VidResetDisplay(IN BOOLEAN HalReset);
VidResetDisplay(
_In_ BOOLEAN HalReset);
ULONG
NTAPI
VidSetTextColor(IN ULONG Color);
VidSetTextColor(
_In_ ULONG Color);
VOID
NTAPI
VidDisplayStringXY(IN PUCHAR String,
IN ULONG Left,
IN ULONG Top,
IN BOOLEAN Transparent);
VidDisplayStringXY(
_In_ PUCHAR String,
_In_ ULONG Left,
_In_ ULONG Top,
_In_ BOOLEAN Transparent);
VOID
NTAPI
VidSetScrollRegion(IN ULONG Left,
IN ULONG Top,
IN ULONG Right,
IN ULONG Bottom);
VidSetScrollRegion(
_In_ ULONG Left,
_In_ ULONG Top,
_In_ ULONG Right,
_In_ ULONG Bottom);
VOID
NTAPI
@ -44,38 +49,43 @@ VidCleanUp(VOID);
VOID
NTAPI
VidBufferToScreenBlt(IN PUCHAR Buffer,
IN ULONG Left,
IN ULONG Top,
IN ULONG Width,
IN ULONG Height,
IN ULONG Delta);
VidBufferToScreenBlt(
_In_ PUCHAR Buffer,
_In_ ULONG Left,
_In_ ULONG Top,
_In_ ULONG Width,
_In_ ULONG Height,
_In_ ULONG Delta);
VOID
NTAPI
VidDisplayString(IN PUCHAR String);
VidDisplayString(
_In_ PUCHAR String);
VOID
NTAPI
VidBitBlt(IN PUCHAR Buffer,
IN ULONG Left,
IN ULONG Top);
VidBitBlt(
_In_ PUCHAR Buffer,
_In_ ULONG Left,
_In_ ULONG Top);
VOID
NTAPI
VidScreenToBufferBlt(OUT PUCHAR Buffer,
IN ULONG Left,
IN ULONG Top,
IN ULONG Width,
IN ULONG Height,
IN ULONG Delta);
VidScreenToBufferBlt(
_Out_ PUCHAR Buffer,
_In_ ULONG Left,
_In_ ULONG Top,
_In_ ULONG Width,
_In_ ULONG Height,
_In_ ULONG Delta);
VOID
NTAPI
VidSolidColorFill(IN ULONG Left,
IN ULONG Top,
IN ULONG Right,
IN ULONG Bottom,
IN UCHAR Color);
VidSolidColorFill(
_In_ ULONG Left,
_In_ ULONG Top,
_In_ ULONG Right,
_In_ ULONG Bottom,
_In_ UCHAR Color);
#endif // _BOOTVID_

View file

@ -10,3 +10,23 @@
/* For default VGA */
#define SCREEN_WIDTH 640
#define SCREEN_HEIGHT 480
/* Boot video default color palette constants */
#define BV_COLOR_BLACK 0
#define BV_COLOR_RED 1
#define BV_COLOR_GREEN 2
#define BV_COLOR_BROWN 3
#define BV_COLOR_BLUE 4
#define BV_COLOR_MAGENTA 5
#define BV_COLOR_CYAN 6
#define BV_COLOR_DARK_GRAY 7
#define BV_COLOR_LIGHT_GRAY 8
#define BV_COLOR_LIGHT_RED 9
#define BV_COLOR_LIGHT_GREEN 10
#define BV_COLOR_YELLOW 11
#define BV_COLOR_LIGHT_BLUE 12
#define BV_COLOR_LIGHT_MAGENTA 13
#define BV_COLOR_LIGHT_CYAN 14
#define BV_COLOR_WHITE 15
#define BV_COLOR_NONE 16
#define BV_MAX_COLORS 16