ReactOS 0.4.16-dev-2104-gb84fa49
precomp.h File Reference
#include <ntifs.h>
#include <ndk/halfuncs.h>
#include <drivers/bootvid/bootvid.h>
Include dependency graph for precomp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tagBITMAPINFOHEADER
 
struct  _URECT
 

Macros

#define BOOTCHAR_HEIGHT   13
 
#define BOOTCHAR_WIDTH   8
 
#define BI_RGB   0
 
#define BI_RLE4   2
 
#define RGB(r, g, b)   ((RGBQUAD)(((UCHAR)(b) | ((USHORT)((UCHAR)(g))<<8)) | (((ULONG)(UCHAR)(r))<<16)))
 
#define GetRValue(quad)   ((UCHAR)(((quad)>>16) & 0xFF))
 
#define GetGValue(quad)   ((UCHAR)(((quad)>>8) & 0xFF))
 
#define GetBValue(quad)   ((UCHAR)((quad) & 0xFF))
 
#define InitializePalette()   InitPaletteWithTable((PULONG)VidpDefaultPalette, BV_MAX_COLORS)
 
#define GetFontPtr(_Char)   (&VidpFontData[(_Char) * BOOTCHAR_HEIGHT])
 
#define FONT_PTR_DELTA   (1)
 

Typedefs

typedef struct tagBITMAPINFOHEADER BITMAPINFOHEADER
 
typedef struct tagBITMAPINFOHEADERPBITMAPINFOHEADER
 
typedef ULONG RGBQUAD
 
typedef struct _URECT URECT
 

Functions

VOID PreserveRow (_In_ ULONG CurrentTop, _In_ ULONG TopDelta, _In_ BOOLEAN Restore)
 
VOID DoScroll (_In_ ULONG Scroll)
 
VOID DisplayCharacter (_In_ CHAR Character, _In_ ULONG Left, _In_ ULONG Top, _In_ ULONG TextColor, _In_ ULONG BackColor)
 
VOID ResetDisplay (_In_ BOOLEAN SetMode)
 

Variables

UCHAR VidpTextColor
 
ULONG VidpCurrentX
 
ULONG VidpCurrentY
 
URECT VidpScrollRegion
 
const UCHAR VidpFontData [256 *BOOTCHAR_HEIGHT]
 
const RGBQUAD VidpDefaultPalette [BV_MAX_COLORS]
 

Macro Definition Documentation

◆ BI_RGB

#define BI_RGB   0

◆ BI_RLE4

#define BI_RLE4   2

◆ BOOTCHAR_HEIGHT

#define BOOTCHAR_HEIGHT   13

Definition at line 35 of file precomp.h.

◆ BOOTCHAR_WIDTH

#define BOOTCHAR_WIDTH   8

Definition at line 36 of file precomp.h.

◆ FONT_PTR_DELTA

#define FONT_PTR_DELTA   (1)

Definition at line 91 of file precomp.h.

◆ GetBValue

#define GetBValue (   quad)    ((UCHAR)((quad) & 0xFF))

Definition at line 82 of file precomp.h.

◆ GetFontPtr

#define GetFontPtr (   _Char)    (&VidpFontData[(_Char) * BOOTCHAR_HEIGHT])

Definition at line 90 of file precomp.h.

◆ GetGValue

#define GetGValue (   quad)    ((UCHAR)(((quad)>>8) & 0xFF))

Definition at line 81 of file precomp.h.

◆ GetRValue

#define GetRValue (   quad)    ((UCHAR)(((quad)>>16) & 0xFF))

Definition at line 80 of file precomp.h.

◆ InitializePalette

Definition at line 84 of file precomp.h.

◆ RGB

#define RGB (   r,
  g,
  b 
)    ((RGBQUAD)(((UCHAR)(b) | ((USHORT)((UCHAR)(g))<<8)) | (((ULONG)(UCHAR)(r))<<16)))

Definition at line 78 of file precomp.h.

Typedef Documentation

◆ BITMAPINFOHEADER

◆ PBITMAPINFOHEADER

◆ RGBQUAD

◆ URECT

typedef struct _URECT URECT

Function Documentation

◆ DisplayCharacter()

VOID DisplayCharacter ( _In_ CHAR  Character,
_In_ ULONG  Left,
_In_ ULONG  Top,
_In_ ULONG  TextColor,
_In_ ULONG  BackColor 
)

Definition at line 67 of file bootvid.c.

73{
74 const UCHAR* FontChar;
75 ULONG i, j, XOffset;
76
77 /* Get the font line for this character */
78 FontChar = &VidpFontData[Character * BOOTCHAR_HEIGHT - Top];
79
80 /* Loop each pixel height */
81 for (i = BOOTCHAR_HEIGHT; i > 0; --i)
82 {
83 /* Loop each pixel width */
84 XOffset = Left;
85 for (j = (1 << 7); j > 0; j >>= 1)
86 {
87 /* Check if we should draw this pixel */
88 if (FontChar[Top] & (UCHAR)j)
89 {
90 /* We do, use the given Text Color */
91 SetPixel(XOffset, Top, (UCHAR)TextColor);
92 }
93 else if (BackColor < BV_COLOR_NONE)
94 {
95 /*
96 * This is a background pixel. We're drawing it
97 * unless it's transparent.
98 */
99 SetPixel(XOffset, Top, (UCHAR)BackColor);
100 }
101
102 /* Increase X Offset */
103 XOffset++;
104 }
105
106 /* Move to the next Y ordinate */
107 Top++;
108 }
109}
FORCEINLINE VOID SetPixel(_In_ ULONG Left, _In_ ULONG Top, _In_ UCHAR Color)
Definition: bootvid.c:52
static LPHIST_ENTRY Top
Definition: history.c:53
#define BOOTCHAR_HEIGHT
Definition: precomp.h:35
const UCHAR VidpFontData[256 *BOOTCHAR_HEIGHT]
Definition: fontdata.c:16
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
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
#define BV_COLOR_NONE
Definition: display.h:31
uint32_t ULONG
Definition: typedefs.h:59
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by VidDisplayString(), and VidDisplayStringXY().

