ReactOS  0.4.15-dev-321-g2d9b385
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_ 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_ PUCHAR Buffer, _In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_ ULONG Delta)
 
VOID NTAPI VidDisplayString (_In_ PUCHAR String)
 
VOID NTAPI VidBitBlt (_In_ PUCHAR Buffer, _In_ ULONG Left, _In_ ULONG Top)
 
VOID NTAPI VidScreenToBufferBlt (_Out_ 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 466 of file common.c.

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

Referenced by BootLogoFadeIn(), and InbvBitBlt().

◆ VidBufferToScreenBlt()

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

Definition at line 448 of file common.c.

455 {
456  /* Make sure we have a width and height */
457  if (!Width || !Height)
458  return;
459 
460  /* Call the helper function */
461  BitBlt(Left, Top, Width, Height, Buffer, 4, Delta);
462 }
static VOID NTAPI BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_ PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:49
Definition: bufpool.h:45
static ULONG Delta
Definition: xboxvideo.c:32
static LPHIST_ENTRY Top
Definition: history.c:53

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_ PUCHAR  String)

Definition at line 370 of file common.c.

372 {
373  /* Start looping the string */
374  for (; *String; ++String)
375  {
376  /* Treat new-line separately */
377  if (*String == '\n')
378  {
379  /* Modify Y position */
382  {
383  /* Scroll the view and clear the current row */
387  }
388  else
389  {
390  /* Preserve the current row */
392  }
393 
394  /* Update current X */
396 
397  /* No need to clear this row */
398  ClearRow = FALSE;
399  }
400  else if (*String == '\r')
401  {
402  /* Update current X */
404 
405  /* If a new-line does not follow we will clear the current row */
406  if (String[1] != '\n') ClearRow = TRUE;
407  }
408  else
409  {
410  /* Clear the current row if we had a return-carriage without a new-line */
411  if (ClearRow)
412  {
414  ClearRow = FALSE;
415  }
416 
417  /* Display this character */
420 
421  /* Check if we should scroll */
423  {
424  /* Update Y position and check if we should scroll it */
427  {
428  /* Scroll the view and clear the current row */
432  }
433  else
434  {
435  /* Preserve the current row */
437  }
438 
439  /* Update current X */
441  }
442  }
443  }
444 }
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 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_ PUCHAR  String,
_In_ ULONG  Left,
_In_ ULONG  Top,
_In_ BOOLEAN  Transparent 
)

Definition at line 320 of file common.c.

325 {
326  ULONG BackColor;
327 
328  /*
329  * If the caller wanted transparent, then send the special value (16),
330  * else use our default and call the helper routine.
331  */
332  BackColor = Transparent ? BV_COLOR_NONE : BV_COLOR_LIGHT_CYAN;
333 
334  /* Loop every character and adjust the position */
335  for (; *String; ++String, Left += BOOTCHAR_WIDTH)
336  {
337  /* Display a character */
338  DisplayCharacter(*String, Left, Top, BV_COLOR_LIGHT_BLUE, BackColor);
339  }
340 }
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 }
#define TRUE
Definition: types.h:120
PUSHORT VgaArmBase
Definition: bootvid.c:6
VOID NTAPI VidpInitializeDisplay(VOID)
Definition: bootvid.c:144
PHYSICAL_ADDRESS VgaPhysical
Definition: bootvid.c:7
ULONG LowPart
Definition: typedefs.h:105
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:682
LONGLONG QuadPart
Definition: typedefs.h:113

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

349 {
350  /* Assert alignment */
351  ASSERT((Left % BOOTCHAR_WIDTH) == 0);
352  ASSERT((Right % BOOTCHAR_WIDTH) == BOOTCHAR_WIDTH - 1);
353 
354  /* Set Scroll Region */
355  VidpScrollRegion[0] = Left;
356  VidpScrollRegion[1] = Top;
357  VidpScrollRegion[2] = Right;
359 
360  /* Set current X and Y */
361  VidpCurrentX = Left;
362  VidpCurrentY = Top;
363 }
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 307 of file common.c.

309 {
310  ULONG OldColor;
311 
312  /* Save the old color and set the new one */
313  OldColor = VidpTextColor;
315  return OldColor;
316 }
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:263
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().