ReactOS  0.4.13-dev-455-g28ed234
bootvid.c File Reference
#include "precomp.h"
#include <debug.h>
Include dependency graph for bootvid.c:

Go to the source code of this file.

Classes

struct  _VGA_COLOR
 

Macros

#define NDEBUG
 
#define LCDTIMING0_PPL(x)   ((((x) / 16 - 1) & 0x3f) << 2)
 
#define LCDTIMING1_LPP(x)   (((x) & 0x3ff) - 1)
 
#define LCDCONTROL_LCDPWR   (1 << 11)
 
#define LCDCONTROL_LCDEN   (1)
 
#define LCDCONTROL_LCDBPP(x)   (((x) & 7) << 1)
 
#define LCDCONTROL_LCDTFT   (1 << 5)
 
#define PL110_LCDTIMING0   (PVOID)0xE0020000
 
#define PL110_LCDTIMING1   (PVOID)0xE0020004
 
#define PL110_LCDTIMING2   (PVOID)0xE0020008
 
#define PL110_LCDUPBASE   (PVOID)0xE0020010
 
#define PL110_LCDLPBASE   (PVOID)0xE0020014
 
#define PL110_LCDCONTROL   (PVOID)0xE0020018
 
#define READ_REGISTER_ULONG(r)   (*(volatile ULONG * const)(r))
 
#define WRITE_REGISTER_ULONG(r, v)   (*(volatile ULONG *)(r) = (v))
 
#define READ_REGISTER_USHORT(r)   (*(volatile USHORT * const)(r))
 
#define WRITE_REGISTER_USHORT(r, v)   (*(volatile USHORT *)(r) = (v))
 

Typedefs

typedef struct _VGA_COLOR VGA_COLOR
 

Functions

USHORT FORCEINLINE VidpBuildColor (IN UCHAR Color)
 
VOID FORCEINLINE VidpSetPixel (IN ULONG Left, IN ULONG Top, IN UCHAR Color)
 
VOID NTAPI DisplayCharacter (IN CHAR Character, IN ULONG Left, IN ULONG Top, IN ULONG TextColor, IN ULONG BackTextColor)
 
VOID NTAPI VgaScroll (IN ULONG Scroll)
 
VOID NTAPI PreserveRow (IN ULONG CurrentTop, IN ULONG TopDelta, IN BOOLEAN Direction)
 
VOID NTAPI VidpInitializeDisplay (VOID)
 
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 (IN 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)
 

Variables

PUSHORT VgaArmBase
 
PHYSICAL_ADDRESS VgaPhysical
 
BOOLEAN NextLine = FALSE
 
UCHAR VidpTextColor = 0xF
 
ULONG VidpCurrentX = 0
 
ULONG VidpCurrentY = 0
 
ULONG VidpScrollRegion [4]
 
VGA_COLOR VidpVga8To16BitTransform [16]
 

Macro Definition Documentation

◆ LCDCONTROL_LCDBPP

#define LCDCONTROL_LCDBPP (   x)    (((x) & 7) << 1)

Definition at line 10 of file bootvid.c.

◆ LCDCONTROL_LCDEN

#define LCDCONTROL_LCDEN   (1)

Definition at line 9 of file bootvid.c.

◆ LCDCONTROL_LCDPWR

#define LCDCONTROL_LCDPWR   (1 << 11)

Definition at line 8 of file bootvid.c.

◆ LCDCONTROL_LCDTFT

#define LCDCONTROL_LCDTFT   (1 << 5)

Definition at line 11 of file bootvid.c.

◆ LCDTIMING0_PPL

#define LCDTIMING0_PPL (   x)    ((((x) / 16 - 1) & 0x3f) << 2)

Definition at line 6 of file bootvid.c.

◆ LCDTIMING1_LPP

#define LCDTIMING1_LPP (   x)    (((x) & 0x3ff) - 1)

Definition at line 7 of file bootvid.c.

◆ NDEBUG

#define NDEBUG

Definition at line 3 of file bootvid.c.

◆ PL110_LCDCONTROL

#define PL110_LCDCONTROL   (PVOID)0xE0020018

Definition at line 18 of file bootvid.c.

◆ PL110_LCDLPBASE

#define PL110_LCDLPBASE   (PVOID)0xE0020014

Definition at line 17 of file bootvid.c.

◆ PL110_LCDTIMING0

#define PL110_LCDTIMING0   (PVOID)0xE0020000

Definition at line 13 of file bootvid.c.

