ReactOS  0.4.14-dev-1112-g2b067d6
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)
 
static VOID PrepareForSetPixel (VOID)
 
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 Restore)
 
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 ClearRow = FALSE
 

Macro Definition Documentation

◆ FONT_PTR_DELTA

#define FONT_PTR_DELTA   (1)

Definition at line 134 of file vga.c.

◆ GetFontPtr

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

Definition at line 133 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 121 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 405 of file vga.c.

412 {
413  ULONG sx, dx, dy;
414  UCHAR color;
415  ULONG offset = 0;
416  const ULONG Bottom = Top + Height;
417  const ULONG Right = Left + Width;
418 
419  /* Check if the buffer isn't 4bpp */
420  if (BitsPerPixel != 4)
421  {
422  /* FIXME: TODO */
423  DbgPrint("Unhandled BitBlt\n"
424  "%lux%lu @ (%lu|%lu)\n"
425  "Bits Per Pixel %lu\n"
426  "Buffer: %p. Delta: %lu\n",
427  Width,
428  Height,
429  Left,
430  Top,
431  BitsPerPixel,
432  Buffer,
433  Delta);
434  return;
435  }
436 
438 
439  /* 4bpp blitting */
440  for (dy = Top; dy < Bottom; ++dy)
441  {
442  sx = 0;
443  do
444  {
445  /* Extract color */
446  color = Buffer[offset + sx];
447 
448  /* Calc destination x */
449  dx = Left + (sx << 1);
450 
451  /* Set two pixels */
452  SetPixel(dx, dy, color >> 4);
453  SetPixel(dx + 1, dy, color & 0x0F);
454 
455  sx++;
456  } while (dx < Right);
457  offset += Delta;
458  }
459 }
#define DbgPrint
Definition: loader.c:25
GLint dy
Definition: linetemp.h:97
GLintptr offset
Definition: glext.h:5920
GLuint color
Definition: glext.h:6243
static VOID PrepareForSetPixel(VOID)
Definition: vga.c:91
Definition: bufpool.h:45
FORCEINLINE VOID SetPixel(IN ULONG Left, IN ULONG Top, IN UCHAR Color)
Definition: vga.c:105
unsigned char UCHAR
Definition: xmlstorage.h:181
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 139 of file vga.c.

144 {
145  PUCHAR FontChar, PixelPtr;
146  ULONG Height;
147  UCHAR Shift;
148 
150 
151  /* Calculate shift */
152  Shift = Left & 7;
153 
154  /* Get the font and pixel pointer */
155  FontChar = GetFontPtr(Character);
156  PixelPtr = (PUCHAR)(VgaBase + (Left >> 3) + (Top * (SCREEN_WIDTH / 8)));
157 
158  /* Loop all pixel rows */
159  for (Height = BOOTCHAR_HEIGHT; Height > 0; --Height)
160  {
161  SET_PIXELS(PixelPtr, *FontChar >> Shift, TextColor);
162  PixelPtr += (SCREEN_WIDTH / 8);
163  FontChar += FONT_PTR_DELTA;
164  }
165 
166  /* Check if we need to update neighbor bytes */
167  if (Shift)
168  {
169  /* Calculate shift for 2nd byte */
170  Shift = 8 - Shift;
171 
172  /* Get the font and pixel pointer (2nd byte) */
173  FontChar = GetFontPtr(Character);
174  PixelPtr = (PUCHAR)(VgaBase + (Left >> 3) + (Top * (SCREEN_WIDTH / 8)) + 1);
175 
176  /* Loop all pixel rows */
177  for (Height = BOOTCHAR_HEIGHT; Height > 0; --Height)
178  {
179  SET_PIXELS(PixelPtr, *FontChar << Shift, TextColor);
180  PixelPtr += (SCREEN_WIDTH / 8);
181  FontChar += FONT_PTR_DELTA;
182  }
183  }
184 
185  /* Check if the background color is transparent */
186  if (BackColor >= 16)
187  {
188  /* We are done */
189  return;
190  }
191 
192  /* Calculate shift */
193  Shift = Left & 7;
194 
195  /* Get the font and pixel pointer */
196  FontChar = GetFontPtr(Character);
197  PixelPtr = (PUCHAR)(VgaBase + (Left >> 3) + (Top * (SCREEN_WIDTH / 8)));
198 
199  /* Loop all pixel rows */
200  for (Height = BOOTCHAR_HEIGHT; Height > 0; --Height)
201  {
202  SET_PIXELS(PixelPtr, ~*FontChar >> Shift, BackColor);
203  PixelPtr += (SCREEN_WIDTH / 8);
204  FontChar += FONT_PTR_DELTA;
205  }
206 
207  /* Check if we need to update neighbor bytes */
208  if (Shift)
209  {
210  /* Calculate shift for 2nd byte */
211  Shift = 8 - Shift;
212 
213  /* Get the font and pixel pointer (2nd byte) */
214  FontChar = GetFontPtr(Character);
215  PixelPtr = (PUCHAR)(VgaBase + (Left >> 3) + (Top * (SCREEN_WIDTH / 8)) + 1);
216 
217  /* Loop all pixel rows */
218  for (Height = BOOTCHAR_HEIGHT; Height > 0; --Height)
219  {
220  SET_PIXELS(PixelPtr, ~*FontChar << Shift, BackColor);
221  PixelPtr += (SCREEN_WIDTH / 8);
222  FontChar += FONT_PTR_DELTA;
223  }
224  }
225 }
#define GetFontPtr(_Char)
Definition: vga.c:133
unsigned char * PUCHAR
Definition: retypes.h:3
#define BOOTCHAR_HEIGHT
Definition: precomp.h:11
#define FONT_PTR_DELTA
Definition: vga.c:134
static VOID PrepareForSetPixel(VOID)
Definition: vga.c:91
#define SET_PIXELS(_PixelPtr, _PixelMask, _TextColor)
Definition: vga.c:121
#define SCREEN_WIDTH
Definition: precomp.h:17
unsigned char UCHAR
Definition: xmlstorage.h:181
ULONG_PTR VgaBase
Definition: vga.c:66
_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 and adjust the position */
236  for (; *String; ++String, Left += 8)
237  {
238  /* Display a character */
239  DisplayCharacter(*String, Left, Top, TextColor, BackColor);
240  }
241 }
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:139
static LPHIST_ENTRY Top
Definition: history.c:53

Referenced by VidDisplayStringXY().

◆ InitializePalette()

VOID NTAPI InitializePalette ( VOID  )

Definition at line 291 of file vga.c.

292 {
293  ULONG PaletteEntry[16] = {0x000000,
294  0x000020,
295  0x002000,
296  0x002020,
297  0x200000,
298  0x200020,
299  0x202000,
300  0x202020,
301  0x303030,
302  0x00003F,
303  0x003F00,
304  0x003F3F,
305  0x3F0000,
306  0x3F003F,
307  0x3F3F00,
308  0x3F3F3F};
309  ULONG i;
310 
311  /* Loop all the entries and set their palettes */
312  for (i = 0; i < 16; i++) SetPaletteEntry(i, PaletteEntry[i]);
313 }
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:277
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 261 of file vga.c.

263 {
264  ULONG i;
265  PULONG Entry = Table;
266 
267  /* Loop every entry */
268  for (i = 0; i < Count; i++, Entry++)
269  {
270  /* Set the entry */
272  }
273 }
static VOID NTAPI SetPaletteEntryRGB(IN ULONG Id, IN ULONG Rgb)
Definition: vga.c:245
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().

◆ PrepareForSetPixel()

static VOID PrepareForSetPixel ( VOID  )
static

Definition at line 91 of file vga.c.

92 {
93  /* Switch to mode 10 */
94  ReadWriteMode(10);
95 
96  /* Clear the 4 planes (we're already in unchained mode here) */
98 
99  /* Select the color don't care register */
101 }
#define VGA_BASE_IO_PORT
Definition: vga.h:38
static VOID NTAPI ReadWriteMode(IN UCHAR Mode)
Definition: vga.c:76
#define GRAPH_ADDRESS_PORT
Definition: vga.h:81
#define __outpw(Port, Value)
Definition: precomp.h:68
#define SEQ_ADDRESS_PORT
Definition: vga.h:69

Referenced by BitBlt(), DisplayCharacter(), RleBitBlt(), and VidSolidColorFill().

◆ PreserveRow()

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

Definition at line 356 of file vga.c.

