ReactOS 0.4.16-dev-2104-gb84fa49
bootvid.h File Reference
#include "display.h"
Include dependency graph for bootvid.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

BOOLEAN NTAPI VidInitialize (_In_ BOOLEAN SetMode)
 
VOID NTAPI VidResetDisplay (_In_ BOOLEAN SetMode)
 
VOID NTAPI VidCleanUp (VOID)
 
VOID NTAPI VidDisplayString (_In_ PCSTR String)
 
VOID NTAPI VidDisplayStringXY (_In_ PCSTR 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)
 
ULONG NTAPI VidSetTextColor (_In_ ULONG Color)
 
VOID NTAPI VidBitBlt (_In_ PUCHAR Buffer, _In_ ULONG Left, _In_ ULONG Top)
 
VOID NTAPI VidBufferToScreenBlt (_In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_ ULONG Delta)
 
VOID NTAPI VidScreenToBufferBlt (_Out_writes_bytes_all_(Delta *Height) 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)
 

Function Documentation

◆ VidBitBlt()

VOID NTAPI VidBitBlt ( _In_ PUCHAR  Buffer,
_In_ ULONG  Left,
_In_ ULONG  Top 
)

Definition at line 318 of file common.c.

322{
324 LONG Delta;
325 PUCHAR BitmapOffset;
326 ULONG PaletteCount;
327
328 /* Get the Bitmap Header */
330
331 /* Initialize the palette */
332 PaletteCount = BitmapInfoHeader->biClrUsed ?
335 PaletteCount);
336
337 /* Make sure we can support this bitmap */
339
340 /*
341 * Calculate the delta and align it on 32-bytes, then calculate
342 * the actual start of the bitmap data.
343 */
345 Delta >>= 3;
346 Delta &= ~3;
347 BitmapOffset = Buffer + sizeof(BITMAPINFOHEADER) + PaletteCount * sizeof(ULONG);
348
349 /* Check the compression of the bitmap */
351 {
352 /* Make sure we have a width and a height */
354 {
355 /* We can use RLE Bit Blt */
356 RleBitBlt(Left,
357 Top,
360 BitmapOffset);
361 }
362 }
363 else
364 {
365 /* Check if the height is negative */
366 if (BitmapInfoHeader->biHeight < 0)
367 {
368 /* Make it positive in the header */
370 }
371 else
372 {
373 /* Update buffer offset */
374 BitmapOffset += ((BitmapInfoHeader->biHeight - 1) * Delta);
375 Delta *= -1;
376 }
377
378 /* Make sure we have a width and a height */
380 {
381 /* Do the BitBlt */
382 BitBlt(Left,
383 Top,
386 BitmapOffset,
388 Delta);
389 }
390 }
391}
VOID InitPaletteWithTable(_In_reads_(Count) const ULONG *Table, _In_ ULONG Count)
Definition: bootvid.c:220
static LPHIST_ENTRY Top
Definition: history.c:53
Definition: bufpool.h:45
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:42
static VOID RleBitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_ PUCHAR Buffer)
Definition: common.c:104
#define BI_RLE4
Definition: precomp.h:56
struct tagBITMAPINFOHEADER * PBITMAPINFOHEADER
#define ASSERT(a)
Definition: mode.c:44
long LONG
Definition: pedump.c:60
#define BV_MAX_COLORS
Definition: display.h:32
DWORD biCompression
Definition: amvideo.idl:35
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59

Referenced by BootLogoFadeIn(), and InbvBitBlt().

◆ VidBufferToScreenBlt()

VOID NTAPI VidBufferToScreenBlt ( _In_reads_bytes_(Delta *Height) PUCHAR  Buffer,
_In_ ULONG  Left,
_In_ ULONG  Top,
_In_ ULONG  Width,
_In_ ULONG  Height,
_In_ ULONG  Delta 
)

Definition at line 300 of file common.c.

307{
308 /* Make sure we have a width and height */
309 if (!Width || !Height)
310 return;
311
312 /* Call the helper function */
313 BitBlt(Left, Top, Width, Height, Buffer, 4, Delta);
314}
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88

Referenced by InbvBufferToScreenBlt(), and InbvRotationThread().

◆ VidCleanUp()

VOID NTAPI VidCleanUp ( VOID  )