◆ PL110_LCDTIMING1

#define PL110_LCDTIMING1   (PVOID)0xE0020004

Definition at line 14 of file bootvid.c.

◆ PL110_LCDTIMING2

#define PL110_LCDTIMING2   (PVOID)0xE0020008

Definition at line 15 of file bootvid.c.

◆ PL110_LCDUPBASE

#define PL110_LCDUPBASE   (PVOID)0xE0020010

Definition at line 16 of file bootvid.c.

◆ READ_REGISTER_ULONG

#define READ_REGISTER_ULONG (   r)    (*(volatile ULONG * const)(r))

Definition at line 20 of file bootvid.c.

◆ READ_REGISTER_USHORT

#define READ_REGISTER_USHORT (   r)    (*(volatile USHORT * const)(r))

Definition at line 23 of file bootvid.c.

◆ WRITE_REGISTER_ULONG

#define WRITE_REGISTER_ULONG (   r,
  v 
)    (*(volatile ULONG *)(r) = (v))

Definition at line 21 of file bootvid.c.

◆ WRITE_REGISTER_USHORT

#define WRITE_REGISTER_USHORT (   r,
  v 
)    (*(volatile USHORT *)(r) = (v))

Definition at line 24 of file bootvid.c.

Typedef Documentation

◆ VGA_COLOR

Function Documentation

◆ DisplayCharacter()

VOID NTAPI DisplayCharacter ( IN CHAR  Character,
IN ULONG  Left,
IN ULONG  Top,
IN ULONG  TextColor,
IN ULONG  BackTextColor 
)

Definition at line 110 of file bootvid.c.

115 {
116  PUCHAR FontChar;
117  ULONG i, j, XOffset;
118 
119  /* Get the font line for this character */
120  FontChar = &FontData[Character * 13 - Top];
121 
122  /* Loop each pixel height */
123  i = 13;
124  do
125  {
126  /* Loop each pixel width */
127  j = 128;
128  XOffset = Left;
129  do
130  {
131  /* Check if we should draw this pixel */
132  if (FontChar[Top] & (UCHAR)j)
133  {
134  /* We do, use the given Text Color */
135  VidpSetPixel(XOffset, Top, (UCHAR)TextColor);
136  }
137  else if (BackTextColor < 16)
138  {
139  /* This is a background pixel. We're drawing it unless it's */
140  /* transparent. */
141  VidpSetPixel(XOffset, Top, (UCHAR)BackTextColor);
142  }
143 
144  /* Increase X Offset */
145  XOffset++;
146  } while (j >>= 1);
147 
148  /* Move to the next Y ordinate */
149  Top++;
150  } while (--i);
151 }
unsigned char * PUCHAR
Definition: retypes.h:3
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
VOID FORCEINLINE VidpSetPixel(IN ULONG Left, IN ULONG Top, IN UCHAR Color)
Definition: bootvid.c:91
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
unsigned char UCHAR
Definition: xmlstorage.h:181
UCHAR FontData[256 *BOOTCHAR_HEIGHT]
Definition: bootdata.c:57
unsigned int ULONG
Definition: retypes.h:1
static LPHIST_ENTRY Top
Definition: history.c:53

Referenced by VidDisplayString().

◆ PreserveRow()

VOID NTAPI PreserveRow ( IN ULONG  CurrentTop,
IN ULONG  TopDelta,
IN BOOLEAN  Direction 
)

Definition at line 211 of file bootvid.c.

214 {
215  PUSHORT Position1, Position2;
216  ULONG Count;
217 
218  /* Check which way we're preserving */
219  if (Direction)
220  {
221  /* Calculate the position in memory for the row */
222  Position1 = &VgaArmBase[CurrentTop * 80];
223  Position2 = &VgaArmBase[0x9600];
224  }
225  else
226  {
227  /* Calculate the position in memory for the row */
228  Position1 = &VgaArmBase[0x9600];
229  Position2 = &VgaArmBase[CurrentTop * 80];
230  }
231 
232  /* Set the count and loop every pixel */
233  Count = TopDelta * 80;
234  while (Count--)
235  {
236  /* Write the data back on the other position */
237  WRITE_REGISTER_USHORT(Position1, READ_REGISTER_USHORT(Position2));
238 
239  /* Increase both positions */
240  Position1++;
241  Position2++;
242  }
243 }
PUSHORT VgaArmBase
Definition: bootvid.c:26
#define READ_REGISTER_USHORT(r)
Definition: bootvid.c:23
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
#define WRITE_REGISTER_USHORT(r, v)
Definition: bootvid.c:24
_Inout_ PSIZE_T _In_opt_ PMDLX _In_ MM_ROTATE_DIRECTION Direction
Definition: mmfuncs.h:773
unsigned int ULONG
Definition: retypes.h:1
unsigned short * PUSHORT
Definition: retypes.h:2

