ReactOS 0.4.16-dev-2232-gc2aaa52
vidfb.h
Go to the documentation of this file.
1/*
2 * PROJECT: FreeLoader
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Video support for linear framebuffers
5 * COPYRIGHT: Copyright 2025-2026 Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
6 */
7
8#pragma once
9
10#include "twidbits.h"
11
21typedef struct _PIXEL_BITMASK
22{
28
29
42 _In_ ULONG RedMask,
43 _In_ ULONG GreenMask,
44 _In_ ULONG BlueMask,
45 _In_ ULONG ReservedMask)
46{
47 ULONG CompoundMask = (RedMask | GreenMask | BlueMask | ReservedMask);
48 /* Alternatively, the calculation could be done by finding the highest
49 * bit set in the combined pixel color masks, if they are packed together. */
50 return CountNumberOfBits(CompoundMask); // FindHighestSetBit(CompoundMask);
51}
52
61 _In_ UINT32 PixelsPerScanLine,
62 _In_ UINT32 BitsPerPixel,
63 _In_opt_ PPIXEL_BITMASK PixelMasks);
64
65VOID
68 _In_ BOOLEAN FullScreen);
69
70VOID
72 _In_ UCHAR Char,
73 _In_ ULONG X,
74 _In_ ULONG Y,
75 _In_ UINT32 FgColor,
76 _In_ UINT32 BgColor);
77
78VOID
83
86
87VOID
90 _In_ ULONG Scroll);
91
92#if 0
93VOID
94VidFbSetTextCursorPosition(UCHAR X, UCHAR Y);
95
96VOID
97VidFbHideShowTextCursor(BOOLEAN Show);
98
100VidFbIsPaletteFixed(VOID);
101
102VOID
103VidFbSetPaletteColor(
106
107VOID
108VidFbGetPaletteColor(
111#endif
112
113
114
115/*
116 * PROJECT: FreeLoader
117 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
118 * or MIT (https://spdx.org/licenses/MIT)
119 * PURPOSE: Linear framebuffer based console support
120 * COPYRIGHT: Copyright 2025-2026 Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
121 */
122
123#pragma once
124
125VOID
127 _In_ UCHAR Attr);
128
129VOID
131 _In_ UCHAR Char,
132 _In_ ULONG Column,
133 _In_ ULONG Row,
134 _In_ UINT32 FgColor,
135 _In_ UINT32 BgColor);
136
137VOID
139 _In_ UCHAR Char,
140 _In_ UCHAR Attr,
141 _In_ ULONG Column,
142 _In_ ULONG Row);
143
144VOID
149
150ULONG
152
153VOID
156
157VOID
159 _In_ UCHAR Attr);
unsigned char BOOLEAN
unsigned int UINT32
@ Green
Definition: bl.h:199
@ Red
Definition: bl.h:201
@ Blue
Definition: bl.h:198
Definition: bufpool.h:45
#define Y(I)
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
#define _Out_opt_
Definition: no_sal2.h:214
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
static ULONG ScreenWidth
Definition: pcvideo.c:116
static ULONG ScreenHeight
Definition: pcvideo.c:117
ReactOS Framebuffer-specific video device configuration data.
Definition: framebuf.h:35
Physical format of an RGB pixel, specified with per-component bit-masks. A bit being set defines thos...
Definition: vidfb.h:22
ULONG RedMask
Definition: vidfb.h:23
ULONG BlueMask
Definition: vidfb.h:25
ULONG GreenMask
Definition: vidfb.h:24
ULONG ReservedMask
Definition: vidfb.h:26
FORCEINLINE ULONG CountNumberOfBits(_In_ UINT32 n)
Return the number of bits set in a 32-bit integer.
Definition: twidbits.h:22
uint32_t * PULONG
Definition: typedefs.h:59
uint32_t ULONG_PTR
Definition: typedefs.h:65
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
VOID FbConsScrollUp(_In_ UCHAR Attr)
Definition: vidfb.c:513
VOID FbConsClearScreen(_In_ UCHAR Attr)
Definition: vidfb.c:413
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...
Definition: vidfb.c:462
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,...
Definition: vidfb.h:41
ULONG VidFbGetBufferSize(VOID)
Returns the size in bytes, of a full graphics pixel buffer rectangle that can fill the whole visible ...
Definition: vidfb.c:310
VOID VidFbClearScreenColor(_In_ UINT32 Color, _In_ BOOLEAN FullScreen)
Definition: vidfb.c:230
VOID VidFbScrollUp(_In_ UINT32 Color, _In_ ULONG Scroll)
Definition: vidfb.c:317
ULONG FbConsGetBufferSize(VOID)
Returns the size in bytes, of a full text-mode CGA-style character buffer rectangle that can fill the...
Definition: vidfb.c:481
struct _PIXEL_BITMASK * PPIXEL_BITMASK
struct _PIXEL_BITMASK PIXEL_BITMASK
Physical format of an RGB pixel, specified with per-component bit-masks. A bit being set defines thos...
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.
Definition: vidfb.c:445
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.
Definition: vidfb.c:427
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.
Definition: vidfb.c:253
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.
Definition: vidfb.c:294
VOID FbConsCopyOffScreenBufferToVRAM(_In_ PVOID Buffer)
Copies a full text-mode CGA-style character buffer rectangle to the console.
Definition: vidfb.c:492
BOOLEAN VidFbInitializeVideo(_Out_opt_ PCM_FRAMEBUF_DEVICE_DATA *pFbData, _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.
Definition: vidfb.c:99
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
#define FORCEINLINE
Definition: wdftypes.h:67
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:819
unsigned char UCHAR
Definition: xmlstorage.h:181