Definition at line 276 of file bootvid.c.

277{
279 while (TRUE);
280}
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
#define TRUE
Definition: types.h:120

Referenced by InbvEnableBootDriver(), and InbvNotifyDisplayOwnershipLost().

◆ VidDisplayString()

VOID NTAPI VidDisplayString ( _In_ PCSTR  String)

Definition at line 98 of file console.c.

100{
101 /* Start looping the string */
102 for (; *String; ++String)
103 {
104 /* Treat new-line separately */
105 if (*String == '\n')
106 {
107 /* Modify Y position */
110 {
111 /* Scroll the view and clear the current row */
115 }
116 else
117 {
118 /* Preserve the current row */
120 }
121
122 /* Update current X */
124
125 /* No need to clear this row */
126 ClearRow = FALSE;
127 }
128 else if (*String == '\r')
129 {
130 /* Update current X */
132
133 /* If a new-line does not follow we will clear the current row */
134 if (String[1] != '\n')
135 ClearRow = TRUE;
136 }
137 else
138 {
139 /* Clear the current row if we had a return-carriage without a new-line */
140 if (ClearRow)
141 {
143 ClearRow = FALSE;
144 }
145
146 /* Display this character */
149
150 /* Check if we should scroll */
152 {
153 /* Update Y position and check if we should scroll it */
156 {
157 /* Scroll the view and clear the current row */
161 }
162 else
163 {
164 /* Preserve the current row */
166 }
167
168 /* Update current X */
170 }
171 }
172 }
173}
VOID PreserveRow(_In_ ULONG CurrentTop, _In_ ULONG TopDelta, _In_ BOOLEAN Restore)
Definition: bootvid.c:159
VOID DisplayCharacter(_In_ CHAR Character, _In_ ULONG Left, _In_ ULONG Top, _In_ ULONG TextColor, _In_ ULONG BackColor)
Definition: bootvid.c:67
VOID DoScroll(_In_ ULONG Scroll)
Definition: bootvid.c:112
#define FALSE
Definition: types.h:117
UCHAR VidpTextColor
Definition: console.c:14
ULONG VidpCurrentY
Definition: console.c:16
ULONG VidpCurrentX
Definition: console.c:15
URECT VidpScrollRegion
Definition: console.c:17
static BOOLEAN ClearRow
Definition: console.c:19
#define BOOTCHAR_HEIGHT
Definition: precomp.h:35
#define BOOTCHAR_WIDTH
Definition: precomp.h:36
#define BV_COLOR_NONE
Definition: display.h:31
ULONG Right
Definition: precomp.h:64
ULONG Bottom
Definition: precomp.h:65
ULONG Left
Definition: precomp.h:62
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2439

Referenced by InbvDisplayString().

◆ VidDisplayStringXY()

VOID NTAPI VidDisplayStringXY ( _In_ PCSTR  String,
_In_ ULONG  Left,
_In_ ULONG  Top,
_In_ BOOLEAN  Transparent 
)

Definition at line 74 of file console.c.

79{
80 ULONG BackColor;
81
82 /*
83 * If the caller wanted transparent, then send the special value (16),
84 * else use our default and call the helper routine.
85 */
86 BackColor = Transparent ? BV_COLOR_NONE : BV_COLOR_LIGHT_CYAN;
87
88 /* Loop every character and adjust the position */
89 for (; *String; ++String, Left += BOOTCHAR_WIDTH)
90 {
91 /* Display a character */
93 }
94}
#define BV_COLOR_LIGHT_CYAN
Definition: display.h:29
#define BV_COLOR_LIGHT_BLUE
Definition: display.h:27

◆ VidInitialize()

BOOLEAN NTAPI VidInitialize ( _In_ BOOLEAN  SetMode)

Definition at line 231 of file bootvid.c.