Referenced by VidDisplayString().

◆ VgaScroll()

VOID NTAPI VgaScroll ( IN ULONG  Scroll)

Definition at line 155 of file bootvid.c.

156 {
157  ULONG Top, Offset;
158  PUSHORT SourceOffset, DestOffset;
159  PUSHORT i, j;
160 
161  /* Set memory positions of the scroll */
162  SourceOffset = &VgaArmBase[(VidpScrollRegion[1] * 80) + (VidpScrollRegion[0] >> 3)];
163  DestOffset = &SourceOffset[Scroll * 80];
164 
165  /* Save top and check if it's above the bottom */
166  Top = VidpScrollRegion[1];
167  if (Top > VidpScrollRegion[3]) return;
168 
169  /* Start loop */
170  do
171  {
172  /* Set number of bytes to loop and start offset */
173  Offset = VidpScrollRegion[0] >> 3;
174  j = SourceOffset;
175 
176  /* Check if this is part of the scroll region */
177  if (Offset <= (VidpScrollRegion[2] >> 3))
178  {
179  /* Update position */
180  i = (PUSHORT)(DestOffset - SourceOffset);
181 
182  /* Loop the X axis */
183  do
184  {
185  /* Write value in the new position so that we can do the scroll */
187 
188  /* Move to the next memory location to write to */
189  j++;
190 
191  /* Move to the next byte in the region */
192  Offset++;
193 
194  /* Make sure we don't go past the scroll region */
195  } while (Offset <= (VidpScrollRegion[2] >> 3));
196  }
197 
198  /* Move to the next line */
199  SourceOffset += 80;
200  DestOffset += 80;
201 
202  /* Increase top */
203  Top++;
204 
205  /* Make sure we don't go past the scroll region */
206  } while (Top <= VidpScrollRegion[3]);
207 }
PUSHORT VgaArmBase
Definition: bootvid.c:26
#define READ_REGISTER_USHORT(r)
Definition: bootvid.c:23
ULONG VidpScrollRegion[4]
Definition: bootvid.c:32
uint32_t ULONG_PTR
Definition: typedefs.h:63
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
#define WRITE_REGISTER_USHORT(r, v)
Definition: bootvid.c:24
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
_In_ UINT _In_ UINT _In_ PNDIS_PACKET _In_ UINT SourceOffset
Definition: ndis.h:3167
unsigned int ULONG
Definition: retypes.h:1
static LPHIST_ENTRY Top
Definition: history.c:53
unsigned short * PUSHORT
Definition: retypes.h:2

Referenced by VidDisplayString().

◆ VidBitBlt()

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

Definition at line 509 of file bootvid.c.

512 {
514  //while (TRUE);
515 }
#define UNIMPLEMENTED
Definition: debug.h:114

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

415 {
417  while (TRUE);
418 }
#define TRUE
Definition: types.h:120
#define UNIMPLEMENTED
Definition: debug.h:114

Referenced by InbvBufferToScreenBlt(), and InbvRotationThread().

◆ VidCleanUp()

VOID NTAPI VidCleanUp ( VOID  )

Definition at line 398 of file bootvid.c.

399 {
401  while (TRUE);
402 }
#define TRUE
Definition: types.h:120
#define UNIMPLEMENTED
Definition: debug.h:114

Referenced by InbvEnableBootDriver(), and InbvNotifyDisplayOwnershipLost().

◆ VidDisplayString()

VOID NTAPI VidDisplayString ( IN PUCHAR  String)

Definition at line 425 of file bootvid.c.

426 {
427  ULONG TopDelta = 14;
428 
429  /* Start looping the string */
430  while (*String)
431  {
432  /* Treat new-line separately */
433  if (*String == '\n')
434  {
435  /* Modify Y position */
436  VidpCurrentY += TopDelta;
437  if (VidpCurrentY >= VidpScrollRegion[3])
438  {
439  /* Scroll the view */
440  VgaScroll(TopDelta);
441  VidpCurrentY -= TopDelta;
442 
443  /* Preserve row */
444  PreserveRow(VidpCurrentY, TopDelta, TRUE);
445  }
446 
447  /* Update current X */
449 
450  /* Preserve the current row */
451  PreserveRow(VidpCurrentY, TopDelta, FALSE);
452  }
453  else if (*String == '\r')
454  {
455  /* Update current X */
457 
458  /* Check if we're being followed by a new line */
459  if (String[1] != '\n') NextLine = TRUE;
460  }
461  else
462  {
463  /* Check if we had a \n\r last time */
464  if (NextLine)
465  {
466  /* We did, preserve the current row */
467  PreserveRow(VidpCurrentY, TopDelta, TRUE);
468  NextLine = FALSE;
469  }
470 
471  /* Display this character */
473  VidpCurrentX,
474  VidpCurrentY,
476  16);
477  VidpCurrentX += 8;
478 
479  /* Check if we should scroll */
481  {
482  /* Update Y position and check if we should scroll it */
483  VidpCurrentY += TopDelta;
485  {
486  /* Do the scroll */
487  VgaScroll(TopDelta);
488  VidpCurrentY -= TopDelta;
489 
490  /* Save the row */
491  PreserveRow(VidpCurrentY, TopDelta, TRUE);
492  }
493 
494  /* Update X */
496  }
497  }
498 
499  /* Get the next character */
500  String++;
501  }
502 }
VOID NTAPI DisplayCharacter(IN CHAR Character, IN ULONG Left, IN ULONG Top, IN ULONG TextColor, IN ULONG BackTextColor)
Definition: bootvid.c:110
#define TRUE
Definition: types.h:120
ULONG VidpScrollRegion[4]
Definition: bootvid.c:32
static WCHAR String[]
Definition: stringtable.c:55
VOID NTAPI PreserveRow(IN ULONG CurrentTop, IN ULONG TopDelta, IN BOOLEAN Direction)
Definition: bootvid.c:211
VOID NTAPI VgaScroll(IN ULONG Scroll)
Definition: bootvid.c:155
UCHAR VidpTextColor
Definition: bootvid.c:29
ULONG VidpCurrentY
Definition: bootvid.c:31
ULONG VidpCurrentX
Definition: bootvid.c:30
unsigned int ULONG
Definition: retypes.h:1
BOOLEAN NextLine
Definition: bootvid.c:28

Referenced by InbvDisplayString().

◆ VidDisplayStringXY()

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

Definition at line 359 of file bootvid.c.

363 {
365  while (TRUE);
366 }
#define TRUE
Definition: types.h:120
#define UNIMPLEMENTED
Definition: debug.h:114

◆ VidInitialize()

BOOLEAN NTAPI VidInitialize ( IN BOOLEAN  SetMode)

Definition at line 278 of file bootvid.c.

279 {
280  DPRINT1("bv-arm v0.1\n");
281 
282  //
283  // Allocate framebuffer
284  // 600kb works out to 640x480@16bpp
285  //
286  VgaPhysical.QuadPart = -1;
288  if (!VgaArmBase) return FALSE;
289 
290  //
291  // Get physical address
292  //
294  if (!VgaPhysical.QuadPart) return FALSE;
295  DPRINT1("[BV-ARM] Frame Buffer @ 0x%p 0p%p\n", VgaArmBase, VgaPhysical.LowPart);
296 
297  //
298  // Setup the display
299  //
301 
302  //
303  // We are done!
304  //
305  return TRUE;
306 }
#define TRUE
Definition: types.h:120
PUSHORT VgaArmBase
Definition: bootvid.c:26
VOID NTAPI VidpInitializeDisplay(VOID)
Definition: bootvid.c:247
PHYSICAL_ADDRESS VgaPhysical
Definition: bootvid.c:27
ULONG LowPart
Definition: typedefs.h:104
PVOID NTAPI MmAllocateContiguousMemory(IN SIZE_T NumberOfBytes, IN PHYSICAL_ADDRESS HighestAcceptableAddress)
Definition: contmem.c:621
#define DPRINT1
Definition: precomp.h:8
PHYSICAL_ADDRESS NTAPI MmGetPhysicalAddress(IN PVOID Address)
Definition: stubs.c:682
LONGLONG QuadPart
Definition: typedefs.h:112

Referenced by InbvDriverInitialize().

◆ VidpBuildColor()

USHORT FORCEINLINE VidpBuildColor ( IN UCHAR  Color)

Definition at line 71 of file bootvid.c.