◆ DoScroll()

VOID DoScroll ( _In_ ULONG  Scroll)

Definition at line 112 of file bootvid.c.

114{
116 PUSHORT SourceOffset, DestOffset;
117 PUSHORT i, j;
118
119 /* Set memory positions of the scroll */
121 DestOffset = &SourceOffset[Scroll * (SCREEN_WIDTH / 8)];
122
123 /* Start loop */
125 {
126 /* Set number of bytes to loop and start offset */
128 j = SourceOffset;
129
130 /* Check if this is part of the scroll region */
131 if (Offset <= (VidpScrollRegion.Right >> 3))
132 {
133 /* Update position */
134 i = (PUSHORT)(DestOffset - SourceOffset);
135
136 /* Loop the X axis */
137 do
138 {
139 /* Write value in the new position so that we can do the scroll */
141
142 /* Move to the next memory location to write to */
143 j++;
144
145 /* Move to the next byte in the region */
146 Offset++;
147
148 /* Make sure we don't go past the scroll region */
149 } while (Offset <= (VidpScrollRegion.Right >> 3));
150 }
151
152 /* Move to the next line */
153 SourceOffset += (SCREEN_WIDTH / 8);
154 DestOffset += (SCREEN_WIDTH / 8);
155 }
156}
static PUSHORT VgaArmBase
Definition: bootvid.c:29
#define WRITE_REGISTER_USHORT(r, v)
Definition: arm.h:14
#define READ_REGISTER_USHORT(r)
Definition: arm.h:13
URECT VidpScrollRegion
Definition: console.c:17
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
#define SCREEN_WIDTH
Definition: pc98video.c:24
ULONG Right
Definition: precomp.h:64
ULONG Top
Definition: precomp.h:63
ULONG Bottom
Definition: precomp.h:65
ULONG Left
Definition: precomp.h:62
uint16_t * PUSHORT
Definition: typedefs.h:56
uint32_t ULONG_PTR
Definition: typedefs.h:65
_Must_inspect_result_ _In_ WDFMEMORY _In_ size_t SourceOffset
Definition: wdfmemory.h:320

Referenced by VidDisplayString().

◆ PreserveRow()

VOID PreserveRow ( _In_ ULONG  CurrentTop,
_In_ ULONG  TopDelta,
_In_ BOOLEAN  Restore 
)

Definition at line 159 of file bootvid.c.

163{
164 PUSHORT Position1, Position2;
165 ULONG Count;
166
167 /* Calculate the position in memory for the row */
168 if (Restore)
169 {
170 /* Restore the row by copying back the contents saved off-screen */
171 Position1 = &VgaArmBase[CurrentTop * (SCREEN_WIDTH / 8)];
172 Position2 = &VgaArmBase[SCREEN_HEIGHT * (SCREEN_WIDTH / 8)];
173 }
174 else
175 {
176 /* Preserve the row by saving its contents off-screen */
177 Position1 = &VgaArmBase[SCREEN_HEIGHT * (SCREEN_WIDTH / 8)];
178 Position2 = &VgaArmBase[CurrentTop * (SCREEN_WIDTH / 8)];
179 }
180
181 /* Set the count and loop every pixel */
182 Count = TopDelta * (SCREEN_WIDTH / 8);
183 while (Count--)
184 {
185 /* Write the data back on the other position */
186 WRITE_REGISTER_USHORT(Position1, READ_REGISTER_USHORT(Position2));
187
188 /* Increase both positions */
189 Position1++;
190 Position2++;
191 }
192}
int Count
Definition: noreturn.cpp:7
#define SCREEN_HEIGHT
Definition: pc98video.c:25

Referenced by VidDisplayString().

◆ ResetDisplay()

VOID ResetDisplay ( _In_ BOOLEAN  SetMode)

Definition at line 263 of file bootvid.c.

265{
266 /* Re-initialize the display */
268
269 /* Re-initialize the palette and fill the screen black */
272}
VOID NTAPI VidSolidColorFill(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Right, _In_ ULONG Bottom, _In_ UCHAR Color)
Definition: bootvid.c:298
VOID VidpInitializeDisplay(VOID)
Definition: bootvid.c:195
#define InitializePalette()
Definition: precomp.h:84
#define BV_COLOR_BLACK
Definition: display.h:15

Referenced by VidResetDisplay().

Variable Documentation

◆ VidpCurrentX

ULONG VidpCurrentX
extern

Definition at line 15 of file console.c.

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

◆ VidpCurrentY

ULONG VidpCurrentY
extern

Definition at line 16 of file console.c.

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

◆ VidpDefaultPalette

const RGBQUAD VidpDefaultPalette[BV_MAX_COLORS]
extern

Definition at line 19 of file common.c.

Referenced by InitPaletteWithTable(), and VidpBuildColor().

◆ VidpFontData

const UCHAR VidpFontData[256 *BOOTCHAR_HEIGHT]
extern

Definition at line 16 of file fontdata.c.

Referenced by DisplayCharacter().

◆ VidpScrollRegion

URECT VidpScrollRegion
extern

Definition at line 17 of file console.c.

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

◆ VidpTextColor

UCHAR VidpTextColor
extern

Definition at line 14 of file console.c.

Referenced by VidDisplayString(), and VidSetTextColor().