233{
234 DPRINT1("bv-arm v0.1\n");
235
236 //
237 // Allocate framebuffer
238 // 600kb works out to 640x480@16bpp
239 //
242 if (!VgaArmBase) return FALSE;
243
244 //
245 // Get physical address
246 //
248 if (!VgaPhysical.QuadPart) return FALSE;
249 DPRINT1("[BV-ARM] Frame Buffer @ 0x%p 0p%p\n", VgaArmBase, VgaPhysical.LowPart);
250
251 //
252 // Setup the display
253 //
255
256 //
257 // We are done!
258 //
259 return TRUE;
260}
static PHYSICAL_ADDRESS VgaPhysical
Definition: bootvid.c:30
VOID VidpInitializeDisplay(VOID)
Definition: bootvid.c:195
static PUSHORT VgaArmBase
Definition: bootvid.c:29
#define DPRINT1
Definition: precomp.h:8
PVOID NTAPI MmAllocateContiguousMemory(IN SIZE_T NumberOfBytes, IN PHYSICAL_ADDRESS HighestAcceptableAddress)
Definition: contmem.c:626
PHYSICAL_ADDRESS NTAPI MmGetPhysicalAddress(IN PVOID Address)
Definition: stubs.c:685
LONGLONG QuadPart
Definition: typedefs.h:114
ULONG LowPart
Definition: typedefs.h:106

Referenced by InbvDriverInitialize().

◆ VidResetDisplay()

VOID NTAPI VidResetDisplay ( _In_ BOOLEAN  SetMode)

Definition at line 25 of file console.c.

27{
28 /* Clear the current position */
29 VidpCurrentX = 0;
30 VidpCurrentY = 0;
31
32 /* Invoke the hardware-specific routine */
33 ResetDisplay(SetMode);
34}
VOID ResetDisplay(_In_ BOOLEAN SetMode)
Definition: bootvid.c:263

Referenced by InbvResetDisplay(), and VidInitialize().

◆ VidScreenToBufferBlt()

VOID NTAPI VidScreenToBufferBlt ( _Out_writes_bytes_all_(Delta *Height) PUCHAR  Buffer,
_In_ ULONG  Left,
_In_ ULONG  Top,
_In_ ULONG  Width,
_In_ ULONG  Height,
_In_ ULONG  Delta 
)

Definition at line 284 of file bootvid.c.

291{
293 while (TRUE);
294}

Referenced by InbvScreenToBufferBlt().

◆ VidSetScrollRegion()

VOID NTAPI VidSetScrollRegion ( _In_ ULONG  Left,
_In_ ULONG  Top,
_In_ ULONG  Right,
_In_ ULONG  Bottom 
)

Definition at line 51 of file console.c.

56{
57 /* Assert alignment */
58 ASSERT((Left % BOOTCHAR_WIDTH) == 0);
59 ASSERT((Right % BOOTCHAR_WIDTH) == BOOTCHAR_WIDTH - 1);
60
61 /* Set the scroll region */
64 VidpScrollRegion.Right = Right;
66
67 /* Set the current X and Y */
68 VidpCurrentX = Left;
70}
static LPHIST_ENTRY Bottom
Definition: history.c:54
ULONG Top
Definition: precomp.h:63

Referenced by InbvSetScrollRegion().

◆ VidSetTextColor()

ULONG NTAPI VidSetTextColor ( _In_ ULONG  Color)

Definition at line 38 of file console.c.

40{
41 ULONG OldColor;
42
43 /* Save the old color and set the new one */
44 OldColor = VidpTextColor;
46 return OldColor;
47}

Referenced by InbvSetTextColor().

◆ VidSolidColorFill()

VOID NTAPI VidSolidColorFill ( _In_ ULONG  Left,
_In_ ULONG  Top,
_In_ ULONG  Right,
_In_ ULONG  Bottom,
_In_ UCHAR  Color 
)

Definition at line 298 of file bootvid.c.

304{
305 int y, x;
306
307 //
308 // Loop along the Y-axis
309 //
310 for (y = Top; y <= Bottom; y++)
311 {
312 //
313 // Loop along the X-axis
314 //
315 for (x = Left; x <= Right; x++)
316 {
317 //
318 // Draw the pixel
319 //
320 SetPixel(x, y, Color);
321 }
322 }
323}
FORCEINLINE VOID SetPixel(_In_ ULONG Left, _In_ ULONG Top, _In_ UCHAR Color)
Definition: bootvid.c:52
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Referenced by BootAnimTickProgressBar(), FinalizeBootLogo(), InbvRotationThread(), InbvSolidColorFill(), ResetDisplay(), RleBitBlt(), and VidCleanUp().