72 {
73  UCHAR Red, Green, Blue;
74 
75  //
76  // Extract color components
77  //
81 
82  //
83  // Build the 16-bit color mask
84  //
85  return ((Red & 0x1F) << 11) | ((Green & 0x1F) << 6) | ((Blue & 0x1F));
86 }
Definition: bl.h:202
UCHAR Green
Definition: bootvid.c:43
UCHAR Red
Definition: bootvid.c:42
VGA_COLOR VidpVga8To16BitTransform[16]
Definition: bootvid.c:47
Definition: bl.h:199
struct Color Color
UCHAR Blue
Definition: bootvid.c:44
Definition: bl.h:200
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by VidpSetPixel().

◆ VidpInitializeDisplay()

VOID NTAPI VidpInitializeDisplay ( VOID  )

Definition at line 247 of file bootvid.c.

248 {
249  //
250  // Set framebuffer address
251  //
254 
255  //
256  // Initialize timings to 640x480
257  //
260 
261  //
262  // Enable the LCD Display
263  //
268  LCDCONTROL_LCDBPP(4));
269 }
#define PL110_LCDLPBASE
Definition: bootvid.c:17
#define PL110_LCDUPBASE
Definition: bootvid.c:16
#define PL110_LCDTIMING1
Definition: bootvid.c:14
#define PL110_LCDCONTROL
Definition: bootvid.c:18
PHYSICAL_ADDRESS VgaPhysical
Definition: bootvid.c:27
#define LCDTIMING0_PPL(x)
Definition: bootvid.c:6
#define WRITE_REGISTER_ULONG(r, v)
Definition: bootvid.c:21
#define LCDCONTROL_LCDTFT
Definition: bootvid.c:11
#define LCDTIMING1_LPP(x)
Definition: bootvid.c:7
ULONG LowPart
Definition: typedefs.h:104
#define LCDCONTROL_LCDEN
Definition: bootvid.c:9
#define LCDCONTROL_LCDBPP(x)
Definition: bootvid.c:10
#define PL110_LCDTIMING0
Definition: bootvid.c:13
#define LCDCONTROL_LCDPWR
Definition: bootvid.c:8

Referenced by VidInitialize(), and VidResetDisplay().

◆ VidpSetPixel()

VOID FORCEINLINE VidpSetPixel ( IN ULONG  Left,
IN ULONG  Top,
IN UCHAR  Color 
)

Definition at line 91 of file bootvid.c.

94 {
95  PUSHORT PixelPosition;
96 
97  //
98  // Calculate the pixel position
99  //
100  PixelPosition = &VgaArmBase[Left + (Top * 640)];
101 
102  //
103  // Set our color
104  //
105  WRITE_REGISTER_USHORT(PixelPosition, VidpBuildColor(Color));
106 }
PUSHORT VgaArmBase
Definition: bootvid.c:26
USHORT FORCEINLINE VidpBuildColor(IN UCHAR Color)
Definition: bootvid.c:71
#define WRITE_REGISTER_USHORT(r, v)
Definition: bootvid.c:24
static LPHIST_ENTRY Top
Definition: history.c:53
unsigned short * PUSHORT
Definition: retypes.h:2

Referenced by DisplayCharacter(), and VidSolidColorFill().

◆ VidResetDisplay()

VOID NTAPI VidResetDisplay ( IN BOOLEAN  HalReset)

Definition at line 313 of file bootvid.c.

314 {
315  //
316  // Clear the current position
317  //
318  VidpCurrentX = 0;
319  VidpCurrentY = 0;
320 
321  //
322  // Re-initialize the VGA Display
323  //
325 
326  //
327  // Re-initialize the palette and fill the screen black
328  //
329  //InitializePalette();
330  VidSolidColorFill(0, 0, 639, 479, 0);
331 }
VOID NTAPI VidpInitializeDisplay(VOID)
Definition: bootvid.c:247
ULONG VidpCurrentY
Definition: bootvid.c:31
VOID NTAPI VidSolidColorFill(IN ULONG Left, IN ULONG Top, IN ULONG Right, IN ULONG Bottom, IN UCHAR Color)
Definition: bootvid.c:538
ULONG VidpCurrentX
Definition: bootvid.c:30

Referenced by InbvResetDisplay().

◆ VidScreenToBufferBlt()

VOID NTAPI VidScreenToBufferBlt ( IN PUCHAR  Buffer,
IN ULONG  Left,
IN ULONG  Top,
IN ULONG  Width,
IN ULONG  Height,
IN ULONG  Delta 
)

Definition at line 522 of file bootvid.c.

