ReactOS  0.4.14-dev-41-g31d7680
vga.c File Reference
#include "precomp.h"
Include dependency graph for vga.c:

Go to the source code of this file.

Macros

#define SET_PIXELS(_PixelPtr, _PixelMask, _TextColor)
 
#define GetFontPtr(_Char)   &FontData[_Char * BOOTCHAR_HEIGHT];
 
#define FONT_PTR_DELTA   (1)
 

Functions

static VOID NTAPI ReadWriteMode (IN UCHAR Mode)
 
FORCEINLINE VOID SetPixel (IN ULONG Left, IN ULONG Top, IN UCHAR Color)
 
static VOID NTAPI DisplayCharacter (IN CHAR Character, IN ULONG Left, IN ULONG Top, IN ULONG TextColor, IN ULONG BackColor)
 
static VOID NTAPI DisplayStringXY (IN PUCHAR String, IN ULONG Left, IN ULONG Top, IN ULONG TextColor, IN ULONG BackColor)
 
static VOID NTAPI SetPaletteEntryRGB (IN ULONG Id, IN ULONG Rgb)
 
static VOID NTAPI InitPaletteWithTable (IN PULONG Table, IN ULONG Count)
 
static VOID NTAPI SetPaletteEntry (IN ULONG Id, IN ULONG PaletteEntry)
 
VOID NTAPI InitializePalette (VOID)
 
static VOID NTAPI VgaScroll (IN ULONG Scroll)
 
static VOID NTAPI PreserveRow (IN ULONG CurrentTop, IN ULONG TopDelta, IN BOOLEAN Direction)
 
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)
 
static VOID NTAPI RleBitBlt (IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer)
 
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

static ULONG ScrollRegion [4]
 
static UCHAR lMaskTable [8]
 
static UCHAR rMaskTable [8]
 
UCHAR PixelMask [8]
 
static ULONG lookup [16]
 
ULONG_PTR VgaRegisterBase = 0
 
ULONG_PTR VgaBase = 0
 
ULONG curr_x = 0
 
ULONG curr_y = 0
 
static ULONG VidTextColor = 0xF
 
static BOOLEAN CarriageReturn = FALSE
 

Macro Definition Documentation

◆ FONT_PTR_DELTA

#define FONT_PTR_DELTA   (1)

Definition at line 123 of file vga.c.

◆ GetFontPtr

#define GetFontPtr (   _Char)    &FontData[_Char * BOOTCHAR_HEIGHT];

Definition at line 122 of file vga.c.

◆ SET_PIXELS

#define SET_PIXELS (   _PixelPtr,
  _PixelMask,
  _TextColor 
)
Value:
do { \
/* Select the bitmask register and write the mask */ \
__outpw(VGA_BASE_IO_PORT + GRAPH_ADDRESS_PORT, ((_PixelMask) << 8) | IND_BIT_MASK); \
/* Set the new color */ \
WRITE_REGISTER_UCHAR((_PixelPtr), (UCHAR)(_TextColor)); \
} while (0);
#define VGA_BASE_IO_PORT
Definition: vga.h:38
#define IND_BIT_MASK
Definition: vga.h:114
#define GRAPH_ADDRESS_PORT
Definition: vga.h:81
unsigned char UCHAR
Definition: xmlstorage.h:181

Definition at line 110 of file vga.c.

Function Documentation

◆ BitBlt()

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 
)
static

Definition at line 410 of file vga.c.

417 {
418  ULONG sx, dx, dy;
419  UCHAR color;
420  ULONG offset = 0;
421  const ULONG Bottom = Top + Height;
422  const ULONG Right = Left + Width;
423 
424  /* Check if the buffer isn't 4bpp */
425  if (BitsPerPixel != 4)
426  {
427  /* FIXME: TODO */
428  DbgPrint("Unhandled BitBlt\n"
429  "%lux%lu @ (%lu|%lu)\n"
430  "Bits Per Pixel %lu\n"
431  "Buffer: %p. Delta: %lu\n",
432  Width,
433  Height,
434  Left,
435  Top,
436  BitsPerPixel,
437  Buffer,
438  Delta);
439  return;
440  }
441 
442  /* Switch to mode 10 */
443  ReadWriteMode(10);
444 
445  /* Clear the 4 planes (we're already in unchained mode here) */
447 
448  /* Select the color don't care register */
450 
451  /* 4bpp blitting */
452  dy = Top;
453  do
454  {
455  sx = 0;
456  do
457  {
458  /* Extract color */
459  color = Buffer[offset + sx];
460 
461  /* Calc destination x */
462  dx = Left + (sx << 1);
463 
464  /* Set two pixels */
465  SetPixel(dx, dy, color >> 4);
466  SetPixel(dx + 1, dy, color & 0x0F);
467 
468  sx++;
469  } while (dx < Right);
470  offset += Delta;
471  dy++;
472  } while (dy < Bottom);
473 }
#define DbgPrint
Definition: loader.c:25
GLint dy
Definition: linetemp.h:97
GLintptr offset
Definition: glext.h:5920
GLuint color
Definition: glext.h:6243
#define VGA_BASE_IO_PORT
Definition: vga.h:38
Definition: bufpool.h:45
FORCEINLINE VOID SetPixel(IN ULONG Left, IN ULONG Top, IN UCHAR Color)
Definition: vga.c:93
static VOID NTAPI ReadWriteMode(IN UCHAR Mode)
Definition: vga.c:77
#define GRAPH_ADDRESS_PORT
Definition: vga.h:81
unsigned char UCHAR
Definition: xmlstorage.h:181
#define __outpw(Port, Value)
Definition: precomp.h:61
#define SEQ_ADDRESS_PORT
Definition: vga.h:69
static LPHIST_ENTRY Bottom
Definition: history.c:54
static ULONG Delta
Definition: xboxvideo.c:32
GLint dx
Definition: linetemp.h:97
unsigned int ULONG
Definition: retypes.h:1
static LPHIST_ENTRY Top
Definition: history.c:53

