17#define TOP_BOTTOM_LINES 0
50VidFbPrintFramebufferInfo(
VOID)
52 TRACE(
"Framebuffer format:\n");
61 TRACE(
" ARGB masks: : %08x/%08x/%08x/%08x\n",
121 if (BitsPerPixel != 32)
124 ERR(
"Unsupported %lu bits per pixel format\n", BitsPerPixel);
129 if (BitsPerPixel > 8)
132 (PixelMasks->RedMask == 0 &&
133 PixelMasks->GreenMask == 0 &&
134 PixelMasks->BlueMask == 0
138 switch (BitsPerPixel)
142 BitMasks->
RedMask = 0x00FF0000;
145 BitMasks->
ReservedMask = ((1 << (BitsPerPixel - 24)) - 1) << 24;
178 VidFbPrintFramebufferInfo();
185 TRACE(
"BitsPerPixel = %lu , BppFromMasks = %lu\n", BitsPerPixel, BppFromMasks);
224 const UCHAR* FontPtr;
245 Pixel[Col] = (0 != (FontPtr[
Line] &
Mask) ? FgColor : BgColor);
304VidFbHideShowTextCursor(
BOOLEAN Show)
310VidFbIsPaletteFixed(
VOID)
342#define VGA_CHAR_SIZE 2
344#define FBCONS_WIDTH (framebufInfo.ScreenWidth / CHAR_WIDTH)
345#define FBCONS_HEIGHT ((framebufInfo.ScreenHeight - 2 * TOP_BOTTOM_LINES) / CHAR_HEIGHT)
353 Intensity = (0 == (Attr & 0x08) ? 127 : 255);
356 (0 == (Attr & 0x04) ? 0 : (
Intensity << 16)) |
357 (0 == (Attr & 0x02) ? 0 : (
Intensity << 8)) |
466 for (Row = 0; Row <
Height; ++Row)
468 for (Col = 0; Col <
Width; ++Col)
470 FbConsPutChar(OffScreenBuffer[0], OffScreenBuffer[1], Col, Row);
#define DBG_DEFAULT_CHANNEL(ch)
static WORD Intensity(RGBQUAD clr)
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
static ULONG ScreenHeight
Physical format of an RGB pixel, specified with per-component bit-masks. A bit being set defines thos...
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
_In_ HFONT _Out_ PUINT Height
const UCHAR BitmapFont8x16[256 *CHAR_HEIGHT]
VOID FbConsScrollUp(_In_ UCHAR Attr)
VOID FbConsClearScreen(_In_ UCHAR Attr)
VOID FbConsGetDisplaySize(_Out_ PULONG Width, _Out_ PULONG Height, _Out_ PULONG Depth)
Returns the width and height in number of CGA characters/attributes, of a full text-mode CGA-style ch...
ULONG VidFbGetBufferSize(VOID)
Returns the size in bytes, of a full graphics pixel buffer rectangle that can fill the whole visible ...
FRAMEBUFFER_INFO framebufInfo
VOID VidFbClearScreenColor(_In_ UINT32 Color, _In_ BOOLEAN FullScreen)
VOID VidFbScrollUp(_In_ UINT32 Color, _In_ ULONG Scroll)
ULONG FbConsGetBufferSize(VOID)
Returns the size in bytes, of a full text-mode CGA-style character buffer rectangle that can fill the...
struct _FRAMEBUFFER_INFO FRAMEBUFFER_INFO
static VOID FbConsAttrToColors(_In_ UCHAR Attr, _Out_ PUINT32 FgColor, _Out_ PUINT32 BgColor)
Maps a text-mode CGA-style character attribute to separate foreground and background ARGB colors.
BOOLEAN VidFbInitializeVideo(_In_ ULONG_PTR BaseAddress, _In_ ULONG BufferSize, _In_ UINT32 ScreenWidth, _In_ UINT32 ScreenHeight, _In_ UINT32 PixelsPerScanLine, _In_ UINT32 BitsPerPixel, _In_opt_ PPIXEL_BITMASK PixelMasks)
Initializes internal framebuffer information based on the given parameters.
VOID FbConsPutChar(_In_ UCHAR Char, _In_ UCHAR Attr, _In_ ULONG Column, _In_ ULONG Row)
Displays a character with specific text attributes at a given position.
static UINT32 FbConsAttrToSingleColor(_In_ UCHAR Attr)
VOID FbConsOutputChar(_In_ UCHAR Char, _In_ ULONG Column, _In_ ULONG Row, _In_ UINT32 FgColor, _In_ UINT32 BgColor)
Displays a character at a given position with specific foreground and background colors.
VOID VidFbOutputChar(_In_ UCHAR Char, _In_ ULONG X, _In_ ULONG Y, _In_ UINT32 FgColor, _In_ UINT32 BgColor)
Displays a character at a given pixel position with specific foreground and background colors.
VOID VidFbGetDisplaySize(_Out_ PULONG Width, _Out_ PULONG Height, _Out_ PULONG Depth)
Returns the width and height in pixels, of the whole visible area of the graphics framebuffer.
VOID FbConsCopyOffScreenBufferToVRAM(_In_ PVOID Buffer)
Copies a full text-mode CGA-style character buffer rectangle to the console.
struct _FRAMEBUFFER_INFO * PFRAMEBUFFER_INFO
FORCEINLINE ULONG PixelBitmasksToBpp(_In_ ULONG RedMask, _In_ ULONG GreenMask, _In_ ULONG BlueMask, _In_ ULONG ReservedMask)
Calculates the number of bits per pixel ("PixelDepth") for the given pixel format,...
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth