ReactOS  0.4.15-dev-1070-ge1a01de
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 470 of file common.c.

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

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

459 {
460  /* Make sure we have a width and height */
461  if (!Width || !Height)
462  return;
463 
464  /* Call the helper function */
465  BitBlt(Left, Top, Width, Height, Buffer, 4, Delta);
466 }
Definition: bufpool.h:45
static ULONG Delta
Definition: xboxvideo.c:33
static LPHIST_ENTRY Top
Definition: history.c:53
static VOID NTAPI 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:49

Referenced by InbvBufferToScreenBlt(), and InbvRotationThread().

◆ VidCleanUp()

VOID NTAPI VidCleanUp ( VOID  )

Definition at line 246 of file bootvid.c.

247 {
249  while (TRUE);
250 }
#define TRUE
Definition: types.h:120
#define UNIMPLEMENTED
Definition: debug.h:115

Referenced by InbvEnableBootDriver(), and InbvNotifyDisplayOwnershipLost().

◆ VidDisplayString()

VOID NTAPI VidDisplayString ( _In_z_ PUCHAR  String)

Definition at line 374 of file common.c.

376 {
377  /* Start looping the string */
378  for (; *String; ++String)
379  {
380  /* Treat new-line separately */
381  if (*String == '\n')
382  {
383  /* Modify Y position */
386  {
387  /* Scroll the view and clear the current row */
391  }
392  else
393  {
394  /* Preserve the current row */
396  }
397 
398  /* Update current X */
400 
401  /* No need to clear this row */
402  ClearRow = FALSE;
403  }
404  else if (*String == '\r')
405  {
406  /* Update current X */
408 
409  /* If a new-line does not follow we will clear the current row */
410  if (String[1] != '\n') ClearRow = TRUE;
411  }
412  else
413  {
414  /* Clear the current row if we had a return-carriage without a new-line */
415  if (ClearRow)
416  {
418  ClearRow = FALSE;
419  }
420 
421  /* Display this character */
424 
425  /* Check if we should scroll */
427  {
428  /* Update Y position and check if we should scroll it */
431  {
432  /* Scroll the view and clear the current row */
436  }
437  else
438  {
439  /* Preserve the current row */
441  }
442 
443  /* Update current X */
445  }
446  }
447  }
448 }
UCHAR VidpTextColor
Definition: common.c:5
#define TRUE
Definition: types.h:120
VOID NTAPI DisplayCharacter(_In_ CHAR Character, _In_ ULONG Left, _In_ ULONG Top, _In_ ULONG TextColor, _In_ ULONG BackColor)
Definition: bootvid.c:13
static WCHAR String[]
Definition: stringtable.c:55
ULONG VidpScrollRegion[4]
Definition: common.c:10
#define BOOTCHAR_HEIGHT
Definition: precomp.h:27
#define FALSE
Definition: types.h:117
#define BV_COLOR_NONE
Definition: display.h:31
static BOOLEAN ClearRow
Definition: common.c:43
VOID NTAPI DoScroll(_In_ ULONG Scroll)
Definition: bootvid.c:59
ULONG VidpCurrentY
Definition: common.c:8
#define BOOTCHAR_WIDTH
Definition: precomp.h:28
VOID NTAPI PreserveRow(_In_ ULONG CurrentTop, _In_ ULONG TopDelta, _In_ BOOLEAN Restore)
Definition: bootvid.c:107
ULONG VidpCurrentX
Definition: common.c:7

Referenced by InbvDisplayString().

◆ VidDisplayStringXY()

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

Definition at line 324 of file common.c.

329 {
330  ULONG BackColor;
331 
332  /*
333  * If the caller wanted transparent, then send the special value (16),
334  * else use our default and call the helper routine.
335  */
336  BackColor = Transparent ? BV_COLOR_NONE : BV_COLOR_LIGHT_CYAN;
337 
338  /* Loop every character and adjust the position */
339  for (; *String; ++String, Left += BOOTCHAR_WIDTH)
340  {
341  /* Display a character */
342  DisplayCharacter(*String, Left, Top, BV_COLOR_LIGHT_BLUE, BackColor);
343  }
344 }
VOID NTAPI DisplayCharacter(_In_ CHAR Character, _In_ ULONG Left, _In_ ULONG Top, _In_ ULONG TextColor, _In_ ULONG BackColor)
Definition: bootvid.c:13
static WCHAR String[]
Definition: stringtable.c:55
#define BV_COLOR_NONE
Definition: display.h:31
#define BV_COLOR_LIGHT_CYAN
Definition: display.h:29
#define BV_COLOR_LIGHT_BLUE
Definition: display.h:27
unsigned int ULONG
Definition: retypes.h:1
static LPHIST_ENTRY Top
Definition: history.c:53
#define BOOTCHAR_WIDTH
Definition: precomp.h:28

◆ VidInitialize()

BOOLEAN NTAPI VidInitialize ( _In_ BOOLEAN  SetMode)

Definition at line 184 of file bootvid.c.