Referenced by CMenuDeskBar::_OnPaint(), AboutDlgProc(), add_ruler_units(), alpha_blend_image(), ANIMATE_PaintFrame(), ANIMATE_TransparentBlt(), BitBltFromClipboard(), CDimmedWindow::Blt(), BltCard(), Bri_OnDrawItem(), SelectionModel::CalculateContents(), CDimmedWindow::Capture(), CaptureScreen(), CardBlt(), CC_PaintColorGraph(), CC_PaintCross(), check_BitBlt_pixel(), check_bits(), ClippedBitBlt(), ClockWndProc(), ColorKeyedMaskBlt(), COMCTL32_EnsureBitmapSize(), Cont_OnDrawItem(), ConvertBitmapTo32Bpp(), CreateMDIMenuBitmap(), CreateStarBitmap(), ImageModel::Crop(), ddraw_surface_update_frontbuffer(), device_load_logo(), RdpClientUI::Display_MemBlt(), RdpClientUI::Display_ScreenBlt(), RdpClientUI::Display_TriBlt(), DoBlt(), Draw(), draw_graphics(), DrawCard(), DrawFace(), DrawGlyph(), DrawHorzCardStrip(), PictureButton::DrawItem(), DrawLeds(), DrawMine(), DrawProc(), DrawTileBitmap(), DrawVertCardStrip(), dup_bitmap(), GeneralPageProc(), GetDiaogTextureBrush(), Ghost_OnDraw(), GraphCtrl_DrawPoint(), GraphCtrl_Paint(), HEADER_DrawItem(), HelDdSurfBlt(), HelDdSurfLock(), HelDdSurfUnlock(), HEXEDIT_WM_PAINT(), HLPFILE_RtfAddTransparentBitmap(), ImageEditWndRepaint(), ImageList_Add(), ImageList_AddMasked(), ImageList_BeginDrag(), ImageList_Copy(), imagelist_copy_images(), ImageList_DragMove(), ImageList_DragShowNolock(), ImageList_DrawIndirect(), ImageList_Duplicate(), ImageList_GetIcon(), IMAGELIST_InternalExpandBitmaps(), ImageList_Merge(), ImageList_Replace(), ImageList_ReplaceIcon(), IntDrawState(), IntGetWindowBitmap(), IntGrayString(), LISTVIEW_Refresh(), LoadCardBitmapsFromLibrary(), MainWndProc(), mi_paint_rect(), CardRegion::MoveDragCardTo(), mstsc_WndProc(), NT5_DrawBaseBackground(), NT5_DrawLogoffIcon(), OLEPictureImpl_LoadWICSource(), CMainWindow::OnCommand(), OnDrawItem(), CFullscreenWindow::OnPaint(), CBrandBand::OnPaint(), CDownloaderProgress::OnPaint(), OnPaint(), StartMenuRoot::Paint(), PaintBanner(), CardWindow::PaintCardRgn(), PaintCells(), PAINTING_DrawStateJam(), PlayEnhMetaFileRecord(), PlayMetaFileRecord(), PROPSHEET_Paint(), RosImageProc(), Run(), ScreenSaverProc(), show_image(), SIC_OverlayShortcutImage(), StatusDialogProc(), swapchain_gdi_frontbuffer_updated(), test_32bit_ddb(), test_bitmap_colors(), test_clipping(), Test_CreateDIBitmap_CBM_CREATDIB(), test_D3DKMTCreateDCFromMemory(), test_dibsections(), test_emf_BitBlt(), test_printer_dc(), Test_Rectangle(), Test_SrcMono1(), ThemeEndBufferedPaint(), TOOLBAR_DrawMasked(), TRACKBAR_Refresh(), UXTHEME_SizedBlt(), VidBitBlt(), VidBufferToScreenBlt(), VolumeDlgProc(), WinGBitBlt(), and WndProc().

◆ DisplayCharacter()

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

Definition at line 128 of file vga.c.

133 {
134  PUCHAR FontChar, PixelPtr;
135  ULONG Height;
136  UCHAR Shift;
137 
138  /* Switch to mode 10 */
139  ReadWriteMode(10);
140 
141  /* Clear the 4 planes (we're already in unchained mode here) */
143 
144  /* Select the color don't care register */
146 
147  /* Calculate shift */
148  Shift = Left & 7;
149 
150  /* Get the font and pixel pointer */
151  FontChar = GetFontPtr(Character);
152  PixelPtr = (PUCHAR)(VgaBase + (Left >> 3) + (Top * 80));
153 
154  /* Loop all pixel rows */
155  Height = BOOTCHAR_HEIGHT;
156  do
157  {
158  SET_PIXELS(PixelPtr, *FontChar >> Shift, TextColor);
159  PixelPtr += 80;
160  FontChar += FONT_PTR_DELTA;
161  } while (--Height);
162 
163  /* Check if we need to update neighbor bytes */
164  if (Shift)
165  {
166  /* Calculate shift for 2nd byte */
167  Shift = 8 - Shift;
168 
169  /* Get the font and pixel pointer (2nd byte) */
170  FontChar = GetFontPtr(Character);
171  PixelPtr = (PUCHAR)(VgaBase + (Left >> 3) + (Top * 80) + 1);
172 
173  /* Loop all pixel rows */
174  Height = BOOTCHAR_HEIGHT;
175  do
176  {
177  SET_PIXELS(PixelPtr, *FontChar << Shift, TextColor);
178  PixelPtr += 80;
179  FontChar += FONT_PTR_DELTA;
180  } while (--Height);
181  }
182 
183  /* Check if the background color is transparent */
184  if (BackColor >= 16)
185  {
186  /* We are done */
187  return;
188  }
189 
190  /* Calculate shift */
191  Shift = Left & 7;
192 
193  /* Get the font and pixel pointer */
194  FontChar = GetFontPtr(Character);
195  PixelPtr = (PUCHAR)(VgaBase + (Left >> 3) + (Top * 80));
196 
197  /* Loop all pixel rows */
198  Height = BOOTCHAR_HEIGHT;
199  do
200  {
201  SET_PIXELS(PixelPtr, ~*FontChar >> Shift, BackColor);
202  PixelPtr += 80;
203  FontChar += FONT_PTR_DELTA;
204  } while (--Height);
205 
206  /* Check if we need to update neighbor bytes */
207  if (Shift)
208  {
209  /* Calculate shift for 2nd byte */
210  Shift = 8 - Shift;
211 
212  /* Get the font and pixel pointer (2nd byte) */
213  FontChar = GetFontPtr(Character);
214  PixelPtr = (PUCHAR)(VgaBase + (Left >> 3) + (Top * 80) + 1);
215 
216  /* Loop all pixel rows */
217  Height = BOOTCHAR_HEIGHT;
218  do
219  {
220  SET_PIXELS(PixelPtr, ~*FontChar << Shift, BackColor);
221  PixelPtr += 80;
222  FontChar += FONT_PTR_DELTA;
223  } while (--Height);
224  }
225 }
#define GetFontPtr(_Char)
Definition: vga.c:122
unsigned char * PUCHAR
Definition: retypes.h:3
#define BOOTCHAR_HEIGHT
Definition: precomp.h:11
#define VGA_BASE_IO_PORT
Definition: vga.h:38
#define FONT_PTR_DELTA
Definition: vga.c:123
#define SET_PIXELS(_PixelPtr, _PixelMask, _TextColor)
Definition: vga.c:110
static VOID NTAPI ReadWriteMode(IN UCHAR Mode)
Definition: vga.c:77
#define GRAPH_ADDRESS_PORT
Definition: vga.h:81
unsigned char UCHAR
Definition: xmlstorage.h:181
#define __outpw(Port, Value)
Definition: precomp.h:61
#define SEQ_ADDRESS_PORT
Definition: vga.h:69
ULONG_PTR VgaBase
Definition: vga.c:67
_In_ ULONG Shift
Definition: rtlfuncs.h:2683
unsigned int ULONG
Definition: retypes.h:1
static LPHIST_ENTRY Top
Definition: history.c:53