359 {
360  PUCHAR Position1, Position2;
361  ULONG Count;
362 
363  /* Clear the 4 planes */
365 
366  /* Set the bitmask to 0xFF for all 4 planes */
368 
369  /* Set Mode 1 */
370  ReadWriteMode(1);
371 
372  /* Calculate the position in memory for the row */
373  if (Restore)
374  {
375  /* Restore the row by copying back the contents saved off-screen */
376  Position1 = (PUCHAR)(VgaBase + CurrentTop * (SCREEN_WIDTH / 8));
377  Position2 = (PUCHAR)(VgaBase + SCREEN_HEIGHT * (SCREEN_WIDTH / 8));
378  }
379  else
380  {
381  /* Preserve the row by saving its contents off-screen */
382  Position1 = (PUCHAR)(VgaBase + SCREEN_HEIGHT * (SCREEN_WIDTH / 8));
383  Position2 = (PUCHAR)(VgaBase + CurrentTop * (SCREEN_WIDTH / 8));
384  }
385 
386  /* Set the count and loop every pixel */
387  Count = TopDelta * (SCREEN_WIDTH / 8);
388 #if defined(_M_IX86) || defined(_M_AMD64)
389  __movsb(Position1, Position2, Count);
390 #else
391  while (Count--)
392  {
393  /* Write the data back on the other position */
394  WRITE_REGISTER_UCHAR(Position1, READ_REGISTER_UCHAR(Position2));
395 
396  /* Increase both positions */
397  Position1++;
398  Position2++;
399  }
400 #endif
401 }
unsigned char * PUCHAR
Definition: retypes.h:3
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
#define SCREEN_HEIGHT
Definition: precomp.h:18
#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:76
#define GRAPH_ADDRESS_PORT
Definition: vga.h:81
#define SCREEN_WIDTH
Definition: precomp.h:17
NTKERNELAPI UCHAR NTAPI READ_REGISTER_UCHAR(IN PUCHAR Register)
#define __outpw(Port, Value)
Definition: precomp.h:68
#define SEQ_ADDRESS_PORT
Definition: vga.h:69
ULONG_PTR VgaBase
Definition: vga.c:66
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 76 of file vga.c.

