ReactOS 0.4.15-dev-7934-g1dc8d80
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 HalReset)
 
ULONG NTAPI VidSetTextColor (_In_ ULONG Color)
 
VOID NTAPI VidDisplayStringXY (_In_z_ 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)
 
VOID NTAPI VidCleanUp (VOID)
 
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 VidDisplayString (_In_z_ PUCHAR String)
 
VOID NTAPI VidBitBlt (_In_ PUCHAR Buffer, _In_ ULONG Left, _In_ ULONG Top)
 
VOID NTAPI VidScreenToBufferBlt (_Out_writes_bytes_(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 471 of file common.c.

475{
476 PBITMAPINFOHEADER BitmapInfoHeader;
477 LONG Delta;
478 PUCHAR BitmapOffset;
479 ULONG PaletteCount;
480
481 /* Get the Bitmap Header */
482 BitmapInfoHeader = (PBITMAPINFOHEADER)Buffer;
483
484 /* Initialize the palette */
485 PaletteCount = BitmapInfoHeader->biClrUsed ?
486 BitmapInfoHeader->biClrUsed : BV_MAX_COLORS;
487 InitPaletteWithTable((PULONG)(Buffer + BitmapInfoHeader->biSize),
488 PaletteCount);
489
490 /* Make sure we can support this bitmap */
491 ASSERT((BitmapInfoHeader->biBitCount * BitmapInfoHeader->biPlanes) <= 4);
492
493 /*
494 * Calculate the delta and align it on 32-bytes, then calculate
495 * the actual start of the bitmap data.
496 */
497 Delta = (BitmapInfoHeader->biBitCount * BitmapInfoHeader->biWidth) + 31;
498 Delta >>= 3;
499 Delta &= ~3;
500 BitmapOffset = Buffer + sizeof(BITMAPINFOHEADER) + PaletteCount * sizeof(ULONG);
501
502 /* Check the compression of the bitmap */
503 if (BitmapInfoHeader->biCompression == BI_RLE4)
504 {
505 /* Make sure we have a width and a height */
506 if ((BitmapInfoHeader->biWidth) && (BitmapInfoHeader->biHeight))
507 {
508 /* We can use RLE Bit Blt */
509 RleBitBlt(Left,
510 Top,
511 BitmapInfoHeader->biWidth,
512 BitmapInfoHeader->biHeight,
513 BitmapOffset);
514 }
515 }
516 else
517 {
518 /* Check if the height is negative */
519 if (BitmapInfoHeader->biHeight < 0)
520 {
521 /* Make it positive in the header */
522 BitmapInfoHeader->biHeight *= -1;
523 }
524 else
525 {
526 /* Update buffer offset */
527 BitmapOffset += ((BitmapInfoHeader->biHeight - 1) * Delta);
528 Delta *= -1;
529 }
530
531 /* Make sure we have a width and a height */
532 if ((BitmapInfoHeader->biWidth) && (BitmapInfoHeader->biHeight))
533 {
534 /* Do the BitBlt */
535 BitBlt(Left,
536 Top,
537 BitmapInfoHeader->biWidth,
538 BitmapInfoHeader->biHeight,
539 BitmapOffset,
540 BitmapInfoHeader->biBitCount,
541 Delta);
542 }
543 }
544}
VOID InitPaletteWithTable(_In_ PULONG Table, _In_ ULONG Count)
Definition: bootvid.c:172
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:57
static VOID RleBitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_ PUCHAR Buffer)
Definition: common.c:119
#define BI_RLE4
Definition: precomp.h:57
struct tagBITMAPINFOHEADER * PBITMAPINFOHEADER
#define ASSERT(a)
Definition: mode.c:44
long LONG
Definition: pedump.c:60
#define BV_MAX_COLORS
Definition: display.h:32
USHORT biBitCount
Definition: precomp.h:46
ULONG biCompression
Definition: precomp.h:47
uint32_t * PULONG
Definition: typedefs.h:59
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
static ULONG Delta
Definition: xboxvideo.c:33

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 453 of file common.c.

460{
461 /* Make sure we have a width and height */
462 if (!Width || !Height)
463 return;
464
465 /* Call the helper function */
466 BitBlt(Left, Top, Width, Height, Buffer, 4, Delta);
467}
_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 239 of file bootvid.c.

240{
242 while (TRUE);
243}
#define UNIMPLEMENTED
Definition: debug.h:115
#define TRUE
Definition: types.h:120

Referenced by InbvEnableBootDriver(), and InbvNotifyDisplayOwnershipLost().

◆ VidDisplayString()

VOID NTAPI VidDisplayString ( _In_z_ PUCHAR  String)

Definition at line 375 of file common.c.

377{
378 /* Start looping the string */
379 for (; *String; ++String)
380 {
381 /* Treat new-line separately */
382 if (*String == '\n')
383 {
384 /* Modify Y position */
387 {
388 /* Scroll the view and clear the current row */
392 }
393 else
394 {
395 /* Preserve the current row */
397 }
398
399 /* Update current X */
401
402 /* No need to clear this row */
403 ClearRow = FALSE;
404 }
405 else if (*String == '\r')
406 {
407 /* Update current X */
409
410 /* If a new-line does not follow we will clear the current row */
411 if (String[1] != '\n') ClearRow = TRUE;
412 }
413 else
414 {
415 /* Clear the current row if we had a return-carriage without a new-line */
416 if (ClearRow)
417 {
419 ClearRow = FALSE;
420 }
421
422 /* Display this character */
425
426 /* Check if we should scroll */
428 {
429 /* Update Y position and check if we should scroll it */
432 {
433 /* Scroll the view and clear the current row */
437 }
438 else
439 {
440 /* Preserve the current row */
442 }
443
444 /* Update current X */
446 }
447 }
448 }
449}
VOID PreserveRow(_In_ ULONG CurrentTop, _In_ ULONG TopDelta, _In_ BOOLEAN Restore)
Definition: bootvid.c:111
VOID DisplayCharacter(_In_ CHAR Character, _In_ ULONG Left, _In_ ULONG Top, _In_ ULONG TextColor, _In_ ULONG BackColor)
Definition: bootvid.c:19
VOID DoScroll(_In_ ULONG Scroll)
Definition: bootvid.c:64
#define FALSE
Definition: types.h:117
UCHAR VidpTextColor
Definition: common.c:14
ULONG VidpCurrentY
Definition: common.c:17
ULONG VidpCurrentX
Definition: common.c:16
ULONG VidpScrollRegion[4]
Definition: common.c:19
static BOOLEAN ClearRow
Definition: common.c:52
#define BOOTCHAR_HEIGHT
Definition: precomp.h:36
#define BOOTCHAR_WIDTH
Definition: precomp.h:37
#define BV_COLOR_NONE
Definition: display.h:31
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433

Referenced by InbvDisplayString().

◆ VidDisplayStringXY()

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

Definition at line 328 of file common.c.

333{
334 ULONG BackColor;
335
336 /*
337 * If the caller wanted transparent, then send the special value (16),
338 * else use our default and call the helper routine.
339 */
340 BackColor = Transparent ? BV_COLOR_NONE : BV_COLOR_LIGHT_CYAN;
341
342 /* Loop every character and adjust the position */
343 for (; *String; ++String, Left += BOOTCHAR_WIDTH)
344 {
345 /* Display a character */
346 DisplayCharacter(*String, Left, Top, BV_COLOR_LIGHT_BLUE, BackColor);
347 }
348}
#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 183 of file bootvid.c.

185{
186 DPRINT1("bv-arm v0.1\n");
187
188 //
189 // Allocate framebuffer
190 // 600kb works out to 640x480@16bpp
191 //
194 if (!VgaArmBase) return FALSE;
195
196 //
197 // Get physical address
198 //
200 if (!VgaPhysical.QuadPart) return FALSE;
201 DPRINT1("[BV-ARM] Frame Buffer @ 0x%p 0p%p\n", VgaArmBase, VgaPhysical.LowPart);
202
203 //
204 // Setup the display
205 //
207
208 //
209 // We are done!
210 //
211 return TRUE;
212}
PHYSICAL_ADDRESS VgaPhysical
Definition: bootvid.c:14
VOID VidpInitializeDisplay(VOID)
Definition: bootvid.c:147
PUSHORT VgaArmBase
Definition: bootvid.c:13
#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  HalReset)

Definition at line 216 of file bootvid.c.

218{
219 //
220 // Clear the current position
221 //
222 VidpCurrentX = 0;
223 VidpCurrentY = 0;
224
225 //
226 // Re-initialize the VGA Display
227 //
229
230 //
231 // Re-initialize the palette and fill the screen black
232 //
235}
VOID NTAPI VidSolidColorFill(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ UCHAR Color)
Definition: bootvid.c:261
#define InitializePalette()
Definition: precomp.h:77
#define SCREEN_WIDTH
Definition: pc98video.c:27
#define SCREEN_HEIGHT
Definition: pc98video.c:28
#define BV_COLOR_BLACK
Definition: display.h:15

Referenced by InbvResetDisplay(), and VidInitialize().

◆ VidScreenToBufferBlt()

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

Definition at line 247 of file bootvid.c.

254{
256 while (TRUE);
257}

Referenced by InbvScreenToBufferBlt().

◆ VidSetScrollRegion()

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

Definition at line 352 of file common.c.

357{
358 /* Assert alignment */
359 ASSERT((Left % BOOTCHAR_WIDTH) == 0);
360 ASSERT((Right % BOOTCHAR_WIDTH) == BOOTCHAR_WIDTH - 1);
361
362 /* Set Scroll Region */
363 VidpScrollRegion[0] = Left;
365 VidpScrollRegion[2] = Right;
367
368 /* Set current X and Y */
369 VidpCurrentX = Left;
371}
static LPHIST_ENTRY Bottom
Definition: history.c:54

Referenced by InbvSetScrollRegion().

◆ VidSetTextColor()

ULONG NTAPI VidSetTextColor ( _In_ ULONG  Color)

Definition at line 315 of file common.c.

317{
318 ULONG OldColor;
319
320 /* Save the old color and set the new one */
321 OldColor = VidpTextColor;
323 return OldColor;
324}

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 261 of file bootvid.c.

267{
268 int y, x;
269
270 //
271 // Loop along the Y-axis
272 //
273 for (y = Top; y <= Bottom; y++)
274 {
275 //
276 // Loop along the X-axis
277 //
278 for (x = Left; x <= Right; x++)
279 {
280 //
281 // Draw the pixel
282 //
283 SetPixel(x, y, Color);
284 }
285 }
286}
FORCEINLINE VOID SetPixel(_In_ ULONG Left, _In_ ULONG Top, _In_ UCHAR Color)
Definition: arm.h:55
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(), RleBitBlt(), VidCleanUp(), and VidResetDisplay().