Allow to clear framebuffer screen with any, custom background color
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 44s
Builds / ExectOS (i686) (push) Successful in 42s

This commit is contained in:
Rafal Kupiec 2024-05-12 22:43:06 +02:00
parent c576f7f8f2
commit e311cad8f7
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
3 changed files with 27 additions and 5 deletions

View File

@ -154,6 +154,17 @@ typedef struct _HAL_FRAMEBUFFER_DATA
UINT BitsPerPixel;
UINT Pitch;
PVOID Font;
struct
{
USHORT BlueShift;
USHORT BlueSize;
USHORT GreenShift;
USHORT GreenSize;
USHORT RedShift;
USHORT RedSize;
USHORT ReservedShift;
USHORT ReservedSize;
} Pixels;
} HAL_FRAMEBUFFER_DATA, *PHAL_FRAMEBUFFER_DATA;
/* SMBIOS table header structure */

View File

@ -11,7 +11,10 @@
/**
* Clears the screen by drawing a filled black box.
* Clears the screen by drawing a box filled with specified color.
*
* @param Color
* Specifies the color of the box used to fill the screen.
*
* @return This routine does not return any value.
*
@ -19,7 +22,7 @@
*/
XTAPI
VOID
HlClearScreen(VOID)
HlClearScreen(IN ULONG Color)
{
SIZE_T Line, PositionX, PositionY;
PULONG FrameBuf;
@ -33,7 +36,7 @@ HlClearScreen(VOID)
Line = PositionY * HlpFrameBufferData.PixelsPerScanLine;
for(PositionX = 0; PositionX < HlpFrameBufferData.Width; PositionX++)
{
FrameBuf[Line + PositionX] = 0x00000000;
FrameBuf[Line + PositionX] = Color;
}
}
}
@ -128,10 +131,18 @@ HlInitializeFrameBuffer(VOID)
HlpFrameBufferData.BitsPerPixel = KeInitializationBlock->LoaderInformation.FrameBuffer.BitsPerPixel;
HlpFrameBufferData.PixelsPerScanLine = KeInitializationBlock->LoaderInformation.FrameBuffer.PixelsPerScanLine;
HlpFrameBufferData.Pitch = KeInitializationBlock->LoaderInformation.FrameBuffer.Pitch;
HlpFrameBufferData.Pixels.BlueShift = KeInitializationBlock->LoaderInformation.FrameBuffer.Pixels.BlueShift;
HlpFrameBufferData.Pixels.BlueSize = KeInitializationBlock->LoaderInformation.FrameBuffer.Pixels.BlueSize;
HlpFrameBufferData.Pixels.GreenShift = KeInitializationBlock->LoaderInformation.FrameBuffer.Pixels.GreenShift;
HlpFrameBufferData.Pixels.GreenSize = KeInitializationBlock->LoaderInformation.FrameBuffer.Pixels.GreenSize;
HlpFrameBufferData.Pixels.RedShift = KeInitializationBlock->LoaderInformation.FrameBuffer.Pixels.RedShift;
HlpFrameBufferData.Pixels.RedSize = KeInitializationBlock->LoaderInformation.FrameBuffer.Pixels.RedSize;
HlpFrameBufferData.Pixels.ReservedShift = KeInitializationBlock->LoaderInformation.FrameBuffer.Pixels.ReservedShift;
HlpFrameBufferData.Pixels.ReservedSize = KeInitializationBlock->LoaderInformation.FrameBuffer.Pixels.ReservedSize;
HlpFrameBufferData.Initialized = TRUE;
/* Clear screen */
HlClearScreen();
HlClearScreen(0x00000000);
/* Return success */
return STATUS_SUCCESS;

View File

@ -14,7 +14,7 @@
/* HAL library routines forward references */
XTAPI
VOID
HlClearScreen(VOID);
HlClearScreen(IN ULONG Color);
XTCDECL
XTSTATUS