186 {
187  DPRINT1("bv-arm v0.1\n");
188 
189  //
190  // Allocate framebuffer
191  // 600kb works out to 640x480@16bpp
192  //
193  VgaPhysical.QuadPart = -1;
195  if (!VgaArmBase) return FALSE;
196 
197  //
198  // Get physical address
199  //
201  if (!VgaPhysical.QuadPart) return FALSE;
202  DPRINT1("[BV-ARM] Frame Buffer @ 0x%p 0p%p\n", VgaArmBase, VgaPhysical.LowPart);
203 
204  //
205  // Setup the display
206  //
208 
209  //
210  // We are done!
211  //
212  return TRUE;
213 }
PUSHORT VgaArmBase
Definition: bootvid.c:6
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
VOID NTAPI VidpInitializeDisplay(VOID)
Definition: bootvid.c:144
PHYSICAL_ADDRESS VgaPhysical
Definition: bootvid.c:7
ULONG LowPart
Definition: typedefs.h:106
PVOID NTAPI MmAllocateContiguousMemory(IN SIZE_T NumberOfBytes, IN PHYSICAL_ADDRESS HighestAcceptableAddress)
Definition: contmem.c:626
#define DPRINT1
Definition: precomp.h:8
PHYSICAL_ADDRESS NTAPI MmGetPhysicalAddress(IN PVOID Address)
Definition: stubs.c:685
LONGLONG QuadPart
Definition: typedefs.h:114

Referenced by InbvDriverInitialize().

◆ VidResetDisplay()

VOID NTAPI VidResetDisplay ( _In_ BOOLEAN  HalReset)

Definition at line 220 of file bootvid.c.

222 {
223  //
224  // Clear the current position
225  //
226  VidpCurrentX = 0;
227  VidpCurrentY = 0;
228 
229  //
230  // Re-initialize the VGA Display
231  //
233 
234  //
235  // Re-initialize the palette and fill the screen black
236  //
239 }
#define SCREEN_WIDTH
Definition: pc98video.c:27
VOID NTAPI VidpInitializeDisplay(VOID)
Definition: bootvid.c:144
#define SCREEN_HEIGHT
Definition: pc98video.c:28
ULONG VidpCurrentY
Definition: common.c:8
VOID NTAPI VidSolidColorFill(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ UCHAR Color)
Definition: bootvid.c:274
#define BV_COLOR_BLACK
Definition: display.h:15
ULONG VidpCurrentX
Definition: common.c:7
#define InitializePalette()
Definition: precomp.h:68

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

264 {
266  while (TRUE);
267 }
#define TRUE
Definition: types.h:120
#define UNIMPLEMENTED
Definition: debug.h:115

Referenced by InbvScreenToBufferBlt().

◆ VidSetScrollRegion()

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

Definition at line 348 of file common.c.

353 {
354  /* Assert alignment */
355  ASSERT((Left % BOOTCHAR_WIDTH) == 0);
356  ASSERT((Right % BOOTCHAR_WIDTH) == BOOTCHAR_WIDTH - 1);
357 
358  /* Set Scroll Region */
359  VidpScrollRegion[0] = Left;
360  VidpScrollRegion[1] = Top;
361  VidpScrollRegion[2] = Right;
363 
364  /* Set current X and Y */
365  VidpCurrentX = Left;
366  VidpCurrentY = Top;
367 }
ULONG VidpScrollRegion[4]
Definition: common.c:10
ULONG VidpCurrentY
Definition: common.c:8
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
static LPHIST_ENTRY Bottom
Definition: history.c:54
static LPHIST_ENTRY Top
Definition: history.c:53
#define BOOTCHAR_WIDTH
Definition: precomp.h:28
ULONG VidpCurrentX
Definition: common.c:7

Referenced by InbvSetScrollRegion().

◆ VidSetTextColor()

ULONG NTAPI VidSetTextColor ( _In_ ULONG  Color)

Definition at line 311 of file common.c.

313 {
314  ULONG OldColor;
315 
316  /* Save the old color and set the new one */
317  OldColor = VidpTextColor;
319  return OldColor;
320 }
UCHAR VidpTextColor
Definition: common.c:5
struct Color Color
unsigned int ULONG
Definition: retypes.h:1

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

280 {
281  int y, x;
282 
283  //
284  // Loop along the Y-axis
285  //
286  for (y = Top; y <= Bottom; y++)
287  {
288  //
289  // Loop along the X-axis
290  //
291  for (x = Left; x <= Right; x++)
292  {
293  //
294  // Draw the pixel
295  //
296  SetPixel(x, y, Color);
297  }
298  }
299 }
VOID SetPixel(_In_ ULONG Left, _In_ ULONG Top, _In_ UCHAR Color)
Definition: bootvid.c:265
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static LPHIST_ENTRY Bottom
Definition: history.c:54
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
static LPHIST_ENTRY Top
Definition: history.c:53

Referenced by FinalizeBootLogo(), InbvRotationThread(), InbvSolidColorFill(), InbvUpdateProgressBar(), RleBitBlt(), VidCleanUp(), and VidResetDisplay().