528 {
530  while (TRUE);
531 }
#define TRUE
Definition: types.h:120
#define UNIMPLEMENTED
Definition: debug.h:114

Referenced by InbvScreenToBufferBlt().

◆ VidSetScrollRegion()

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

Definition at line 373 of file bootvid.c.

377 {
378  /* Assert alignment */
379  ASSERT((Left & 0x7) == 0);
380  ASSERT((Right & 0x7) == 7);
381 
382  /* Set Scroll Region */
383  VidpScrollRegion[0] = Left;
384  VidpScrollRegion[1] = Top;
385  VidpScrollRegion[2] = Right;
387 
388  /* Set current X and Y */
389  VidpCurrentX = Left;
390  VidpCurrentY = Top;
391 }
ULONG VidpScrollRegion[4]
Definition: bootvid.c:32
ULONG VidpCurrentY
Definition: bootvid.c:31
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
static LPHIST_ENTRY Bottom
Definition: history.c:54
ULONG VidpCurrentX
Definition: bootvid.c:30
static LPHIST_ENTRY Top
Definition: history.c:53

Referenced by InbvSetScrollRegion().

◆ VidSetTextColor()

ULONG NTAPI VidSetTextColor ( IN ULONG  Color)

Definition at line 338 of file bootvid.c.

339 {
340  UCHAR OldColor;
341 
342  //
343  // Save the old, set the new
344  //
345  OldColor = VidpTextColor;
347 
348  //
349  // Return the old text color
350  //
351  return OldColor;
352 }
struct Color Color
UCHAR VidpTextColor
Definition: bootvid.c:29
unsigned char UCHAR
Definition: xmlstorage.h:181

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

543 {
544  int y, x;
545 
546  //
547  // Loop along the Y-axis
548  //
549  for (y = Top; y <= Bottom; y++)
550  {
551  //
552  // Loop along the X-axis
553  //
554  for (x = Left; x <= Right; x++)
555  {
556  //
557  // Draw the pixel
558  //
559  VidpSetPixel(x, y, Color);
560  }
561  }
562 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
VOID FORCEINLINE VidpSetPixel(IN ULONG Left, IN ULONG Top, IN UCHAR Color)
Definition: bootvid.c:91
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(), and VidResetDisplay().

Variable Documentation

◆ NextLine

◆ VgaArmBase

PUSHORT VgaArmBase

Definition at line 26 of file bootvid.c.

Referenced by PreserveRow(), VgaScroll(), VidInitialize(), and VidpSetPixel().

◆ VgaPhysical

PHYSICAL_ADDRESS VgaPhysical

Definition at line 27 of file bootvid.c.

Referenced by VidInitialize(), and VidpInitializeDisplay().

◆ VidpCurrentX

ULONG VidpCurrentX = 0

Definition at line 30 of file bootvid.c.

Referenced by VidDisplayString(), VidResetDisplay(), and VidSetScrollRegion().

◆ VidpCurrentY

ULONG VidpCurrentY = 0

Definition at line 31 of file bootvid.c.

Referenced by VidDisplayString(), VidResetDisplay(), and VidSetScrollRegion().

◆ VidpScrollRegion

ULONG VidpScrollRegion[4]
Initial value:
=
{
0,
0,
640 - 1,
480 - 1
}

Definition at line 32 of file bootvid.c.

Referenced by VgaScroll(), VidDisplayString(), and VidSetScrollRegion().

◆ VidpTextColor

UCHAR VidpTextColor = 0xF

Definition at line 29 of file bootvid.c.

Referenced by VidDisplayString(), and VidSetTextColor().

◆ VidpVga8To16BitTransform

VGA_COLOR VidpVga8To16BitTransform[16]
Initial value:
=
{
{0x00, 0x00, 0x00},
{0x00, 0x00, 0x08},
{0x00, 0x08, 0x00},
{0x00, 0x08, 0x08},
{0x08, 0x00, 0x00},
{0x08, 0x00, 0x08},
{0x0B, 0x0D, 0x0F},
{0x10, 0x10, 0x10},
{0x08, 0x08, 0x08},
{0x00, 0x00, 0x1F},
{0x00, 0x1F, 0x00},
{0x00, 0x1F, 0x1F},
{0x1F, 0x00, 0x00},
{0x1F, 0x00, 0x1F},
{0x1F, 0x1F, 0x00},
{0x1F, 0x1F, 0x1F},
}

Definition at line 47 of file bootvid.c.

Referenced by VidpBuildColor().