Referenced by DisplayStringXY(), and VidDisplayString().

◆ DisplayStringXY()

static VOID NTAPI DisplayStringXY ( IN PUCHAR  String,
IN ULONG  Left,
IN ULONG  Top,
IN ULONG  TextColor,
IN ULONG  BackColor 
)
static

Definition at line 229 of file vga.c.

234 {
235  /* Loop every character */
236  while (*String)
237  {
238  /* Display a character */
239  DisplayCharacter(*String, Left, Top, TextColor, BackColor);
240 
241  /* Move to next character and next position */
242  String++;
243  Left += 8;
244  }
245 }
static WCHAR String[]
Definition: stringtable.c:55
static VOID NTAPI DisplayCharacter(IN CHAR Character, IN ULONG Left, IN ULONG Top, IN ULONG TextColor, IN ULONG BackColor)
Definition: vga.c:128
static LPHIST_ENTRY Top
Definition: history.c:53

Referenced by VidDisplayStringXY().

◆ InitializePalette()

VOID NTAPI InitializePalette ( VOID  )

Definition at line 295 of file vga.c.

296 {
297  ULONG PaletteEntry[16] = {0x000000,
298  0x000020,
299  0x002000,
300  0x002020,
301  0x200000,
302  0x200020,
303  0x202000,
304  0x202020,
305  0x303030,
306  0x00003F,
307  0x003F00,
308  0x003F3F,
309  0x3F0000,
310  0x3F003F,
311  0x3F3F00,
312  0x3F3F3F};
313  ULONG i;
314 
315  /* Loop all the entries and set their palettes */
316  for (i = 0; i < 16; i++) SetPaletteEntry(i, PaletteEntry[i]);
317 }
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
static VOID NTAPI SetPaletteEntry(IN ULONG Id, IN ULONG PaletteEntry)
Definition: vga.c:281
unsigned int ULONG
Definition: retypes.h:1

Referenced by VidResetDisplay().

◆ InitPaletteWithTable()

static VOID NTAPI InitPaletteWithTable ( IN PULONG  Table,
IN ULONG  Count 
)
static

Definition at line 265 of file vga.c.

267 {
268  ULONG i;
269  PULONG Entry = Table;
270 
271  /* Loop every entry */
272  for (i = 0; i < Count; i++, Entry++)
273  {
274  /* Set the entry */
276  }
277 }
static VOID NTAPI SetPaletteEntryRGB(IN ULONG Id, IN ULONG Rgb)
Definition: vga.c:249
ASMGENDATA Table[]
Definition: genincdata.c:61
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
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
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1
base of all file and directory entries
Definition: entries.h:82

Referenced by VidBitBlt().

◆ PreserveRow()

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

Definition at line 360 of file vga.c.

363 {
364  PUCHAR Position1, Position2;
365  ULONG Count;
366 
367  /* Clear the 4 planes */
369 
370  /* Set the bitmask to 0xFF for all 4 planes */
372 
373  /* Set Mode 1 */
374  ReadWriteMode(1);
375 
376  /* Check which way we're preserving */
377  if (Direction)
378  {
379  /* Calculate the position in memory for the row */
380  Position1 = (PUCHAR)(VgaBase + CurrentTop * 80);
381  Position2 = (PUCHAR)(VgaBase + 0x9600);
382  }
383  else
384  {
385  /* Calculate the position in memory for the row */
386  Position1 = (PUCHAR)(VgaBase + 0x9600);
387  Position2 = (PUCHAR)(VgaBase + CurrentTop * 80);
388  }
389 
390  /* Set the count and loop every pixel */
391  Count = TopDelta * 80;
392 
393 #if defined(_M_IX86) || defined(_M_AMD64)
394  __movsb(Position1, Position2, Count);
395 #else
396  while (Count--)
397  {
398  /* Write the data back on the other position */
399  WRITE_REGISTER_UCHAR(Position1, READ_REGISTER_UCHAR(Position2));
400 
401  /* Increase both positions */
402  Position1++;
403  Position2++;
404  }
405 #endif
406 }
unsigned char * PUCHAR
Definition: retypes.h:3
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
#define VGA_BASE_IO_PORT
Definition: vga.h:38
PPC_QUAL void __movsb(unsigned char *Destination, const unsigned char *Source, unsigned long Count)
Definition: intrin_ppc.h:323
static VOID NTAPI ReadWriteMode(IN UCHAR Mode)
Definition: vga.c:77
#define GRAPH_ADDRESS_PORT
Definition: vga.h:81
_Inout_ PSIZE_T _In_opt_ PMDLX _In_ MM_ROTATE_DIRECTION Direction
Definition: mmfuncs.h:773
NTKERNELAPI UCHAR NTAPI READ_REGISTER_UCHAR(IN PUCHAR Register)
#define __outpw(Port, Value)
Definition: precomp.h:61
#define SEQ_ADDRESS_PORT
Definition: vga.h:69
ULONG_PTR VgaBase
Definition: vga.c:67
unsigned int ULONG
Definition: retypes.h:1
NTKERNELAPI VOID NTAPI WRITE_REGISTER_UCHAR(IN PUCHAR Register, IN UCHAR Value)

Referenced by VidDisplayString().

◆ ReadWriteMode()

static VOID NTAPI ReadWriteMode ( IN UCHAR  Mode)
static

Definition at line 77 of file vga.c.