77 {
78  UCHAR Value;
79 
80  /* Switch to graphics mode register */
82 
83  /* Get the current register value, minus the current mode */
85 
86  /* Set the new mode */
88 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2374
_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:59
#define IND_GRAPH_MODE
Definition: vga.h:112
#define __outpb(Port, Value)
Definition: precomp.h:65
#define GRAPH_DATA_PORT
Definition: vga.h:82

Referenced by PitReadData(), PitWriteCommand(), PitWriteData(), PrepareForSetPixel(), PreserveRow(), VgaScroll(), and VidScreenToBufferBlt().

◆ RleBitBlt()

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

Definition at line 463 of file vga.c.

468 {
469  ULONG YDelta;
470  ULONG x;
471  ULONG RleValue, NewRleValue;
472  ULONG Color, Color2;
473  ULONG i, j;
474  ULONG Code;
475 
477 
478  /* Set Y height and current X value and start loop */
479  YDelta = Top + Height - 1;
480  x = Left;
481  for (;;)
482  {
483  /* Get the current value and advance in the buffer */
484  RleValue = *Buffer;
485  Buffer++;
486  if (RleValue)
487  {
488  /* Check if we've gone past the edge */
489  if ((x + RleValue) > (Width + Left))
490  {
491  /* Fixup the pixel value */
492  RleValue = Left - x + Width;
493  }
494 
495  /* Get the new value */
496  NewRleValue = *Buffer;
497 
498  /* Get the two colors */
499  Color = NewRleValue >> 4;
500  Color2 = NewRleValue & 0xF;
501 
502  /* Increase buffer position */
503  Buffer++;
504 
505  /* Check if we need to do a fill */
506  if (Color == Color2)
507  {
508  /* Do a fill and continue the loop */
509  RleValue += x;
510  VidSolidColorFill(x, YDelta, RleValue - 1, YDelta, (UCHAR)Color);
511  x = RleValue;
512  continue;
513  }
514 
515  /* Check if the pixel value is 1 or below */
516  if (RleValue > 1)
517  {
518  /* Set loop variables */
519  for (i = (RleValue - 2) / 2 + 1; i > 0; --i)
520  {
521  /* Set the pixels */
522  SetPixel(x, YDelta, (UCHAR)Color);
523  x++;
524  SetPixel(x, YDelta, (UCHAR)Color2);
525  x++;
526 
527  /* Decrease pixel value */
528  RleValue -= 2;
529  }
530  }
531 
532  /* Check if there is any value at all */
533  if (RleValue)
534  {
535  /* Set the pixel and increase position */
536  SetPixel(x, YDelta, (UCHAR)Color);
537  x++;
538  }
539 
540  /* Start over */
541  continue;
542  }
543 
544  /* Get the current pixel value */
545  RleValue = *Buffer;
546  Code = RleValue;
547  switch (Code)
548  {
549  /* Case 0 */
550  case 0:
551  {
552  /* Set new x value, decrease distance and restart */
553  x = Left;
554  YDelta--;
555  Buffer++;
556  continue;
557  }
558 
559  /* Case 1 */
560  case 1:
561  {
562  /* Done */
563  return;
564  }
565 
566  /* Case 2 */
567  case 2:
568  {
569  /* Set new x value, decrease distance and restart */
570  Buffer++;
571  x += *Buffer;
572  Buffer++;
573  YDelta -= *Buffer;
574  Buffer++;
575  continue;
576  }
577 
578  /* Other values */
579  default:
580  {
581  Buffer++;
582  break;
583  }
584  }
585 
586  /* Check if we've gone past the edge */
587  if ((x + RleValue) > (Width + Left))
588  {
589  /* Set fixed up loop count */
590  i = RleValue - Left - Width + x;
591 
592  /* Fixup pixel value */
593  RleValue -= i;
594  }
595  else
596  {
597  /* Clear loop count */
598  i = 0;
599  }
600 
601  /* Check the value now */
602  if (RleValue > 1)
603  {
604  /* Set loop variables */
605  for (j = (RleValue - 2) / 2 + 1; j > 0; --j)
606  {
607  /* Get the new value */
608  NewRleValue = *Buffer;
609 
610  /* Get the two colors */
611  Color = NewRleValue >> 4;
612  Color2 = NewRleValue & 0xF;
613 
614  /* Increase buffer position */
615  Buffer++;
616 
617  /* Set the pixels */
618  SetPixel(x, YDelta, (UCHAR)Color);
619  x++;
620  SetPixel(x, YDelta, (UCHAR)Color2);
621  x++;
622 
623  /* Decrease pixel value */
624  RleValue -= 2;
625  }
626  }
627 
628  /* Check if there is any value at all */
629  if (RleValue)
630  {
631  /* Set the pixel and increase position */
632  Color = *Buffer >> 4;
633  Buffer++;
634  SetPixel(x, YDelta, (UCHAR)Color);
635  x++;
636  i--;
637  }
638 
639  /* Check loop count now */
640  if ((LONG)i > 0)
641  {
642  /* Decrease it */
643  i--;
644 
645  /* Set new position */
646  Buffer = Buffer + (i / 2) + 1;
647  }
648 
649  /* Check if we need to increase the buffer */
650  if ((ULONG_PTR)Buffer & 1) Buffer++;
651  }
652 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
struct Color Color
uint32_t ULONG_PTR
Definition: typedefs.h:64
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
static VOID PrepareForSetPixel(VOID)
Definition: vga.c:91
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:105
unsigned char UCHAR
Definition: xmlstorage.h:181
VOID NTAPI VidSolidColorFill(IN ULONG Left, IN ULONG Top, IN ULONG Right, IN ULONG Bottom, IN UCHAR Color)
Definition: vga.c:1010
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 277 of file vga.c.

279 {
280  /* Set the palette index */
282 
283  /* Set RGB colors */
284  __outpb(VGA_BASE_IO_PORT + DAC_DATA_REG_PORT, PaletteEntry & 0xFF);
285  __outpb(VGA_BASE_IO_PORT + DAC_DATA_REG_PORT, (PaletteEntry >>= 8) & 0xFF);
286  __outpb(VGA_BASE_IO_PORT + DAC_DATA_REG_PORT, (PaletteEntry >> 8) & 0xFF);
287 }
#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:65

Referenced by InitializePalette().

◆ SetPaletteEntryRGB()

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

Definition at line 245 of file vga.c.

247 {
248  PCHAR Colors = (PCHAR)&Rgb;
249 
250  /* Set the palette index */
252 
253  /* Set RGB colors */
257 }
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:65

Referenced by InitPaletteWithTable().

◆ SetPixel()

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

Definition at line 105 of file vga.c.

108 {
109  PUCHAR PixelPosition;
110 
111  /* Calculate the pixel position */
112  PixelPosition = (PUCHAR)(VgaBase + (Left >> 3) + (Top * (SCREEN_WIDTH / 8)));
113 
114  /* Select the bitmask register and write the mask */
116 
117  /* Read the current pixel value and add our color */
118  WRITE_REGISTER_UCHAR(PixelPosition, READ_REGISTER_UCHAR(PixelPosition) & Color);
119 }
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
#define SCREEN_WIDTH
Definition: precomp.h:17
NTKERNELAPI UCHAR NTAPI READ_REGISTER_UCHAR(IN PUCHAR Register)
#define __outpw(Port, Value)
Definition: precomp.h:68
ULONG_PTR VgaBase
Definition: vga.c:66
UCHAR PixelMask[8]
Definition: vga.c:34
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 317 of file vga.c.

318 {
319  ULONG Top, RowSize;
320  PUCHAR OldPosition, NewPosition;
321 
322  /* Clear the 4 planes */
324 
325  /* Set the bitmask to 0xFF for all 4 planes */
327 
328  /* Set Mode 1 */
329  ReadWriteMode(1);
330 
331  RowSize = (ScrollRegion[2] - ScrollRegion[0] + 1) / 8;
332 
333  /* Calculate the position in memory for the row */
334  OldPosition = (PUCHAR)(VgaBase + (ScrollRegion[1] + Scroll) * (SCREEN_WIDTH / 8) + ScrollRegion[0] / 8);
335  NewPosition = (PUCHAR)(VgaBase + ScrollRegion[1] * (SCREEN_WIDTH / 8) + ScrollRegion[0] / 8);
336 
337  /* Start loop */
338  for (Top = ScrollRegion[1]; Top <= ScrollRegion[3]; ++Top)
339  {
340 #if defined(_M_IX86) || defined(_M_AMD64)
341  __movsb(NewPosition, OldPosition, RowSize);
342 #else
343  ULONG i;
344 
345  /* Scroll the row */
346  for (i = 0; i < RowSize; ++i)
347  WRITE_REGISTER_UCHAR(NewPosition + i, READ_REGISTER_UCHAR(OldPosition + i));
348 #endif
349  OldPosition += (SCREEN_WIDTH / 8);
350  NewPosition += (SCREEN_WIDTH / 8);
351  }
352 }
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:76
#define GRAPH_ADDRESS_PORT
Definition: vga.h:81
#define SCREEN_WIDTH
Definition: precomp.h:17
NTKERNELAPI UCHAR NTAPI READ_REGISTER_UCHAR(IN PUCHAR Register)
#define __outpw(Port, Value)
Definition: precomp.h:68
#define SEQ_ADDRESS_PORT
Definition: vga.h:69
static ULONG ScrollRegion[4]
Definition: vga.c:5
ULONG_PTR VgaBase
Definition: vga.c:66
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 834 of file vga.c.

837 {
838  PBITMAPINFOHEADER BitmapInfoHeader;
839  LONG Delta;
840  PUCHAR BitmapOffset;
841 
842  /* Get the Bitmap Header */
843  BitmapInfoHeader = (PBITMAPINFOHEADER)Buffer;
844 
845  /* Initialize the palette */
846  InitPaletteWithTable((PULONG)(Buffer + BitmapInfoHeader->biSize),
847  (BitmapInfoHeader->biClrUsed) ?
848  BitmapInfoHeader->biClrUsed : 16);
849 
850  /* Make sure we can support this bitmap */
851  ASSERT((BitmapInfoHeader->biBitCount * BitmapInfoHeader->biPlanes) <= 4);
852 
853  /*
854  * Calculate the delta and align it on 32-bytes, then calculate
855  * the actual start of the bitmap data.
856  */
857  Delta = (BitmapInfoHeader->biBitCount * BitmapInfoHeader->biWidth) + 31;
858  Delta >>= 3;
859  Delta &= ~3;
860  BitmapOffset = Buffer + sizeof(BITMAPINFOHEADER) + 16 * sizeof(ULONG);
861 
862  /* Check the compression of the bitmap */
863  if (BitmapInfoHeader->biCompression == BI_RLE4)
864  {
865  /* Make sure we have a width and a height */
866  if ((BitmapInfoHeader->biWidth) && (BitmapInfoHeader->biHeight))
867  {
868  /* We can use RLE Bit Blt */
869  RleBitBlt(Left,
870  Top,
871  BitmapInfoHeader->biWidth,
872  BitmapInfoHeader->biHeight,
873  BitmapOffset);
874  }
875  }
876  else
877  {
878  /* Check if the height is negative */
879  if (BitmapInfoHeader->biHeight < 0)
880  {
881  /* Make it positive in the header */
882  BitmapInfoHeader->biHeight *= -1;
883  }
884  else
885  {
886  /* Update buffer offset */
887  BitmapOffset += ((BitmapInfoHeader->biHeight - 1) * Delta);
888  Delta *= -1;
889  }
890 
891  /* Make sure we have a width and a height */
892  if ((BitmapInfoHeader->biWidth) && (BitmapInfoHeader->biHeight))
893  {
894  /* Do the BitBlt */
895  BitBlt(Left,
896  Top,
897  BitmapInfoHeader->biWidth,
898  BitmapInfoHeader->biHeight,
899  BitmapOffset,
900  BitmapInfoHeader->biBitCount,
901  Delta);
902  }
903  }
904 }
USHORT biBitCount
Definition: precomp.h:31
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
unsigned char * PUCHAR
Definition: retypes.h:3
ULONG biCompression
Definition: precomp.h:32
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:405
static VOID NTAPI RleBitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer)
Definition: vga.c:463
struct tagBITMAPINFOHEADER * PBITMAPINFOHEADER
long LONG
Definition: pedump.c:60
static VOID NTAPI InitPaletteWithTable(IN PULONG Table, IN ULONG Count)
Definition: vga.c:261
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:42
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 733 of file vga.c.

739 {
740  /* Make sure we have a width and height */
741  if (!Width || !Height) return;
742 
743  /* Call the helper function */
744  BitBlt(Left, Top, Width, Height, Buffer, 4, Delta);
745 }
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:405
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 721 of file vga.c.

722 {
723  /* Select bit mask register and clear it */
726 }
#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:65
#define GRAPH_DATA_PORT
Definition: vga.h:82

◆ VidDisplayString()

VOID NTAPI VidDisplayString ( IN PUCHAR  String)

Definition at line 752 of file vga.c.

753 {
754  ULONG TopDelta = BOOTCHAR_HEIGHT + 1;
755 
756  /* Start looping the string */
757  for (; *String; ++String)
758  {
759  /* Treat new-line separately */
760  if (*String == '\n')
761  {
762  /* Modify Y position */
763  curr_y += TopDelta;
764  if (curr_y + TopDelta - 1 > ScrollRegion[3])
765  {
766  /* Scroll the view and clear the current row */
767  VgaScroll(TopDelta);
768  curr_y -= TopDelta;
769  PreserveRow(curr_y, TopDelta, TRUE);
770  }
771  else
772  {
773  /* Preserve the current row */
774  PreserveRow(curr_y, TopDelta, FALSE);
775  }
776 
777  /* Update current X */
778  curr_x = ScrollRegion[0];
779 
780  /* No need to clear this row */
781  ClearRow = FALSE;
782  }
783  else if (*String == '\r')
784  {
785  /* Update current X */
786  curr_x = ScrollRegion[0];
787 
788  /* If a new-line does not follow we will clear the current row */
789  if (String[1] != '\n') ClearRow = TRUE;
790  }
791  else
792  {
793  /* Clear the current row if we had a return-carriage without a new-line */
794  if (ClearRow)
795  {
796  PreserveRow(curr_y, TopDelta, TRUE);
797  ClearRow = FALSE;
798  }
799 
800  /* Display this character */
802  curr_x += 8;
803 
804  /* Check if we should scroll */
805  if (curr_x + 7 > ScrollRegion[2])
806  {
807  /* Update Y position and check if we should scroll it */
808  curr_y += TopDelta;
809  if (curr_y + TopDelta - 1 > ScrollRegion[3])
810  {
811  /* Scroll the view and clear the current row */
812  VgaScroll(TopDelta);
813  curr_y -= TopDelta;
814  PreserveRow(curr_y, TopDelta, TRUE);
815  }
816  else
817  {
818  /* Preserve the current row */
819  PreserveRow(curr_y, TopDelta, FALSE);
820  }
821 
822  /* Update current X */
823  curr_x = ScrollRegion[0];
824  }
825  }
826  }
827 }
#define TRUE
Definition: types.h:120
static VOID NTAPI VgaScroll(IN ULONG Scroll)
Definition: vga.c:317
static ULONG VidTextColor
Definition: vga.c:69
static WCHAR String[]
Definition: stringtable.c:55
#define BOOTCHAR_HEIGHT
Definition: precomp.h:11
ULONG curr_y
Definition: vga.c:68
static ULONG ScrollRegion[4]
Definition: vga.c:5
static VOID NTAPI PreserveRow(IN ULONG CurrentTop, IN ULONG TopDelta, IN BOOLEAN Restore)
Definition: vga.c:356
static BOOLEAN ClearRow
Definition: vga.c:70
static VOID NTAPI DisplayCharacter(IN CHAR Character, IN ULONG Left, IN ULONG Top, IN ULONG TextColor, IN ULONG BackColor)
Definition: vga.c:139
unsigned int ULONG
Definition: retypes.h:1
ULONG curr_x
Definition: vga.c:67

◆ VidDisplayStringXY()

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

Definition at line 676 of file vga.c.

680 {
681  ULONG BackColor;
682 
683  /*
684  * If the caller wanted transparent, then send the special value (16),
685  * else use our default and call the helper routine.
686  */
687  BackColor = Transparent ? 16 : 14;
688  DisplayStringXY(String, Left, Top, 12, BackColor);
689 }
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 911 of file vga.c.

917 {
918  ULONG Plane;
919  ULONG XDistance;
920  ULONG LeftDelta, RightDelta;
921  ULONG PixelOffset;
922  PUCHAR PixelPosition;
923  PUCHAR k, i;
924  PULONG m;
925  UCHAR Value, Value2;
926  UCHAR a;
927  ULONG b;
928  ULONG x, y;
929 
930  /* Calculate total distance to copy on X */
931  XDistance = Left + Width - 1;
932 
933  /* Calculate the 8-byte left and right deltas */
934  LeftDelta = Left & 7;
935  RightDelta = 8 - LeftDelta;
936 
937  /* Clear the destination buffer */
938  RtlZeroMemory(Buffer, Delta * Height);
939 
940  /* Calculate the pixel offset and convert the X distance into byte form */
941  PixelOffset = Top * (SCREEN_WIDTH / 8) + (Left >> 3);
942  XDistance >>= 3;
943 
944  /* Loop the 4 planes */
945  for (Plane = 0; Plane < 4; ++Plane)
946  {
947  /* Set the current pixel position and reset buffer loop variable */
948  PixelPosition = (PUCHAR)(VgaBase + PixelOffset);
949  i = Buffer;
950 
951  /* Set Mode 0 */
952  ReadWriteMode(0);
953 
954  /* Set the current plane */
956 
957  /* Start the outer Y height loop */
958  for (y = Height; y > 0; --y)
959  {
960  /* Read the current value */
961  m = (PULONG)i;
962  Value = READ_REGISTER_UCHAR(PixelPosition);
963 
964  /* Set Pixel Position loop variable */
965  k = PixelPosition + 1;
966 
967  /* Check if we're still within bounds */
968  if (Left <= XDistance)
969  {
970  /* Start the X inner loop */
971  for (x = (XDistance - Left) + 1; x > 0; --x)
972  {
973  /* Read the current value */
974  Value2 = READ_REGISTER_UCHAR(k);
975 
976  /* Increase pixel position */
977  k++;
978 
979  /* Do the blt */
980  a = Value2 >> (UCHAR)RightDelta;
981  a |= Value << (UCHAR)LeftDelta;
982  b = lookup[a & 0xF];
983  a >>= 4;
984  b <<= 16;
985  b |= lookup[a];
986 
987  /* Save new value to buffer */
988  *m |= (b << Plane);
989 
990  /* Move to next destination location */
991  m++;
992 
993  /* Write new value */
994  Value = Value2;
995  }
996  }
997 
998  /* Update pixel position */
999  PixelPosition += (SCREEN_WIDTH / 8);
1000  i += Delta;
1001  }
1002  }
1003 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2374
unsigned char * PUCHAR
Definition: retypes.h:3
static ULONG lookup[16]
Definition: vga.c:45
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:76
#define GRAPH_ADDRESS_PORT
Definition: vga.h:81
#define SCREEN_WIDTH
Definition: precomp.h:17
unsigned char UCHAR
Definition: xmlstorage.h:181
NTKERNELAPI UCHAR NTAPI READ_REGISTER_UCHAR(IN PUCHAR Register)
#define __outpw(Port, Value)
Definition: precomp.h:68
ULONG_PTR VgaBase
Definition: vga.c:66
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:262
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 696 of file vga.c.

700 {
701  /* Assert alignment */
702  ASSERT((Left & 0x7) == 0);
703  ASSERT((Right & 0x7) == 7);
704 
705  /* Set Scroll Region */
706  ScrollRegion[0] = Left;
707  ScrollRegion[1] = Top;
708  ScrollRegion[2] = Right;
709  ScrollRegion[3] = Bottom;
710 
711  /* Set current X and Y */
712  curr_x = Left;
713  curr_y = Top;
714 }
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
ULONG curr_y
Definition: vga.c:68
static LPHIST_ENTRY Bottom
Definition: history.c:54
static ULONG ScrollRegion[4]
Definition: vga.c:5
ULONG curr_x
Definition: vga.c:67
static LPHIST_ENTRY Top
Definition: history.c:53

◆ VidSetTextColor()

ULONG NTAPI VidSetTextColor ( IN ULONG  Color)

Definition at line 661 of file vga.c.

662 {
663  ULONG OldColor;
664 
665  /* Save the old color and set the new one */
666  OldColor = VidTextColor;
668  return OldColor;
669 }
static ULONG VidTextColor
Definition: vga.c:69
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 1010 of file vga.c.

1015 {
1016  ULONG rMask, lMask;
1017  ULONG LeftOffset, RightOffset, Distance;
1018  PUCHAR Offset;
1019  ULONG i, j;
1020 
1021  /* Get the left and right masks, shifts, and delta */
1022  LeftOffset = Left >> 3;
1023  lMask = (lMaskTable[Left & 0x7] << 8) | IND_BIT_MASK;
1024  RightOffset = Right >> 3;
1025  rMask = (rMaskTable[Right & 0x7] << 8) | IND_BIT_MASK;
1026  Distance = RightOffset - LeftOffset;
1027 
1028  /* If there is no distance, then combine the right and left masks */
1029  if (!Distance) lMask &= rMask;
1030 
1032 
1033  /* Calculate pixel position for the read */
1034  Offset = (PUCHAR)(VgaBase + (Top * (SCREEN_WIDTH / 8)) + LeftOffset);
1035 
1036  /* Select the bitmask register and write the mask */
1038 
1039  /* Check if the top coord is below the bottom one */
1040  if (Top <= Bottom)
1041  {
1042  /* Start looping each line */
1043  for (i = (Bottom - Top) + 1; i > 0; --i)
1044  {
1045  /* Read the previous value and add our color */
1047 
1048  /* Move to the next line */
1049  Offset += (SCREEN_WIDTH / 8);
1050  }
1051  }
1052 
1053  /* Check if we have a delta */
1054  if (Distance > 0)
1055  {
1056  /* Calculate new pixel position */
1057  Offset = (PUCHAR)(VgaBase + (Top * (SCREEN_WIDTH / 8)) + RightOffset);
1058  Distance--;
1059 
1060  /* Select the bitmask register and write the mask */
1062 
1063  /* Check if the top coord is below the bottom one */
1064  if (Top <= Bottom)
1065  {
1066  /* Start looping each line */
1067  for (i = (Bottom - Top) + 1; i > 0; --i)
1068  {
1069  /* Read the previous value and add our color */
1071 
1072  /* Move to the next line */
1073  Offset += (SCREEN_WIDTH / 8);
1074  }
1075  }
1076 
1077  /* Check if we still have a delta */
1078  if (Distance > 0)
1079  {
1080  /* Calculate new pixel position */
1081  Offset = (PUCHAR)(VgaBase + (Top * (SCREEN_WIDTH / 8)) + LeftOffset + 1);
1082 
1083  /* Set the bitmask to 0xFF for all 4 planes */
1085 
1086  /* Check if the top coord is below the bottom one */
1087  if (Top <= Bottom)
1088  {
1089  /* Start looping each line */
1090  for (i = (Bottom - Top) + 1; i > 0; --i)
1091  {
1092  /* Loop the shift delta */
1093  for (j = Distance; j > 0; Offset++, --j)
1094  {
1095  /* Write the color */
1097  }
1098 
1099  /* Update position in memory */
1100  Offset += ((SCREEN_WIDTH / 8) - Distance);
1101  }
1102  }
1103  }
1104  }
1105 }
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
static VOID PrepareForSetPixel(VOID)
Definition: vga.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
#define IND_BIT_MASK
Definition: vga.h:114
#define GRAPH_ADDRESS_PORT
Definition: vga.h:81
#define SCREEN_WIDTH
Definition: precomp.h:17
NTKERNELAPI UCHAR NTAPI READ_REGISTER_UCHAR(IN PUCHAR Register)
#define __outpw(Port, Value)
Definition: precomp.h:68
static LPHIST_ENTRY Bottom
Definition: history.c:54
ULONG_PTR VgaBase
Definition: vga.c:66
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

◆ ClearRow

BOOLEAN ClearRow = FALSE
static

Definition at line 70 of file vga.c.

Referenced by VidDisplayString().

◆ curr_x

ULONG curr_x = 0

Definition at line 67 of file vga.c.

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

◆ curr_y

ULONG curr_y = 0

Definition at line 68 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 34 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,
}
#define SCREEN_HEIGHT
Definition: precomp.h:18
#define SCREEN_WIDTH
Definition: precomp.h:17

Definition at line 5 of file vga.c.

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

◆ VgaBase

◆ VgaRegisterBase

ULONG_PTR VgaRegisterBase = 0

Definition at line 65 of file vga.c.

Referenced by VgaInterpretCmdStream(), and VidInitialize().

◆ VidTextColor

ULONG VidTextColor = 0xF
static

Definition at line 69 of file vga.c.

Referenced by VidDisplayString(), and VidSetTextColor().