78 {
79  UCHAR Value;
80 
81  /* Switch to graphics mode register */
83 
84  /* Get the current register value, minus the current mode */
86 
87  /* Set the new mode */
89 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
_In_ ULONG Mode
Definition: hubbusif.h:303
#define VGA_BASE_IO_PORT
Definition: vga.h:38
#define GRAPH_ADDRESS_PORT
Definition: vga.h:81
unsigned char UCHAR
Definition: xmlstorage.h:181
#define __inpb(Port)
Definition: precomp.h:52
#define IND_GRAPH_MODE
Definition: vga.h:112
#define __outpb(Port, Value)
Definition: precomp.h:58
#define GRAPH_DATA_PORT
Definition: vga.h:82

Referenced by BitBlt(), DisplayCharacter(), PitReadData(), PitWriteCommand(), PitWriteData(), PreserveRow(), RleBitBlt(), VgaScroll(), VidScreenToBufferBlt(), and VidSolidColorFill().

◆ RleBitBlt()

static VOID NTAPI RleBitBlt ( IN ULONG  Left,
IN ULONG  Top,
IN ULONG  Width,
IN ULONG  Height,
IN PUCHAR  Buffer 
)
static

Definition at line 477 of file vga.c.

482 {
483  ULONG YDelta;
484  ULONG x;
485  ULONG RleValue, NewRleValue;
486  ULONG Color, Color2;
487  ULONG i, j;
488  ULONG Code;
489 
490  /* Switch to mode 10 */
491  ReadWriteMode(10);
492 
493  /* Clear the 4 planes (we're already in unchained mode here) */
495 
496  /* Select the color don't care register */
498 
499  /* Set Y height and current X value and start loop */
500  YDelta = Top + Height - 1;
501  x = Left;
502  for (;;)
503  {
504  /* Get the current value and advance in the buffer */
505  RleValue = *Buffer;
506  Buffer++;
507  if (RleValue)
508  {
509  /* Check if we've gone past the edge */
510  if ((x + RleValue) > (Width + Left))
511  {
512  /* Fixup the pixel value */
513  RleValue = Left - x + Width;
514  }
515 
516  /* Get the new value */
517  NewRleValue = *Buffer;
518 
519  /* Get the two colors */
520  Color = NewRleValue >> 4;
521  Color2 = NewRleValue & 0xF;
522 
523  /* Increase buffer position */
524  Buffer++;
525 
526  /* Check if we need to do a fill */
527  if (Color == Color2)
528  {
529  /* Do a fill and continue the loop */
530  RleValue += x;
531  VidSolidColorFill(x, YDelta, RleValue - 1, YDelta, (UCHAR)Color);
532  x = RleValue;
533  continue;
534  }
535 
536  /* Check if the pixel value is 1 or below */
537  if (RleValue > 1)
538  {
539  /* Set loop variables */
540  i = (RleValue - 2) / 2 + 1;
541  do
542  {
543  /* Set the pixels */
544  SetPixel(x, YDelta, (UCHAR)Color);
545  x++;
546  SetPixel(x, YDelta, (UCHAR)Color2);
547  x++;
548 
549  /* Decrease pixel value */
550  RleValue -= 2;
551  } while (--i);
552  }
553 
554  /* Check if there is any value at all */
555  if (RleValue)
556  {
557  /* Set the pixel and increase position */
558  SetPixel(x, YDelta, (UCHAR)Color);
559  x++;
560  }
561 
562  /* Start over */
563  continue;
564  }
565 
566  /* Get the current pixel value */
567  RleValue = *Buffer;
568  Code = RleValue;
569  switch (Code)
570  {
571  /* Case 0 */
572  case 0:
573  {
574  /* Set new x value, decrease distance and restart */
575  x = Left;
576  YDelta--;
577  Buffer++;
578  continue;
579  }
580 
581  /* Case 1 */
582  case 1:
583  {
584  /* Done */
585  return;
586  }
587 
588  /* Case 2 */
589  case 2:
590  {
591  /* Set new x value, decrease distance and restart */
592  Buffer++;
593  x += *Buffer;
594  Buffer++;
595  YDelta -= *Buffer;
596  Buffer++;
597  continue;
598  }
599 
600  /* Other values */
601  default:
602  {
603  Buffer++;
604  break;
605  }
606  }
607 
608  /* Check if we've gone past the edge */
609  if ((x + RleValue) > (Width + Left))
610  {
611  /* Set fixed up loop count */
612  i = RleValue - Left - Width + x;
613 
614  /* Fixup pixel value */
615  RleValue -= i;
616  }
617  else
618  {
619  /* Clear loop count */
620  i = 0;
621  }
622 
623  /* Check the value now */
624  if (RleValue > 1)
625  {
626  /* Set loop variables */
627  j = (RleValue - 2) / 2 + 1;
628  do
629  {
630  /* Get the new value */
631  NewRleValue = *Buffer;
632 
633  /* Get the two colors */
634  Color = NewRleValue >> 4;
635  Color2 = NewRleValue & 0xF;
636 
637  /* Increase buffer position */
638  Buffer++;
639 
640  /* Set the pixels */
641  SetPixel(x, YDelta, (UCHAR)Color);
642  x++;
643  SetPixel(x, YDelta, (UCHAR)Color2);
644  x++;
645 
646  /* Decrease pixel value */
647  RleValue -= 2;
648  } while (--j);
649  }
650 
651  /* Check if there is any value at all */
652  if (RleValue)
653  {
654  /* Set the pixel and increase position */
655  Color = *Buffer >> 4;
656  Buffer++;
657  SetPixel(x, YDelta, (UCHAR)Color);
658  x++;
659  i--;
660  }
661 
662  /* Check loop count now */
663  if ((LONG)i > 0)
664  {
665  /* Decrease it */
666  i--;
667 
668  /* Set new position */
669  Buffer = Buffer + (i / 2) + 1;
670  }
671 
672  /* Check if we need to increase the buffer */
673  if ((ULONG_PTR)Buffer & 1) Buffer++;
674  }
675 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
struct Color Color
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
long LONG
Definition: pedump.c:60
#define VGA_BASE_IO_PORT
Definition: vga.h:38
Definition: bufpool.h:45
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 Code
Definition: deflate.h:80
FORCEINLINE VOID SetPixel(IN ULONG Left, IN ULONG Top, IN UCHAR Color)
Definition: vga.c:93
static VOID NTAPI ReadWriteMode(IN UCHAR Mode)
Definition: vga.c:77
#define GRAPH_ADDRESS_PORT
Definition: vga.h:81
unsigned char UCHAR
Definition: xmlstorage.h:181
#define __outpw(Port, Value)
Definition: precomp.h:61
#define SEQ_ADDRESS_PORT
Definition: vga.h:69
VOID NTAPI VidSolidColorFill(IN ULONG Left, IN ULONG Top, IN ULONG Right, IN ULONG Bottom, IN UCHAR Color)
Definition: vga.c:1044
unsigned int ULONG
Definition: retypes.h:1
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
static LPHIST_ENTRY Top
Definition: history.c:53

Referenced by VidBitBlt().

◆ SetPaletteEntry()

static VOID NTAPI SetPaletteEntry ( IN ULONG  Id,
IN ULONG  PaletteEntry 
)
static

Definition at line 281 of file vga.c.

283 {
284  /* Set the palette index */
286 
287  /* Set RGB colors */
288  __outpb(VGA_BASE_IO_PORT + DAC_DATA_REG_PORT, PaletteEntry & 0xFF);
289  __outpb(VGA_BASE_IO_PORT + DAC_DATA_REG_PORT, (PaletteEntry >>= 8) & 0xFF);
290  __outpb(VGA_BASE_IO_PORT + DAC_DATA_REG_PORT, (PaletteEntry >> 8) & 0xFF);
291 }
#define DAC_DATA_REG_PORT
Definition: vga.h:77
#define DAC_ADDRESS_WRITE_PORT
Definition: vga.h:76
DWORD Id
#define VGA_BASE_IO_PORT
Definition: vga.h:38
unsigned char UCHAR
Definition: xmlstorage.h:181
#define __outpb(Port, Value)
Definition: precomp.h:58

Referenced by InitializePalette().

◆ SetPaletteEntryRGB()

static VOID NTAPI SetPaletteEntryRGB ( IN ULONG  Id,
IN ULONG  Rgb 
)
static

Definition at line 249 of file vga.c.

251 {
252  PCHAR Colors = (PCHAR)&Rgb;
253 
254  /* Set the palette index */
256 
257  /* Set RGB colors */
261 }
signed char * PCHAR
Definition: retypes.h:7
#define DAC_DATA_REG_PORT
Definition: vga.h:77
#define DAC_ADDRESS_WRITE_PORT
Definition: vga.h:76
DWORD Id
#define VGA_BASE_IO_PORT
Definition: vga.h:38
#define PCHAR
Definition: match.c:90
Colors
Definition: ansiprsr.h:4
unsigned char UCHAR
Definition: xmlstorage.h:181
#define __outpb(Port, Value)
Definition: precomp.h:58

Referenced by InitPaletteWithTable().

◆ SetPixel()

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

Definition at line 93 of file vga.c.

96 {
97  PUCHAR PixelPosition;
98 
99  /* Calculate the pixel position. */
100  PixelPosition = (PUCHAR)(VgaBase + (Left >> 3) + (Top * 80));
101 
102  /* Select the bitmask register and write the mask */
104 
105  /* Read the current pixel value and add our color */
106  WRITE_REGISTER_UCHAR(PixelPosition,
107  READ_REGISTER_UCHAR(PixelPosition) & Color);
108 }
unsigned char * PUCHAR
Definition: retypes.h:3
#define VGA_BASE_IO_PORT
Definition: vga.h:38
#define IND_BIT_MASK
Definition: vga.h:114
#define GRAPH_ADDRESS_PORT
Definition: vga.h:81
NTKERNELAPI UCHAR NTAPI READ_REGISTER_UCHAR(IN PUCHAR Register)
#define __outpw(Port, Value)
Definition: precomp.h:61
ULONG_PTR VgaBase
Definition: vga.c:67
UCHAR PixelMask[8]
Definition: vga.c:35
static LPHIST_ENTRY Top
Definition: history.c:53
NTKERNELAPI VOID NTAPI WRITE_REGISTER_UCHAR(IN PUCHAR Register, IN UCHAR Value)

Referenced by _test_color(), Airbrush(), AlphaBlendInit(), BitBlt(), BltCard(), Brush(), cdtDrawExt(), CreateSinkBmp(), draw_graphics(), draw_text_2(), DrawCardCorner(), DrawCharacterPixel(), DrawStarField(), EditGlyphPreviewWndProc(), endPaintingL(), endPaintingR(), InitResources(), CPaletteWindow::OnPaint(), PlayMetaFileRecord(), Replace(), RleBitBlt(), startPaintingL(), startPaintingR(), test_alpha_hdc(), test_begin_paint(), test_bitmap_colors(), test_DIB_PAL_COLORS(), test_fromMemoryBitmap(), test_GetSetDIBits_rtl(), Test_SetPixel_PAL(), Test_SetPixel_Params(), Test_SrcMono(), test_StretchBlt(), TREEVIEW_DrawItemLines(), WndProc_wave(), write_monocolor_pixels_frontbuffer(), and write_monocolor_span_frontbuffer().

◆ VgaScroll()

static VOID NTAPI VgaScroll ( IN ULONG  Scroll)
static

Definition at line 321 of file vga.c.

322 {
323  ULONG Top, RowSize;
324  PUCHAR OldPosition, NewPosition;
325 
326  /* Clear the 4 planes */
328 
329  /* Set the bitmask to 0xFF for all 4 planes */
331 
332  /* Set Mode 1 */
333  ReadWriteMode(1);
334 
335  RowSize = (ScrollRegion[2] - ScrollRegion[0] + 1) / 8;
336 
337  /* Calculate the position in memory for the row */
338  OldPosition = (PUCHAR)(VgaBase + (ScrollRegion[1] + Scroll) * 80 + ScrollRegion[0] / 8);
339  NewPosition = (PUCHAR)(VgaBase + ScrollRegion[1] * 80 + ScrollRegion[0] / 8);
340 
341  /* Start loop */
342  for (Top = ScrollRegion[1]; Top <= ScrollRegion[3]; ++Top)
343  {
344 #if defined(_M_IX86) || defined(_M_AMD64)
345  __movsb(NewPosition, OldPosition, RowSize);
346 #else
347  ULONG i;
348 
349  /* Scroll the row */
350  for (i = 0; i < RowSize; ++i)
351  WRITE_REGISTER_UCHAR(NewPosition + i, READ_REGISTER_UCHAR(OldPosition + i));
352 #endif
353  OldPosition += 80;
354  NewPosition += 80;
355  }
356 }
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
#define VGA_BASE_IO_PORT
Definition: vga.h:38
PPC_QUAL void __movsb(unsigned char *Destination, const unsigned char *Source, unsigned long Count)
Definition: intrin_ppc.h:323
static VOID NTAPI ReadWriteMode(IN UCHAR Mode)
Definition: vga.c:77
#define GRAPH_ADDRESS_PORT
Definition: vga.h:81
NTKERNELAPI UCHAR NTAPI READ_REGISTER_UCHAR(IN PUCHAR Register)
#define __outpw(Port, Value)
Definition: precomp.h:61
#define SEQ_ADDRESS_PORT
Definition: vga.h:69
static ULONG ScrollRegion[4]
Definition: vga.c:5
ULONG_PTR VgaBase
Definition: vga.c:67
unsigned int ULONG
Definition: retypes.h:1
static LPHIST_ENTRY Top
Definition: history.c:53
NTKERNELAPI VOID NTAPI WRITE_REGISTER_UCHAR(IN PUCHAR Register, IN UCHAR Value)

Referenced by VidDisplayString().

◆ VidBitBlt()

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

Definition at line 859 of file vga.c.

862 {
863  PBITMAPINFOHEADER BitmapInfoHeader;
864  LONG Delta;
865  PUCHAR BitmapOffset;
866 
867  /* Get the Bitmap Header */
868  BitmapInfoHeader = (PBITMAPINFOHEADER)Buffer;
869 
870  /* Initialize the palette */
871  InitPaletteWithTable((PULONG)(Buffer + BitmapInfoHeader->biSize),
872  (BitmapInfoHeader->biClrUsed) ?
873  BitmapInfoHeader->biClrUsed : 16);
874 
875  /* Make sure we can support this bitmap */
876  ASSERT((BitmapInfoHeader->biBitCount * BitmapInfoHeader->biPlanes) <= 4);
877 
878  /*
879  * Calculate the delta and align it on 32-bytes, then calculate
880  * the actual start of the bitmap data.
881  */
882  Delta = (BitmapInfoHeader->biBitCount * BitmapInfoHeader->biWidth) + 31;
883  Delta >>= 3;
884  Delta &= ~3;
885  BitmapOffset = Buffer + sizeof(BITMAPINFOHEADER) + 16 * sizeof(ULONG);
886 
887  /* Check the compression of the bitmap */
888  if (BitmapInfoHeader->biCompression == BI_RLE4)
889  {
890  /* Make sure we have a width and a height */
891  if ((BitmapInfoHeader->biWidth) && (BitmapInfoHeader->biHeight))
892  {
893  /* We can use RLE Bit Blt */
894  RleBitBlt(Left,
895  Top,
896  BitmapInfoHeader->biWidth,
897  BitmapInfoHeader->biHeight,
898  BitmapOffset);
899  }
900  }
901  else
902  {
903  /* Check if the height is negative */
904  if (BitmapInfoHeader->biHeight < 0)
905  {
906  /* Make it positive in the header */
907  BitmapInfoHeader->biHeight *= -1;
908  }
909  else
910  {
911  /* Update buffer offset */
912  BitmapOffset += ((BitmapInfoHeader->biHeight - 1) * Delta);
913  Delta *= -1;
914  }
915 
916  /* Make sure we have a width and a height */
917  if ((BitmapInfoHeader->biWidth) && (BitmapInfoHeader->biHeight))
918  {
919  /* Do the BitBlt */
920  BitBlt(Left,
921  Top,
922  BitmapInfoHeader->biWidth,
923  BitmapInfoHeader->biHeight,
924  BitmapOffset,
925  BitmapInfoHeader->biBitCount,
926  Delta);
927  }
928  }
929 }
USHORT biBitCount
Definition: precomp.h:24
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
unsigned char * PUCHAR
Definition: retypes.h:3
ULONG biCompression
Definition: precomp.h:25
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: vga.c:410
static VOID NTAPI RleBitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer)
Definition: vga.c:477
struct tagBITMAPINFOHEADER * PBITMAPINFOHEADER
long LONG
Definition: pedump.c:60
static VOID NTAPI InitPaletteWithTable(IN PULONG Table, IN ULONG Count)
Definition: vga.c:265
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:35
unsigned int ULONG
Definition: retypes.h:1
static LPHIST_ENTRY Top
Definition: history.c:53

◆ 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 756 of file vga.c.

762 {
763  /* Make sure we have a width and height */
764  if (!Width || !Height) return;
765 
766  /* Call the helper function */
767  BitBlt(Left, Top, Width, Height, Buffer, 4, Delta);
768 }
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: vga.c:410
Definition: bufpool.h:45
static ULONG Delta
Definition: xboxvideo.c:32
static LPHIST_ENTRY Top
Definition: history.c:53

◆ VidCleanUp()

VOID NTAPI VidCleanUp ( VOID  )

Definition at line 744 of file vga.c.

745 {
746  /* Select bit mask register and clear it */
749 }
#define BIT_MASK_DEFAULT
Definition: vga.h:167
#define VGA_BASE_IO_PORT
Definition: vga.h:38
#define IND_BIT_MASK
Definition: vga.h:114
#define GRAPH_ADDRESS_PORT
Definition: vga.h:81
#define __outpb(Port, Value)
Definition: precomp.h:58
#define GRAPH_DATA_PORT
Definition: vga.h:82

◆ VidDisplayString()

VOID NTAPI VidDisplayString ( IN PUCHAR  String)

Definition at line 775 of file vga.c.

776 {
777  ULONG TopDelta = BOOTCHAR_HEIGHT + 1;
778 
779  /* Start looping the string */
780  while (*String)
781  {
782  /* Treat new-line separately */
783  if (*String == '\n')
784  {
785  /* Modify Y position */
786  curr_y += TopDelta;
787  if (curr_y + TopDelta >= ScrollRegion[3])
788  {
789  /* Scroll the view */
790  VgaScroll(TopDelta);
791  curr_y -= TopDelta;
792  }
793  else
794  {
795  /* Preserve row */
796  PreserveRow(curr_y, TopDelta, FALSE);
797  }
798 
799  /* Update current X */
800  curr_x = ScrollRegion[0];
801 
802  /* Do not clear line if "\r\n" is given */
804  }
805  else if (*String == '\r')
806  {
807  /* Update current X */
808  curr_x = ScrollRegion[0];
809 
810  /* Check if we're being followed by a new line */
812  }
813  else
814  {
815  /* check if we had a '\r' last time */
816  if (CarriageReturn)
817  {
818  /* We did, clear the current row */
819  PreserveRow(curr_y, TopDelta, TRUE);
821  }
822 
823  /* Display this character */
825  curr_x += 8;
826 
827  /* Check if we should scroll */
828  if (curr_x + 8 > ScrollRegion[2])
829  {
830  /* Update Y position and check if we should scroll it */
831  curr_y += TopDelta;
832  if (curr_y + TopDelta > ScrollRegion[3])
833  {
834  /* Do the scroll */
835  VgaScroll(TopDelta);
836  curr_y -= TopDelta;
837  }
838  else
839  {
840  /* Preserve the current row */
841  PreserveRow(curr_y, TopDelta, FALSE);
842  }
843 
844  /* Update X */
845  curr_x = ScrollRegion[0];
846  }
847  }
848 
849  /* Get the next character */
850  String++;
851  }
852 }
#define TRUE
Definition: types.h:120
static VOID NTAPI VgaScroll(IN ULONG Scroll)
Definition: vga.c:321
static ULONG VidTextColor
Definition: vga.c:70
static WCHAR String[]
Definition: stringtable.c:55
#define BOOTCHAR_HEIGHT
Definition: precomp.h:11
static VOID NTAPI PreserveRow(IN ULONG CurrentTop, IN ULONG TopDelta, IN BOOLEAN Direction)
Definition: vga.c:360
ULONG curr_y
Definition: vga.c:69
static ULONG ScrollRegion[4]
Definition: vga.c:5
static VOID NTAPI DisplayCharacter(IN CHAR Character, IN ULONG Left, IN ULONG Top, IN ULONG TextColor, IN ULONG BackColor)
Definition: vga.c:128
unsigned int ULONG
Definition: retypes.h:1
ULONG curr_x
Definition: vga.c:68
static BOOLEAN CarriageReturn
Definition: vga.c:71

◆ VidDisplayStringXY()

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

Definition at line 699 of file vga.c.

703 {
704  ULONG BackColor;
705 
706  /*
707  * If the caller wanted transparent, then send the special value (16),
708  * else use our default and call the helper routine.
709  */
710  BackColor = Transparent ? 16 : 14;
711  DisplayStringXY(String, Left, Top, 12, BackColor);
712 }
static WCHAR String[]
Definition: stringtable.c:55
static VOID NTAPI DisplayStringXY(IN PUCHAR String, IN ULONG Left, IN ULONG Top, IN ULONG TextColor, IN ULONG BackColor)
Definition: vga.c:229
unsigned int ULONG
Definition: retypes.h:1
static LPHIST_ENTRY Top
Definition: history.c:53

◆ 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 936 of file vga.c.

942 {
943  ULONG Plane;
944  ULONG XDistance;
945  ULONG LeftDelta, RightDelta;
946  ULONG PixelOffset;
947  PUCHAR PixelPosition;
948  PUCHAR k, i;
949  PULONG m;
950  UCHAR Value, Value2;
951  UCHAR a;
952  ULONG b;
953  ULONG x, y;
954 
955  /* Calculate total distance to copy on X */
956  XDistance = Left + Width - 1;
957 
958  /* Start at plane 0 */
959  Plane = 0;
960 
961  /* Calculate the 8-byte left and right deltas */
962  LeftDelta = Left & 7;
963  RightDelta = 8 - LeftDelta;
964 
965  /* Clear the destination buffer */
966  RtlZeroMemory(Buffer, Delta * Height);
967 
968  /* Calculate the pixel offset and convert the X distance into byte form */
969  PixelOffset = Top * 80 + (Left >> 3);
970  XDistance >>= 3;
971 
972  /* Loop the 4 planes */
973  do
974  {
975  /* Set the current pixel position and reset buffer loop variable */
976  PixelPosition = (PUCHAR)(VgaBase + PixelOffset);
977  i = Buffer;
978 
979  /* Set Mode 0 */
980  ReadWriteMode(0);
981 
982  /* Set the current plane */
984 
985  /* Make sure we have a height */
986  if (Height > 0)
987  {
988  /* Start the outer Y loop */
989  y = Height;
990  do
991  {
992  /* Read the current value */
993  m = (PULONG)i;
994  Value = READ_REGISTER_UCHAR(PixelPosition);
995 
996  /* Set Pixel Position loop variable */
997  k = PixelPosition + 1;
998 
999  /* Check if we're still within bounds */
1000  if (Left <= XDistance)
1001  {
1002  /* Start X Inner loop */
1003  x = (XDistance - Left) + 1;
1004  do
1005  {
1006  /* Read the current value */
1007  Value2 = READ_REGISTER_UCHAR(k);
1008 
1009  /* Increase pixel position */
1010  k++;
1011 
1012  /* Do the blt */
1013  a = Value2 >> (UCHAR)RightDelta;
1014  a |= Value << (UCHAR)LeftDelta;
1015  b = lookup[a & 0xF];
1016  a >>= 4;
1017  b <<= 16;
1018  b |= lookup[a];
1019 
1020  /* Save new value to buffer */
1021  *m |= (b << Plane);
1022 
1023  /* Move to next destination location */
1024  m++;
1025 
1026  /* Write new value */
1027  Value = Value2;
1028  } while (--x);
1029  }
1030 
1031  /* Update pixel position */
1032  PixelPosition += 80;
1033  i += Delta;
1034  } while (--y);
1035  }
1036  } while (++Plane < 4);
1037 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
unsigned char * PUCHAR
Definition: retypes.h:3
static ULONG lookup[16]
Definition: vga.c:46
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define IND_READ_MAP
Definition: vga.h:111
const GLfloat * m
Definition: glext.h:10848
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
#define VGA_BASE_IO_PORT
Definition: vga.h:38
#define a
Definition: ke_i.h:78
Definition: bufpool.h:45
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
static VOID NTAPI ReadWriteMode(IN UCHAR Mode)
Definition: vga.c:77
#define GRAPH_ADDRESS_PORT
Definition: vga.h:81
unsigned char UCHAR
Definition: xmlstorage.h:181
NTKERNELAPI UCHAR NTAPI READ_REGISTER_UCHAR(IN PUCHAR Register)
#define __outpw(Port, Value)
Definition: precomp.h:61
ULONG_PTR VgaBase
Definition: vga.c:67
static ULONG Delta
Definition: xboxvideo.c:32
unsigned int * PULONG
Definition: retypes.h:1
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
static LPHIST_ENTRY Top
Definition: history.c:53
int k
Definition: mpi.c:3369

◆ VidSetScrollRegion()

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

Definition at line 719 of file vga.c.

723 {
724  /* Assert alignment */
725  ASSERT((Left & 0x7) == 0);
726  ASSERT((Right & 0x7) == 7);
727 
728  /* Set Scroll Region */
729  ScrollRegion[0] = Left;
730  ScrollRegion[1] = Top;
731  ScrollRegion[2] = Right;
732  ScrollRegion[3] = Bottom;
733 
734  /* Set current X and Y */
735  curr_x = Left;
736  curr_y = Top;
737 }
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
ULONG curr_y
Definition: vga.c:69
static LPHIST_ENTRY Bottom
Definition: history.c:54
static ULONG ScrollRegion[4]
Definition: vga.c:5
ULONG curr_x
Definition: vga.c:68
static LPHIST_ENTRY Top
Definition: history.c:53

◆ VidSetTextColor()

ULONG NTAPI VidSetTextColor ( IN ULONG  Color)

Definition at line 684 of file vga.c.

685 {
686  ULONG OldColor;
687 
688  /* Save the old color and set the new one */
689  OldColor = VidTextColor;
691  return OldColor;
692 }
static ULONG VidTextColor
Definition: vga.c:70
struct Color Color
unsigned int ULONG
Definition: retypes.h:1

◆ VidSolidColorFill()

VOID NTAPI VidSolidColorFill ( IN ULONG  Left,
IN ULONG  Top,
IN ULONG  Right,
IN ULONG  Bottom,
IN UCHAR  Color 
)

Definition at line 1044 of file vga.c.

1049 {
1050  ULONG rMask, lMask;
1051  ULONG LeftOffset, RightOffset, Distance;
1052  PUCHAR Offset;
1053  ULONG i, j;
1054 
1055  /* Get the left and right masks, shifts, and delta */
1056  LeftOffset = Left >> 3;
1057  lMask = (lMaskTable[Left & 0x7] << 8) | IND_BIT_MASK;
1058  RightOffset = Right >> 3;
1059  rMask = (rMaskTable[Right & 0x7] << 8) | IND_BIT_MASK;
1060  Distance = RightOffset - LeftOffset;
1061 
1062  /* If there is no distance, then combine the right and left masks */
1063  if (!Distance) lMask &= rMask;
1064 
1065  /* Switch to mode 10 */
1066  ReadWriteMode(10);
1067 
1068  /* Clear the 4 planes (we're already in unchained mode here) */
1070 
1071  /* Select the color don't care register */
1073 
1074  /* Calculate pixel position for the read */
1075  Offset = (PUCHAR)(VgaBase + (Top * 80) + LeftOffset);
1076 
1077  /* Select the bitmask register and write the mask */
1079 
1080  /* Check if the top coord is below the bottom one */
1081  if (Top <= Bottom)
1082  {
1083  /* Start looping each line */
1084  i = (Bottom - Top) + 1;
1085  do
1086  {
1087  /* Read the previous value and add our color */
1089 
1090  /* Move to the next line */
1091  Offset += 80;
1092  } while (--i);
1093  }
1094 
1095  /* Check if we have a delta */
1096  if (Distance)
1097  {
1098  /* Calculate new pixel position */
1099  Offset = (PUCHAR)(VgaBase + (Top * 80) + RightOffset);
1100  Distance--;
1101 
1102  /* Select the bitmask register and write the mask */
1104 
1105  /* Check if the top coord is below the bottom one */
1106  if (Top <= Bottom)
1107  {
1108  /* Start looping each line */
1109  i = (Bottom - Top) + 1;
1110  do
1111  {
1112  /* Read the previous value and add our color */
1115 
1116  /* Move to the next line */
1117  Offset += 80;
1118  } while (--i);
1119  }
1120 
1121  /* Check if we still have a delta */
1122  if (Distance)
1123  {
1124  /* Calculate new pixel position */
1125  Offset = (PUCHAR)(VgaBase + (Top * 80) + LeftOffset + 1);
1126 
1127  /* Set the bitmask to 0xFF for all 4 planes */
1129 
1130  /* Check if the top coord is below the bottom one */
1131  if (Top <= Bottom)
1132  {
1133  /* Start looping each line */
1134  i = (Bottom - Top) + 1;
1135  do
1136  {
1137  /* Loop the shift delta */
1138  if (Distance > 0)
1139  {
1140  for (j = Distance; j; Offset++, j--)
1141  {
1142  /* Write the color */
1144  }
1145  }
1146 
1147  /* Update position in memory */
1148  Offset += (80 - Distance);
1149  } while (--i);
1150  }
1151  }
1152  }
1153 }
static UCHAR rMaskTable[8]
Definition: vga.c:23
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
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
#define VGA_BASE_IO_PORT
Definition: vga.h:38
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 IND_BIT_MASK
Definition: vga.h:114
static VOID NTAPI ReadWriteMode(IN UCHAR Mode)
Definition: vga.c:77
#define GRAPH_ADDRESS_PORT
Definition: vga.h:81
NTKERNELAPI UCHAR NTAPI READ_REGISTER_UCHAR(IN PUCHAR Register)
#define __outpw(Port, Value)
Definition: precomp.h:61
#define SEQ_ADDRESS_PORT
Definition: vga.h:69
static LPHIST_ENTRY Bottom
Definition: history.c:54
ULONG_PTR VgaBase
Definition: vga.c:67
unsigned short USHORT
Definition: pedump.c:61
static UCHAR lMaskTable[8]
Definition: vga.c:12
unsigned int ULONG
Definition: retypes.h:1
static LPHIST_ENTRY Top
Definition: history.c:53
NTKERNELAPI VOID NTAPI WRITE_REGISTER_UCHAR(IN PUCHAR Register, IN UCHAR Value)

Referenced by RleBitBlt().

Variable Documentation

◆ CarriageReturn

BOOLEAN CarriageReturn = FALSE
static

Definition at line 71 of file vga.c.

Referenced by VidDisplayString().

◆ curr_x

ULONG curr_x = 0

Definition at line 68 of file vga.c.

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

◆ curr_y

ULONG curr_y = 0

Definition at line 69 of file vga.c.

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

◆ lMaskTable

UCHAR lMaskTable[8]
static
Initial value:
=
{
(1 << 8) - (1 << 0),
(1 << 7) - (1 << 0),
(1 << 6) - (1 << 0),
(1 << 5) - (1 << 0),
(1 << 4) - (1 << 0),
(1 << 3) - (1 << 0),
(1 << 2) - (1 << 0),
(1 << 1) - (1 << 0)
}

Definition at line 12 of file vga.c.

Referenced by VidSolidColorFill().

◆ lookup

◆ PixelMask

UCHAR PixelMask[8]
Initial value:
=
{
(1 << 7),
(1 << 6),
(1 << 5),
(1 << 4),
(1 << 3),
(1 << 2),
(1 << 1),
(1 << 0),
}

Definition at line 35 of file vga.c.

Referenced by ConsoleEfiGopIsPixelFormatSupported(), and SetPixel().

◆ rMaskTable

UCHAR rMaskTable[8]
static
Initial value:
=
{
(1 << 7),
(1 << 7)+ (1 << 6),
(1 << 7)+ (1 << 6) + (1 << 5),
(1 << 7)+ (1 << 6) + (1 << 5) + (1 << 4),
(1 << 7)+ (1 << 6) + (1 << 5) + (1 << 4) + (1 << 3),
(1 << 7)+ (1 << 6) + (1 << 5) + (1 << 4) + (1 << 3) + (1 << 2),
(1 << 7)+ (1 << 6) + (1 << 5) + (1 << 4) + (1 << 3) + (1 << 2) + (1 << 1),
(1 << 7)+ (1 << 6) + (1 << 5) + (1 << 4) + (1 << 3) + (1 << 2) + (1 << 1) +
(1 << 0),
}

Definition at line 23 of file vga.c.

Referenced by VidSolidColorFill().

◆ ScrollRegion

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

Definition at line 5 of file vga.c.

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

◆ VgaBase

◆ VgaRegisterBase

ULONG_PTR VgaRegisterBase = 0

Definition at line 66 of file vga.c.

Referenced by VgaInterpretCmdStream(), and VidInitialize().

◆ VidTextColor

ULONG VidTextColor = 0xF
static

Definition at line 70 of file vga.c.

Referenced by VidDisplayString(), and VidSetTextColor().