ReactOS 0.4.15-dev-8135-g1bc6c90
svga.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _VGA_REGISTERS
 
struct  _SVGA_REGISTERS
 
struct  _CHAR_CELL
 

Macros

#define VGA_NUM_BANKS   4
 
#define VGA_BANK_SIZE   0x10000
 
#define VGA_MAX_COLORS   256
 
#define VGA_PALETTE_SIZE   (VGA_MAX_COLORS * 3)
 
#define VGA_BITMAP_INFO_SIZE   (sizeof(BITMAPINFOHEADER) + 2 * (VGA_PALETTE_SIZE / 3))
 
#define VGA_MINIMUM_WIDTH   400
 
#define VGA_MINIMUM_HEIGHT   300
 
#define VGA_DAC_TO_COLOR(x)   (((x) << 2) | ((x) >> 4))
 
#define VGA_COLOR_TO_DAC(x)   ((x) >> 2)
 
#define VGA_INTERLACE_HIGH_BIT   (1 << 13)
 
#define VGA_FONT_BANK   2
 
#define VGA_FONT_CHARACTERS   256
 
#define VGA_MAX_FONT_HEIGHT   32
 
#define VGA_FONT_SIZE   (VGA_FONT_CHARACTERS * VGA_MAX_FONT_HEIGHT)
 
#define VGA_CLOCK_BASE   14318181
 
#define SVGA_IS_UNLOCKED   (VgaSeqRegisters[SVGA_SEQ_UNLOCK_REG] == SVGA_SEQ_UNLOCKED)
 
#define SVGA_BANK_SIZE   0x100000
 
#define SVGA_SEQ_MAX_UNLOCKED_REG   (SVGA_IS_UNLOCKED ? SVGA_SEQ_MAX_REG : SVGA_SEQ_EXT_MODE_REG)
 
#define SVGA_CRTC_MAX_UNLOCKED_REG   (SVGA_IS_UNLOCKED ? SVGA_CRTC_MAX_REG : VGA_CRTC_MAX_REG)
 
#define SVGA_GC_MAX_UNLOCKED_REG   (SVGA_IS_UNLOCKED ? SVGA_GC_MAX_REG : VGA_GC_MAX_REG)
 
#define VGA_MISC_READ   0x3CC
 
#define VGA_MISC_WRITE   0x3C2
 
#define VGA_INSTAT0_READ   0x3C2
 
#define VGA_INSTAT1_READ_MONO   0x3BA
 
#define VGA_INSTAT1_READ_COLOR   0x3DA
 
#define VGA_FEATURE_READ   0x3CA
 
#define VGA_FEATURE_WRITE_MONO   0x3BA
 
#define VGA_FEATURE_WRITE_COLOR   0x3DA
 
#define VGA_AC_INDEX   0x3C0
 
#define VGA_AC_WRITE   0x3C0
 
#define VGA_AC_READ   0x3C1
 
#define VGA_SEQ_INDEX   0x3C4
 
#define VGA_SEQ_DATA   0x3C5
 
#define VGA_DAC_MASK   0x3C6
 
#define VGA_DAC_READ_INDEX   0x3C7
 
#define VGA_DAC_WRITE_INDEX   0x3C8
 
#define VGA_DAC_DATA   0x3C9
 
#define VGA_CRTC_INDEX_MONO   0x3B4
 
#define VGA_CRTC_DATA_MONO   0x3B5
 
#define VGA_CRTC_INDEX_COLOR   0x3D4
 
#define VGA_CRTC_DATA_COLOR   0x3D5
 
#define VGA_GC_INDEX   0x3CE
 
#define VGA_GC_DATA   0x3CF
 
#define VGA_SEQ_INDEX_MASK   0x1F
 
#define VGA_GC_INDEX_MASK   0x3F
 
#define VGA_CRTC_INDEX_MASK   0x3F
 
#define VGA_MISC_COLOR   (1 << 0)
 
#define VGA_MISC_RAM_ENABLED   (1 << 1)
 
#define VGA_MISC_OE_PAGESEL   (1 << 5)
 
#define VGA_MISC_HSYNCP   (1 << 6)
 
#define VGA_MISC_VSYNCP   (1 << 7)
 
#define VGA_STAT_DD   (1 << 0)
 
#define VGA_STAT_VRETRACE   (1 << 3)
 
#define VGA_SEQ_RESET_AR   (1 << 0)
 
#define VGA_SEQ_RESET_SR   (1 << 1)
 
#define VGA_SEQ_CLOCK_98DM   (1 << 0)
 
#define VGA_SEQ_CLOCK_SLR   (1 << 2)
 
#define VGA_SEQ_CLOCK_DCR   (1 << 3)
 
#define VGA_SEQ_CLOCK_S4   (1 << 4)
 
#define VGA_SEQ_CLOCK_SD   (1 << 5)
 
#define VGA_SEQ_MEM_EXT   (1 << 1)
 
#define VGA_SEQ_MEM_OE_DIS   (1 << 2)
 
#define VGA_SEQ_MEM_C4   (1 << 3)
 
#define SVGA_SEQ_LOCKED   0x0F
 
#define SVGA_SEQ_UNLOCK_MASK   0x17
 
#define SVGA_SEQ_UNLOCKED   0x12
 
#define SVGA_SEQ_EXT_MODE_HIGH_RES   (1 << 0)
 
#define SVGA_SEQ_EXT_CONTROL_MMIO   (1 << 2)
 
#define SVGA_SEQ_EXT_CONTROL_MMIO_HIGH   (1 << 6)
 
#define SVGA_SEQ_MCLK_VCLK   (1 << 6)
 
#define VGA_CRTC_OVERFLOW_VT8   (1 << 0)
 
#define VGA_CRTC_OVERFLOW_VDE8   (1 << 1)
 
#define VGA_CRTC_OVERFLOW_VRS8   (1 << 2)
 
#define VGA_CRTC_OVERFLOW_SVB8   (1 << 3)
 
#define VGA_CRTC_OVERFLOW_LC8   (1 << 4)
 
#define VGA_CRTC_OVERFLOW_VT9   (1 << 5)
 
#define VGA_CRTC_OVERFLOW_VDE9   (1 << 6)
 
#define VGA_CRTC_OVERFLOW_VRS9   (1 << 7)
 
#define VGA_CRTC_UNDERLINE_DWORD   (1 << 6)
 
#define VGA_CRTC_MAXSCANLINE_DOUBLE   (1 << 7)
 
#define VGA_CRTC_MAXSCANLINE_LC9   (1 << 6)
 
#define VGA_CRTC_MODE_CONTROL_WRAP   (1 << 5)
 
#define VGA_CRTC_MODE_CONTROL_BYTE   (1 << 6)
 
#define VGA_CRTC_MODE_CONTROL_SYNC   (1 << 7)
 
#define SVGA_CRTC_EXT_ADDR_BIT16   (1 << 0)
 
#define SVGA_CRTC_EXT_ADDR_WRAP   (1 << 1)
 
#define SVGA_CRTC_EXT_ADDR_BITS1718   ((1 << 2) | (1 << 3))
 
#define SVGA_CRTC_EXT_OFFSET_BIT8   (1 << 4)
 
#define SVGA_CRTC_EXT_ADDR_BIT19   (1 << 7)
 
#define VGA_GC_MODE_READ   (1 << 3)
 
#define VGA_GC_MODE_OE   (1 << 4)
 
#define VGA_GC_MODE_SHIFTREG   (1 << 5)
 
#define VGA_GC_MODE_SHIFT256   (1 << 6)
 
#define VGA_GC_MISC_NOALPHA   (1 << 0)
 
#define VGA_GC_MISC_OE   (1 << 1)
 
#define SVGA_GC_EXT_MODE_WND_B   (1 << 0)
 
#define SVGA_GC_EXT_MODE_GRAN   (1 << 5)
 
#define VGA_AC_CONTROL_ATGE   (1 << 0)
 
#define VGA_AC_CONTROL_MONO   (1 << 1)
 
#define VGA_AC_CONTROL_LGE   (1 << 2)
 
#define VGA_AC_CONTROL_BLINK   (1 << 3)
 
#define VGA_AC_CONTROL_PPM   (1 << 5)
 
#define VGA_AC_CONTROL_8BIT   (1 << 6)
 
#define VGA_AC_CONTROL_P54S   (1 << 7)
 

Typedefs

typedef struct _VGA_REGISTERS VGA_REGISTERS
 
typedef struct _VGA_REGISTERSPVGA_REGISTERS
 
typedef struct _SVGA_REGISTERS SVGA_REGISTERS
 
typedef struct _SVGA_REGISTERSPSVGA_REGISTERS
 
typedef struct _CHAR_CELL CHAR_CELL
 
typedef struct _CHAR_CELLPCHAR_CELL
 

Enumerations

enum  {
  VGA_SEQ_RESET_REG , VGA_SEQ_CLOCK_REG , VGA_SEQ_MASK_REG , VGA_SEQ_CHAR_REG ,
  VGA_SEQ_MEM_REG , VGA_SEQ_MAX_REG , SVGA_SEQ_UNLOCK_REG , SVGA_SEQ_EXT_MODE_REG ,
  SVGA_SEQ_EEPROM_REG , SVGA_SEQ_SCRATCH_0_REG , SVGA_SEQ_SCRATCH_1_REG , SVGA_SEQ_VCLK0_NUMERATOR_REG ,
  SVGA_SEQ_VCLK1_NUMERATOR_REG , SVGA_SEQ_VCLK2_NUMERATOR_REG , SVGA_SEQ_VCLK3_NUMERATOR_REG , SVGA_SEQ_DRAM_REG ,
  SVGA_SEQ_CURSOR_X_REG , SVGA_SEQ_CURSOR_Y_REG , SVGA_SEQ_CURSOR_ATTR_REG , SVGA_SEQ_CURSOR_PATTERN_REG ,
  SVGA_SEQ_SCRATCH_2_REG , SVGA_SEQ_SCRATCH_3_REG , SVGA_SEQ_PERFORMANCE_REG , SVGA_SEQ_EXT_CONTROL_REG ,
  SVGA_SEQ_SIG_GEN_CONTROL_REG , SVGA_SEQ_SIG_GEN_RESULT_LOW_REG , SVGA_SEQ_SIG_GEN_RESULT_HIGH_REG , SVGA_SEQ_VCLK0_DENOMINATOR_REG ,
  SVGA_SEQ_VCLK1_DENOMINATOR_REG , SVGA_SEQ_VCLK2_DENOMINATOR_REG , SVGA_SEQ_VCLK3_DENOMINATOR_REG , SVGA_SEQ_MCLK_REG ,
  SVGA_SEQ_MAX_REG
}
 
enum  {
  VGA_CRTC_HORZ_TOTAL_REG , VGA_CRTC_END_HORZ_DISP_REG , VGA_CRTC_START_HORZ_BLANKING_REG , VGA_CRTC_END_HORZ_BLANKING_REG ,
  VGA_CRTC_START_HORZ_RETRACE_REG , VGA_CRTC_END_HORZ_RETRACE_REG , VGA_CRTC_VERT_TOTAL_REG , VGA_CRTC_OVERFLOW_REG ,
  VGA_CRTC_PRESET_ROW_SCAN_REG , VGA_CRTC_MAX_SCAN_LINE_REG , VGA_CRTC_CURSOR_START_REG , VGA_CRTC_CURSOR_END_REG ,
  VGA_CRTC_START_ADDR_HIGH_REG , VGA_CRTC_START_ADDR_LOW_REG , VGA_CRTC_CURSOR_LOC_HIGH_REG , VGA_CRTC_CURSOR_LOC_LOW_REG ,
  VGA_CRTC_START_VERT_RETRACE_REG , VGA_CRTC_END_VERT_RETRACE_REG , VGA_CRTC_VERT_DISP_END_REG , VGA_CRTC_OFFSET_REG ,
  VGA_CRTC_UNDERLINE_REG , VGA_CRTC_START_VERT_BLANKING_REG , VGA_CRTC_END_VERT_BLANKING_REG , VGA_CRTC_MODE_CONTROL_REG ,
  VGA_CRTC_LINE_COMPARE_REG , VGA_CRTC_MAX_REG , SVGA_CRTC_INTERLACE_END_REG = VGA_CRTC_MAX_REG , SVGA_CRTC_MISC_CONTROL_REG ,
  SVGA_CRTC_EXT_DISPLAY_REG , SVGA_CRTC_SYNC_ADJUST_REG , SVGA_CRTC_OVERLAY_REG , SVGA_CRTC_UNUSED0_REG ,
  SVGA_CRTC_UNUSED1_REG , SVGA_CRTC_UNUSED2_REG , SVGA_CRTC_UNUSED3_REG , SVGA_CRTC_UNUSED4_REG ,
  SVGA_CRTC_UNUSED5_REG , SVGA_CRTC_UNUSED6_REG , SVGA_CRTC_PART_STATUS_REG , SVGA_CRTC_UNUSED7_REG ,
  SVGA_CRTC_ID_REG , SVGA_CRTC_MAX_REG
}
 
enum  {
  VGA_GC_RESET_REG , VGA_GC_ENABLE_RESET_REG , VGA_GC_COLOR_COMPARE_REG , VGA_GC_ROTATE_REG ,
  VGA_GC_READ_MAP_SEL_REG , VGA_GC_MODE_REG , VGA_GC_MISC_REG , VGA_GC_COLOR_IGNORE_REG ,
  VGA_GC_BITMASK_REG , VGA_GC_MAX_REG , SVGA_GC_OFFSET_0_REG = VGA_GC_MAX_REG , SVGA_GC_OFFSET_1_REG ,
  SVGA_GC_EXT_MODE_REG , SVGA_GC_COLOR_COMPARE_REG , SVGA_GC_BITMASK_REG , SVGA_GC_POWER_MANAGEMENT_REG ,
  SVGA_GC_UNUSED0_REG , SVGA_GC_BACKGROUND_1_REG , SVGA_GC_FOREGROUND_1_REG , SVGA_GC_BACKGROUND_2_REG ,
  SVGA_GC_FOREGROUND_2_REG , SVGA_GC_BACKGROUND_3_REG , SVGA_GC_FOREGROUND_3_REG , SVGA_GC_UNUSED1_REG ,
  SVGA_GC_UNUSED2_REG , SVGA_GC_UNUSED3_REG , SVGA_GC_UNUSED4_REG , SVGA_GC_UNUSED5_REG ,
  SVGA_GC_UNUSED6_REG , SVGA_GC_UNUSED7_REG , SVGA_GC_UNUSED8_REG , SVGA_GC_UNUSED9_REG ,
  SVGA_GC_UNUSED10_REG , SVGA_GC_BLT_WIDTH_LOW_REG , SVGA_GC_BLT_WIDTH_HIGH_REG , SVGA_GC_BLT_HEIGHT_LOW_REG ,
  SVGA_GC_BLT_HEIGHT_HIGH_REG , SVGA_GC_BLT_DEST_PITCH_LOW_REG , SVGA_GC_BLT_DEST_PITCH_HIGH_REG , SVGA_GC_BLT_SRC_PITCH_LOW_REG ,
  SVGA_GC_BLT_SRC_PITCH_HIGH_REG , SVGA_GC_BLT_DEST_START_0_REG , SVGA_GC_BLT_DEST_START_1_REG , SVGA_GC_BLT_DEST_START_2_REG ,
  SVGA_GC_UNUSED11_REG , SVGA_GC_BLT_SRC_START_0_REG , SVGA_GC_BLT_SRC_START_1_REG , SVGA_GC_BLT_SRC_START_2_REG ,
  SVGA_GC_BLT_DEST_MASK_REG , SVGA_GC_BLT_MODE_REG , SVGA_GC_BLT_STATUS_REG , SVGA_GC_BLT_ROP_REG ,
  SVGA_GC_BLT_EXT_MODE_REG , SVGA_GC_MAX_REG
}
 
enum  {
  VGA_AC_PAL_0_REG , VGA_AC_PAL_1_REG , VGA_AC_PAL_2_REG , VGA_AC_PAL_3_REG ,
  VGA_AC_PAL_4_REG , VGA_AC_PAL_5_REG , VGA_AC_PAL_6_REG , VGA_AC_PAL_7_REG ,
  VGA_AC_PAL_8_REG , VGA_AC_PAL_9_REG , VGA_AC_PAL_A_REG , VGA_AC_PAL_B_REG ,
  VGA_AC_PAL_C_REG , VGA_AC_PAL_D_REG , VGA_AC_PAL_E_REG , VGA_AC_PAL_F_REG ,
  VGA_AC_CONTROL_REG , VGA_AC_OVERSCAN_REG , VGA_AC_COLOR_PLANE_REG , VGA_AC_HORZ_PANNING_REG ,
  VGA_AC_COLOR_SEL_REG , VGA_AC_MAX_REG
}
 

Functions

 C_ASSERT (sizeof(CHAR_CELL)==2)
 
COORD VgaGetDisplayResolution (VOID)
 
VOID VgaRefreshDisplay (VOID)
 
VOID FASTCALL VgaReadMemory (ULONG Address, PVOID Buffer, ULONG Size)
 
BOOLEAN FASTCALL VgaWriteMemory (ULONG Address, PVOID Buffer, ULONG Size)
 
VOID VgaWriteTextModeFont (UINT FontNumber, CONST UCHAR *FontData, UINT Height)
 
VOID VgaClearMemory (VOID)
 
BOOLEAN VgaInitialize (HANDLE TextHandle)
 
VOID VgaCleanup (VOID)
 

Macro Definition Documentation

◆ SVGA_BANK_SIZE

#define SVGA_BANK_SIZE   0x100000

Definition at line 31 of file svga.h.

◆ SVGA_CRTC_EXT_ADDR_BIT16

#define SVGA_CRTC_EXT_ADDR_BIT16   (1 << 0)

Definition at line 193 of file svga.h.

◆ SVGA_CRTC_EXT_ADDR_BIT19

#define SVGA_CRTC_EXT_ADDR_BIT19   (1 << 7)

Definition at line 199 of file svga.h.

◆ SVGA_CRTC_EXT_ADDR_BITS1718

#define SVGA_CRTC_EXT_ADDR_BITS1718   ((1 << 2) | (1 << 3))

Definition at line 195 of file svga.h.

◆ SVGA_CRTC_EXT_ADDR_WRAP

#define SVGA_CRTC_EXT_ADDR_WRAP   (1 << 1)

Definition at line 194 of file svga.h.

◆ SVGA_CRTC_EXT_OFFSET_BIT8

#define SVGA_CRTC_EXT_OFFSET_BIT8   (1 << 4)

Definition at line 196 of file svga.h.

◆ SVGA_CRTC_MAX_UNLOCKED_REG

#define SVGA_CRTC_MAX_UNLOCKED_REG   (SVGA_IS_UNLOCKED ? SVGA_CRTC_MAX_REG : VGA_CRTC_MAX_REG)

Definition at line 34 of file svga.h.

◆ SVGA_GC_EXT_MODE_GRAN

#define SVGA_GC_EXT_MODE_GRAN   (1 << 5)

Definition at line 264 of file svga.h.

◆ SVGA_GC_EXT_MODE_WND_B

#define SVGA_GC_EXT_MODE_WND_B   (1 << 0)

Definition at line 263 of file svga.h.

◆ SVGA_GC_MAX_UNLOCKED_REG

#define SVGA_GC_MAX_UNLOCKED_REG   (SVGA_IS_UNLOCKED ? SVGA_GC_MAX_REG : VGA_GC_MAX_REG)

Definition at line 35 of file svga.h.

◆ SVGA_IS_UNLOCKED

Definition at line 30 of file svga.h.

◆ SVGA_SEQ_EXT_CONTROL_MMIO

#define SVGA_SEQ_EXT_CONTROL_MMIO   (1 << 2)

Definition at line 123 of file svga.h.

◆ SVGA_SEQ_EXT_CONTROL_MMIO_HIGH

#define SVGA_SEQ_EXT_CONTROL_MMIO_HIGH   (1 << 6)

Definition at line 124 of file svga.h.

◆ SVGA_SEQ_EXT_MODE_HIGH_RES

#define SVGA_SEQ_EXT_MODE_HIGH_RES   (1 << 0)

Definition at line 120 of file svga.h.

◆ SVGA_SEQ_LOCKED

#define SVGA_SEQ_LOCKED   0x0F

Definition at line 115 of file svga.h.

◆ SVGA_SEQ_MAX_UNLOCKED_REG

#define SVGA_SEQ_MAX_UNLOCKED_REG   (SVGA_IS_UNLOCKED ? SVGA_SEQ_MAX_REG : SVGA_SEQ_EXT_MODE_REG)

Definition at line 33 of file svga.h.

◆ SVGA_SEQ_MCLK_VCLK

#define SVGA_SEQ_MCLK_VCLK   (1 << 6)

Definition at line 127 of file svga.h.

◆ SVGA_SEQ_UNLOCK_MASK

#define SVGA_SEQ_UNLOCK_MASK   0x17

Definition at line 116 of file svga.h.

◆ SVGA_SEQ_UNLOCKED

#define SVGA_SEQ_UNLOCKED   0x12

Definition at line 117 of file svga.h.

◆ VGA_AC_CONTROL_8BIT

#define VGA_AC_CONTROL_8BIT   (1 << 6)

Definition at line 336 of file svga.h.

◆ VGA_AC_CONTROL_ATGE

#define VGA_AC_CONTROL_ATGE   (1 << 0)

Definition at line 331 of file svga.h.

◆ VGA_AC_CONTROL_BLINK

#define VGA_AC_CONTROL_BLINK   (1 << 3)

Definition at line 334 of file svga.h.

◆ VGA_AC_CONTROL_LGE

#define VGA_AC_CONTROL_LGE   (1 << 2)

Definition at line 333 of file svga.h.

◆ VGA_AC_CONTROL_MONO

#define VGA_AC_CONTROL_MONO   (1 << 1)

Definition at line 332 of file svga.h.

◆ VGA_AC_CONTROL_P54S

#define VGA_AC_CONTROL_P54S   (1 << 7)

Definition at line 337 of file svga.h.

◆ VGA_AC_CONTROL_PPM

#define VGA_AC_CONTROL_PPM   (1 << 5)

Definition at line 335 of file svga.h.

◆ VGA_AC_INDEX

#define VGA_AC_INDEX   0x3C0

Definition at line 51 of file svga.h.

◆ VGA_AC_READ

#define VGA_AC_READ   0x3C1

Definition at line 53 of file svga.h.

◆ VGA_AC_WRITE

#define VGA_AC_WRITE   0x3C0

Definition at line 52 of file svga.h.

◆ VGA_BANK_SIZE

#define VGA_BANK_SIZE   0x10000

Definition at line 15 of file svga.h.

◆ VGA_BITMAP_INFO_SIZE

#define VGA_BITMAP_INFO_SIZE   (sizeof(BITMAPINFOHEADER) + 2 * (VGA_PALETTE_SIZE / 3))

Definition at line 18 of file svga.h.

◆ VGA_CLOCK_BASE

#define VGA_CLOCK_BASE   14318181

Definition at line 28 of file svga.h.

◆ VGA_COLOR_TO_DAC

#define VGA_COLOR_TO_DAC (   x)    ((x) >> 2)

Definition at line 22 of file svga.h.

◆ VGA_CRTC_DATA_COLOR

#define VGA_CRTC_DATA_COLOR   0x3D5

Definition at line 66 of file svga.h.

◆ VGA_CRTC_DATA_MONO

#define VGA_CRTC_DATA_MONO   0x3B5

Definition at line 64 of file svga.h.

◆ VGA_CRTC_INDEX_COLOR

#define VGA_CRTC_INDEX_COLOR   0x3D4

Definition at line 65 of file svga.h.

◆ VGA_CRTC_INDEX_MASK

#define VGA_CRTC_INDEX_MASK   0x3F

Definition at line 73 of file svga.h.

◆ VGA_CRTC_INDEX_MONO

#define VGA_CRTC_INDEX_MONO   0x3B4

Definition at line 63 of file svga.h.

◆ VGA_CRTC_MAXSCANLINE_DOUBLE

#define VGA_CRTC_MAXSCANLINE_DOUBLE   (1 << 7)

Definition at line 184 of file svga.h.

◆ VGA_CRTC_MAXSCANLINE_LC9

#define VGA_CRTC_MAXSCANLINE_LC9   (1 << 6)

Definition at line 185 of file svga.h.

◆ VGA_CRTC_MODE_CONTROL_BYTE

#define VGA_CRTC_MODE_CONTROL_BYTE   (1 << 6)

Definition at line 189 of file svga.h.

◆ VGA_CRTC_MODE_CONTROL_SYNC

#define VGA_CRTC_MODE_CONTROL_SYNC   (1 << 7)

Definition at line 190 of file svga.h.

◆ VGA_CRTC_MODE_CONTROL_WRAP

#define VGA_CRTC_MODE_CONTROL_WRAP   (1 << 5)

Definition at line 188 of file svga.h.

◆ VGA_CRTC_OVERFLOW_LC8

#define VGA_CRTC_OVERFLOW_LC8   (1 << 4)

Definition at line 175 of file svga.h.

◆ VGA_CRTC_OVERFLOW_SVB8

#define VGA_CRTC_OVERFLOW_SVB8   (1 << 3)

Definition at line 174 of file svga.h.

◆ VGA_CRTC_OVERFLOW_VDE8

#define VGA_CRTC_OVERFLOW_VDE8   (1 << 1)

Definition at line 172 of file svga.h.

◆ VGA_CRTC_OVERFLOW_VDE9

#define VGA_CRTC_OVERFLOW_VDE9   (1 << 6)

Definition at line 177 of file svga.h.

◆ VGA_CRTC_OVERFLOW_VRS8

#define VGA_CRTC_OVERFLOW_VRS8   (1 << 2)

Definition at line 173 of file svga.h.

◆ VGA_CRTC_OVERFLOW_VRS9

#define VGA_CRTC_OVERFLOW_VRS9   (1 << 7)

Definition at line 178 of file svga.h.

◆ VGA_CRTC_OVERFLOW_VT8

#define VGA_CRTC_OVERFLOW_VT8   (1 << 0)

Definition at line 171 of file svga.h.

◆ VGA_CRTC_OVERFLOW_VT9

#define VGA_CRTC_OVERFLOW_VT9   (1 << 5)

Definition at line 176 of file svga.h.

◆ VGA_CRTC_UNDERLINE_DWORD

#define VGA_CRTC_UNDERLINE_DWORD   (1 << 6)

Definition at line 181 of file svga.h.

◆ VGA_DAC_DATA

#define VGA_DAC_DATA   0x3C9

Definition at line 61 of file svga.h.

◆ VGA_DAC_MASK

#define VGA_DAC_MASK   0x3C6

Definition at line 58 of file svga.h.

◆ VGA_DAC_READ_INDEX

#define VGA_DAC_READ_INDEX   0x3C7

Definition at line 59 of file svga.h.

◆ VGA_DAC_TO_COLOR

#define VGA_DAC_TO_COLOR (   x)    (((x) << 2) | ((x) >> 4))

Definition at line 21 of file svga.h.

◆ VGA_DAC_WRITE_INDEX

#define VGA_DAC_WRITE_INDEX   0x3C8

Definition at line 60 of file svga.h.

◆ VGA_FEATURE_READ

#define VGA_FEATURE_READ   0x3CA

Definition at line 47 of file svga.h.

◆ VGA_FEATURE_WRITE_COLOR

#define VGA_FEATURE_WRITE_COLOR   0x3DA

Definition at line 49 of file svga.h.

◆ VGA_FEATURE_WRITE_MONO

#define VGA_FEATURE_WRITE_MONO   0x3BA

Definition at line 48 of file svga.h.

◆ VGA_FONT_BANK

#define VGA_FONT_BANK   2

Definition at line 24 of file svga.h.

◆ VGA_FONT_CHARACTERS

#define VGA_FONT_CHARACTERS   256

Definition at line 25 of file svga.h.

◆ VGA_FONT_SIZE

Definition at line 27 of file svga.h.

◆ VGA_GC_DATA

#define VGA_GC_DATA   0x3CF

Definition at line 69 of file svga.h.

◆ VGA_GC_INDEX

#define VGA_GC_INDEX   0x3CE

Definition at line 68 of file svga.h.

◆ VGA_GC_INDEX_MASK

#define VGA_GC_INDEX_MASK   0x3F

Definition at line 72 of file svga.h.

◆ VGA_GC_MISC_NOALPHA

#define VGA_GC_MISC_NOALPHA   (1 << 0)

Definition at line 259 of file svga.h.

◆ VGA_GC_MISC_OE

#define VGA_GC_MISC_OE   (1 << 1)

Definition at line 260 of file svga.h.

◆ VGA_GC_MODE_OE

#define VGA_GC_MODE_OE   (1 << 4)

Definition at line 254 of file svga.h.

◆ VGA_GC_MODE_READ

#define VGA_GC_MODE_READ   (1 << 3)

Definition at line 253 of file svga.h.

◆ VGA_GC_MODE_SHIFT256

#define VGA_GC_MODE_SHIFT256   (1 << 6)

Definition at line 256 of file svga.h.

◆ VGA_GC_MODE_SHIFTREG

#define VGA_GC_MODE_SHIFTREG   (1 << 5)

Definition at line 255 of file svga.h.

◆ VGA_INSTAT0_READ

#define VGA_INSTAT0_READ   0x3C2

Definition at line 42 of file svga.h.

◆ VGA_INSTAT1_READ_COLOR

#define VGA_INSTAT1_READ_COLOR   0x3DA

Definition at line 45 of file svga.h.

◆ VGA_INSTAT1_READ_MONO

#define VGA_INSTAT1_READ_MONO   0x3BA

Definition at line 44 of file svga.h.

◆ VGA_INTERLACE_HIGH_BIT

#define VGA_INTERLACE_HIGH_BIT   (1 << 13)

Definition at line 23 of file svga.h.

◆ VGA_MAX_COLORS

#define VGA_MAX_COLORS   256

Definition at line 16 of file svga.h.

◆ VGA_MAX_FONT_HEIGHT

#define VGA_MAX_FONT_HEIGHT   32

Definition at line 26 of file svga.h.

◆ VGA_MINIMUM_HEIGHT

#define VGA_MINIMUM_HEIGHT   300

Definition at line 20 of file svga.h.

◆ VGA_MINIMUM_WIDTH

#define VGA_MINIMUM_WIDTH   400

Definition at line 19 of file svga.h.

◆ VGA_MISC_COLOR

#define VGA_MISC_COLOR   (1 << 0)

Definition at line 82 of file svga.h.

◆ VGA_MISC_HSYNCP

#define VGA_MISC_HSYNCP   (1 << 6)

Definition at line 87 of file svga.h.

◆ VGA_MISC_OE_PAGESEL

#define VGA_MISC_OE_PAGESEL   (1 << 5)

Definition at line 86 of file svga.h.

◆ VGA_MISC_RAM_ENABLED

#define VGA_MISC_RAM_ENABLED   (1 << 1)

Definition at line 83 of file svga.h.

◆ VGA_MISC_READ

#define VGA_MISC_READ   0x3CC

Definition at line 39 of file svga.h.

◆ VGA_MISC_VSYNCP

#define VGA_MISC_VSYNCP   (1 << 7)

Definition at line 88 of file svga.h.

◆ VGA_MISC_WRITE

#define VGA_MISC_WRITE   0x3C2

Definition at line 40 of file svga.h.

◆ VGA_NUM_BANKS

#define VGA_NUM_BANKS   4

Definition at line 14 of file svga.h.

◆ VGA_PALETTE_SIZE

#define VGA_PALETTE_SIZE   (VGA_MAX_COLORS * 3)

Definition at line 17 of file svga.h.

◆ VGA_SEQ_CLOCK_98DM

#define VGA_SEQ_CLOCK_98DM   (1 << 0)

Definition at line 104 of file svga.h.

◆ VGA_SEQ_CLOCK_DCR

#define VGA_SEQ_CLOCK_DCR   (1 << 3)

Definition at line 106 of file svga.h.

◆ VGA_SEQ_CLOCK_S4

#define VGA_SEQ_CLOCK_S4   (1 << 4)

Definition at line 107 of file svga.h.

◆ VGA_SEQ_CLOCK_SD

#define VGA_SEQ_CLOCK_SD   (1 << 5)

Definition at line 108 of file svga.h.

◆ VGA_SEQ_CLOCK_SLR

#define VGA_SEQ_CLOCK_SLR   (1 << 2)

Definition at line 105 of file svga.h.

◆ VGA_SEQ_DATA

#define VGA_SEQ_DATA   0x3C5

Definition at line 56 of file svga.h.

◆ VGA_SEQ_INDEX

#define VGA_SEQ_INDEX   0x3C4

Definition at line 55 of file svga.h.

◆ VGA_SEQ_INDEX_MASK

#define VGA_SEQ_INDEX_MASK   0x1F

Definition at line 71 of file svga.h.

◆ VGA_SEQ_MEM_C4

#define VGA_SEQ_MEM_C4   (1 << 3)

Definition at line 113 of file svga.h.

◆ VGA_SEQ_MEM_EXT

#define VGA_SEQ_MEM_EXT   (1 << 1)

Definition at line 111 of file svga.h.

◆ VGA_SEQ_MEM_OE_DIS

#define VGA_SEQ_MEM_OE_DIS   (1 << 2)

Definition at line 112 of file svga.h.

◆ VGA_SEQ_RESET_AR

#define VGA_SEQ_RESET_AR   (1 << 0)

Definition at line 100 of file svga.h.

◆ VGA_SEQ_RESET_SR

#define VGA_SEQ_RESET_SR   (1 << 1)

Definition at line 101 of file svga.h.

◆ VGA_STAT_DD

#define VGA_STAT_DD   (1 << 0)

Definition at line 91 of file svga.h.

◆ VGA_STAT_VRETRACE

#define VGA_STAT_VRETRACE   (1 << 3)

Definition at line 92 of file svga.h.

Typedef Documentation

◆ CHAR_CELL

◆ PCHAR_CELL

◆ PSVGA_REGISTERS

◆ PVGA_REGISTERS

◆ SVGA_REGISTERS

◆ VGA_REGISTERS

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
VGA_SEQ_RESET_REG 
VGA_SEQ_CLOCK_REG 
VGA_SEQ_MASK_REG 
VGA_SEQ_CHAR_REG 
VGA_SEQ_MEM_REG 
VGA_SEQ_MAX_REG 
SVGA_SEQ_UNLOCK_REG 
SVGA_SEQ_EXT_MODE_REG 
SVGA_SEQ_EEPROM_REG 
SVGA_SEQ_SCRATCH_0_REG 
SVGA_SEQ_SCRATCH_1_REG 
SVGA_SEQ_VCLK0_NUMERATOR_REG 
SVGA_SEQ_VCLK1_NUMERATOR_REG 
SVGA_SEQ_VCLK2_NUMERATOR_REG 
SVGA_SEQ_VCLK3_NUMERATOR_REG 
SVGA_SEQ_DRAM_REG 
SVGA_SEQ_CURSOR_X_REG 
SVGA_SEQ_CURSOR_Y_REG 
SVGA_SEQ_CURSOR_ATTR_REG 
SVGA_SEQ_CURSOR_PATTERN_REG 
SVGA_SEQ_SCRATCH_2_REG 
SVGA_SEQ_SCRATCH_3_REG 
SVGA_SEQ_PERFORMANCE_REG 
SVGA_SEQ_EXT_CONTROL_REG 
SVGA_SEQ_SIG_GEN_CONTROL_REG 
SVGA_SEQ_SIG_GEN_RESULT_LOW_REG 
SVGA_SEQ_SIG_GEN_RESULT_HIGH_REG 
SVGA_SEQ_VCLK0_DENOMINATOR_REG 
SVGA_SEQ_VCLK1_DENOMINATOR_REG 
SVGA_SEQ_VCLK2_DENOMINATOR_REG 
SVGA_SEQ_VCLK3_DENOMINATOR_REG 
SVGA_SEQ_MCLK_REG 
SVGA_SEQ_MAX_REG 

Definition at line 129 of file svga.h.

130{
164};
@ SVGA_SEQ_CURSOR_Y_REG
Definition: svga.h:148
@ SVGA_SEQ_MAX_REG
Definition: svga.h:163
@ SVGA_SEQ_VCLK1_DENOMINATOR_REG
Definition: svga.h:159
@ SVGA_SEQ_VCLK0_DENOMINATOR_REG
Definition: svga.h:158
@ SVGA_SEQ_VCLK2_NUMERATOR_REG
Definition: svga.h:144
@ SVGA_SEQ_SIG_GEN_RESULT_LOW_REG
Definition: svga.h:156
@ SVGA_SEQ_EXT_MODE_REG
Definition: svga.h:138
@ VGA_SEQ_MAX_REG
Definition: svga.h:136
@ SVGA_SEQ_SCRATCH_0_REG
Definition: svga.h:140
@ SVGA_SEQ_VCLK3_NUMERATOR_REG
Definition: svga.h:145
@ SVGA_SEQ_SCRATCH_2_REG
Definition: svga.h:151
@ SVGA_SEQ_VCLK3_DENOMINATOR_REG
Definition: svga.h:161
@ SVGA_SEQ_MCLK_REG
Definition: svga.h:162
@ VGA_SEQ_CLOCK_REG
Definition: svga.h:132
@ SVGA_SEQ_SCRATCH_3_REG
Definition: svga.h:152
@ SVGA_SEQ_EXT_CONTROL_REG
Definition: svga.h:154
@ SVGA_SEQ_CURSOR_X_REG
Definition: svga.h:147
@ SVGA_SEQ_EEPROM_REG
Definition: svga.h:139
@ VGA_SEQ_RESET_REG
Definition: svga.h:131
@ VGA_SEQ_MEM_REG
Definition: svga.h:135
@ SVGA_SEQ_SIG_GEN_RESULT_HIGH_REG
Definition: svga.h:157
@ SVGA_SEQ_CURSOR_ATTR_REG
Definition: svga.h:149
@ SVGA_SEQ_VCLK2_DENOMINATOR_REG
Definition: svga.h:160
@ VGA_SEQ_MASK_REG
Definition: svga.h:133
@ SVGA_SEQ_PERFORMANCE_REG
Definition: svga.h:153
@ SVGA_SEQ_VCLK0_NUMERATOR_REG
Definition: svga.h:142
@ SVGA_SEQ_VCLK1_NUMERATOR_REG
Definition: svga.h:143
@ SVGA_SEQ_SIG_GEN_CONTROL_REG
Definition: svga.h:155
@ SVGA_SEQ_CURSOR_PATTERN_REG
Definition: svga.h:150
@ SVGA_SEQ_DRAM_REG
Definition: svga.h:146
@ VGA_SEQ_CHAR_REG
Definition: svga.h:134
@ SVGA_SEQ_SCRATCH_1_REG
Definition: svga.h:141
@ SVGA_SEQ_UNLOCK_REG
Definition: svga.h:137

◆ anonymous enum

anonymous enum
Enumerator
VGA_CRTC_HORZ_TOTAL_REG 
VGA_CRTC_END_HORZ_DISP_REG 
VGA_CRTC_START_HORZ_BLANKING_REG 
VGA_CRTC_END_HORZ_BLANKING_REG 
VGA_CRTC_START_HORZ_RETRACE_REG 
VGA_CRTC_END_HORZ_RETRACE_REG 
VGA_CRTC_VERT_TOTAL_REG 
VGA_CRTC_OVERFLOW_REG 
VGA_CRTC_PRESET_ROW_SCAN_REG 
VGA_CRTC_MAX_SCAN_LINE_REG 
VGA_CRTC_CURSOR_START_REG 
VGA_CRTC_CURSOR_END_REG 
VGA_CRTC_START_ADDR_HIGH_REG 
VGA_CRTC_START_ADDR_LOW_REG 
VGA_CRTC_CURSOR_LOC_HIGH_REG 
VGA_CRTC_CURSOR_LOC_LOW_REG 
VGA_CRTC_START_VERT_RETRACE_REG 
VGA_CRTC_END_VERT_RETRACE_REG 
VGA_CRTC_VERT_DISP_END_REG 
VGA_CRTC_OFFSET_REG 
VGA_CRTC_UNDERLINE_REG 
VGA_CRTC_START_VERT_BLANKING_REG 
VGA_CRTC_END_VERT_BLANKING_REG 
VGA_CRTC_MODE_CONTROL_REG 
VGA_CRTC_LINE_COMPARE_REG 
VGA_CRTC_MAX_REG 
SVGA_CRTC_INTERLACE_END_REG 
SVGA_CRTC_MISC_CONTROL_REG 
SVGA_CRTC_EXT_DISPLAY_REG 
SVGA_CRTC_SYNC_ADJUST_REG 
SVGA_CRTC_OVERLAY_REG 
SVGA_CRTC_UNUSED0_REG 
SVGA_CRTC_UNUSED1_REG 
SVGA_CRTC_UNUSED2_REG 
SVGA_CRTC_UNUSED3_REG 
SVGA_CRTC_UNUSED4_REG 
SVGA_CRTC_UNUSED5_REG 
SVGA_CRTC_UNUSED6_REG 
SVGA_CRTC_PART_STATUS_REG 
SVGA_CRTC_UNUSED7_REG 
SVGA_CRTC_ID_REG 
SVGA_CRTC_MAX_REG 

Definition at line 201 of file svga.h.

202{
245};
@ VGA_CRTC_VERT_TOTAL_REG
Definition: svga.h:209
@ VGA_CRTC_START_ADDR_LOW_REG
Definition: svga.h:216
@ VGA_CRTC_MAX_SCAN_LINE_REG
Definition: svga.h:212
@ VGA_CRTC_START_HORZ_BLANKING_REG
Definition: svga.h:205
@ VGA_CRTC_PRESET_ROW_SCAN_REG
Definition: svga.h:211
@ VGA_CRTC_END_VERT_RETRACE_REG
Definition: svga.h:220
@ SVGA_CRTC_OVERLAY_REG
Definition: svga.h:233
@ VGA_CRTC_LINE_COMPARE_REG
Definition: svga.h:227
@ VGA_CRTC_START_VERT_RETRACE_REG
Definition: svga.h:219
@ VGA_CRTC_END_HORZ_RETRACE_REG
Definition: svga.h:208
@ VGA_CRTC_CURSOR_START_REG
Definition: svga.h:213
@ SVGA_CRTC_MISC_CONTROL_REG
Definition: svga.h:230
@ SVGA_CRTC_INTERLACE_END_REG
Definition: svga.h:229
@ SVGA_CRTC_ID_REG
Definition: svga.h:243
@ SVGA_CRTC_UNUSED7_REG
Definition: svga.h:242
@ SVGA_CRTC_SYNC_ADJUST_REG
Definition: svga.h:232
@ SVGA_CRTC_MAX_REG
Definition: svga.h:244
@ VGA_CRTC_START_HORZ_RETRACE_REG
Definition: svga.h:207
@ SVGA_CRTC_UNUSED2_REG
Definition: svga.h:236
@ SVGA_CRTC_UNUSED5_REG
Definition: svga.h:239
@ VGA_CRTC_OFFSET_REG
Definition: svga.h:222
@ SVGA_CRTC_UNUSED1_REG
Definition: svga.h:235
@ VGA_CRTC_MAX_REG
Definition: svga.h:228
@ SVGA_CRTC_UNUSED0_REG
Definition: svga.h:234
@ SVGA_CRTC_PART_STATUS_REG
Definition: svga.h:241
@ VGA_CRTC_START_ADDR_HIGH_REG
Definition: svga.h:215
@ VGA_CRTC_VERT_DISP_END_REG
Definition: svga.h:221
@ VGA_CRTC_END_HORZ_BLANKING_REG
Definition: svga.h:206
@ SVGA_CRTC_UNUSED3_REG
Definition: svga.h:237
@ VGA_CRTC_START_VERT_BLANKING_REG
Definition: svga.h:224
@ VGA_CRTC_CURSOR_LOC_HIGH_REG
Definition: svga.h:217
@ VGA_CRTC_OVERFLOW_REG
Definition: svga.h:210
@ VGA_CRTC_CURSOR_LOC_LOW_REG
Definition: svga.h:218
@ VGA_CRTC_UNDERLINE_REG
Definition: svga.h:223
@ VGA_CRTC_HORZ_TOTAL_REG
Definition: svga.h:203
@ VGA_CRTC_END_VERT_BLANKING_REG
Definition: svga.h:225
@ VGA_CRTC_END_HORZ_DISP_REG
Definition: svga.h:204
@ VGA_CRTC_CURSOR_END_REG
Definition: svga.h:214
@ SVGA_CRTC_EXT_DISPLAY_REG
Definition: svga.h:231
@ SVGA_CRTC_UNUSED6_REG
Definition: svga.h:240
@ VGA_CRTC_MODE_CONTROL_REG
Definition: svga.h:226
@ SVGA_CRTC_UNUSED4_REG
Definition: svga.h:238

◆ anonymous enum

anonymous enum
Enumerator
VGA_GC_RESET_REG 
VGA_GC_ENABLE_RESET_REG 
VGA_GC_COLOR_COMPARE_REG 
VGA_GC_ROTATE_REG 
VGA_GC_READ_MAP_SEL_REG 
VGA_GC_MODE_REG 
VGA_GC_MISC_REG 
VGA_GC_COLOR_IGNORE_REG 
VGA_GC_BITMASK_REG 
VGA_GC_MAX_REG 
SVGA_GC_OFFSET_0_REG 
SVGA_GC_OFFSET_1_REG 
SVGA_GC_EXT_MODE_REG 
SVGA_GC_COLOR_COMPARE_REG 
SVGA_GC_BITMASK_REG 
SVGA_GC_POWER_MANAGEMENT_REG 
SVGA_GC_UNUSED0_REG 
SVGA_GC_BACKGROUND_1_REG 
SVGA_GC_FOREGROUND_1_REG 
SVGA_GC_BACKGROUND_2_REG 
SVGA_GC_FOREGROUND_2_REG 
SVGA_GC_BACKGROUND_3_REG 
SVGA_GC_FOREGROUND_3_REG 
SVGA_GC_UNUSED1_REG 
SVGA_GC_UNUSED2_REG 
SVGA_GC_UNUSED3_REG 
SVGA_GC_UNUSED4_REG 
SVGA_GC_UNUSED5_REG 
SVGA_GC_UNUSED6_REG 
SVGA_GC_UNUSED7_REG 
SVGA_GC_UNUSED8_REG 
SVGA_GC_UNUSED9_REG 
SVGA_GC_UNUSED10_REG 
SVGA_GC_BLT_WIDTH_LOW_REG 
SVGA_GC_BLT_WIDTH_HIGH_REG 
SVGA_GC_BLT_HEIGHT_LOW_REG 
SVGA_GC_BLT_HEIGHT_HIGH_REG 
SVGA_GC_BLT_DEST_PITCH_LOW_REG 
SVGA_GC_BLT_DEST_PITCH_HIGH_REG 
SVGA_GC_BLT_SRC_PITCH_LOW_REG 
SVGA_GC_BLT_SRC_PITCH_HIGH_REG 
SVGA_GC_BLT_DEST_START_0_REG 
SVGA_GC_BLT_DEST_START_1_REG 
SVGA_GC_BLT_DEST_START_2_REG 
SVGA_GC_UNUSED11_REG 
SVGA_GC_BLT_SRC_START_0_REG 
SVGA_GC_BLT_SRC_START_1_REG 
SVGA_GC_BLT_SRC_START_2_REG 
SVGA_GC_BLT_DEST_MASK_REG 
SVGA_GC_BLT_MODE_REG 
SVGA_GC_BLT_STATUS_REG 
SVGA_GC_BLT_ROP_REG 
SVGA_GC_BLT_EXT_MODE_REG 
SVGA_GC_MAX_REG 

Definition at line 266 of file svga.h.

267{
322};
@ SVGA_GC_BLT_MODE_REG
Definition: svga.h:317
@ SVGA_GC_BLT_DEST_START_0_REG
Definition: svga.h:309
@ SVGA_GC_MAX_REG
Definition: svga.h:321
@ SVGA_GC_UNUSED11_REG
Definition: svga.h:312
@ SVGA_GC_BLT_WIDTH_HIGH_REG
Definition: svga.h:302
@ SVGA_GC_UNUSED9_REG
Definition: svga.h:299
@ SVGA_GC_UNUSED4_REG
Definition: svga.h:294
@ VGA_GC_ENABLE_RESET_REG
Definition: svga.h:269
@ SVGA_GC_COLOR_COMPARE_REG
Definition: svga.h:281
@ SVGA_GC_BACKGROUND_2_REG
Definition: svga.h:287
@ SVGA_GC_BLT_HEIGHT_LOW_REG
Definition: svga.h:303
@ SVGA_GC_BLT_ROP_REG
Definition: svga.h:319
@ SVGA_GC_UNUSED3_REG
Definition: svga.h:293
@ SVGA_GC_BACKGROUND_1_REG
Definition: svga.h:285
@ SVGA_GC_UNUSED7_REG
Definition: svga.h:297
@ SVGA_GC_BLT_DEST_MASK_REG
Definition: svga.h:316
@ SVGA_GC_UNUSED1_REG
Definition: svga.h:291
@ SVGA_GC_BLT_SRC_PITCH_HIGH_REG
Definition: svga.h:308
@ SVGA_GC_UNUSED0_REG
Definition: svga.h:284
@ SVGA_GC_EXT_MODE_REG
Definition: svga.h:280
@ SVGA_GC_BLT_WIDTH_LOW_REG
Definition: svga.h:301
@ SVGA_GC_BLT_SRC_PITCH_LOW_REG
Definition: svga.h:307
@ VGA_GC_READ_MAP_SEL_REG
Definition: svga.h:272
@ SVGA_GC_BLT_DEST_PITCH_LOW_REG
Definition: svga.h:305
@ SVGA_GC_BLT_HEIGHT_HIGH_REG
Definition: svga.h:304
@ SVGA_GC_BITMASK_REG
Definition: svga.h:282
@ SVGA_GC_BLT_DEST_START_1_REG
Definition: svga.h:310
@ SVGA_GC_OFFSET_0_REG
Definition: svga.h:278
@ SVGA_GC_OFFSET_1_REG
Definition: svga.h:279
@ SVGA_GC_POWER_MANAGEMENT_REG
Definition: svga.h:283
@ VGA_GC_MAX_REG
Definition: svga.h:277
@ SVGA_GC_BLT_DEST_START_2_REG
Definition: svga.h:311
@ SVGA_GC_UNUSED2_REG
Definition: svga.h:292
@ SVGA_GC_BLT_DEST_PITCH_HIGH_REG
Definition: svga.h:306
@ SVGA_GC_BLT_EXT_MODE_REG
Definition: svga.h:320
@ SVGA_GC_UNUSED6_REG
Definition: svga.h:296
@ VGA_GC_MISC_REG
Definition: svga.h:274
@ SVGA_GC_BLT_SRC_START_2_REG
Definition: svga.h:315
@ SVGA_GC_FOREGROUND_1_REG
Definition: svga.h:286
@ SVGA_GC_BACKGROUND_3_REG
Definition: svga.h:289
@ VGA_GC_COLOR_IGNORE_REG
Definition: svga.h:275
@ VGA_GC_ROTATE_REG
Definition: svga.h:271
@ SVGA_GC_BLT_SRC_START_1_REG
Definition: svga.h:314
@ SVGA_GC_UNUSED10_REG
Definition: svga.h:300
@ VGA_GC_BITMASK_REG
Definition: svga.h:276
@ VGA_GC_RESET_REG
Definition: svga.h:268
@ SVGA_GC_UNUSED8_REG
Definition: svga.h:298
@ SVGA_GC_BLT_SRC_START_0_REG
Definition: svga.h:313
@ SVGA_GC_UNUSED5_REG
Definition: svga.h:295
@ SVGA_GC_BLT_STATUS_REG
Definition: svga.h:318
@ VGA_GC_COLOR_COMPARE_REG
Definition: svga.h:270
@ SVGA_GC_FOREGROUND_3_REG
Definition: svga.h:290
@ SVGA_GC_FOREGROUND_2_REG
Definition: svga.h:288
@ VGA_GC_MODE_REG
Definition: svga.h:273

◆ anonymous enum

anonymous enum
Enumerator
VGA_AC_PAL_0_REG 
VGA_AC_PAL_1_REG 
VGA_AC_PAL_2_REG 
VGA_AC_PAL_3_REG 
VGA_AC_PAL_4_REG 
VGA_AC_PAL_5_REG 
VGA_AC_PAL_6_REG 
VGA_AC_PAL_7_REG 
VGA_AC_PAL_8_REG 
VGA_AC_PAL_9_REG 
VGA_AC_PAL_A_REG 
VGA_AC_PAL_B_REG 
VGA_AC_PAL_C_REG 
VGA_AC_PAL_D_REG 
VGA_AC_PAL_E_REG 
VGA_AC_PAL_F_REG 
VGA_AC_CONTROL_REG 
VGA_AC_OVERSCAN_REG 
VGA_AC_COLOR_PLANE_REG 
VGA_AC_HORZ_PANNING_REG 
VGA_AC_COLOR_SEL_REG 
VGA_AC_MAX_REG 

Definition at line 339 of file svga.h.

340{
363};
@ VGA_AC_PAL_5_REG
Definition: svga.h:346
@ VGA_AC_PAL_7_REG
Definition: svga.h:348
@ VGA_AC_PAL_E_REG
Definition: svga.h:355
@ VGA_AC_MAX_REG
Definition: svga.h:362
@ VGA_AC_PAL_3_REG
Definition: svga.h:344
@ VGA_AC_PAL_B_REG
Definition: svga.h:352
@ VGA_AC_COLOR_PLANE_REG
Definition: svga.h:359
@ VGA_AC_PAL_2_REG
Definition: svga.h:343
@ VGA_AC_HORZ_PANNING_REG
Definition: svga.h:360
@ VGA_AC_PAL_D_REG
Definition: svga.h:354
@ VGA_AC_PAL_1_REG
Definition: svga.h:342
@ VGA_AC_PAL_8_REG
Definition: svga.h:349
@ VGA_AC_PAL_F_REG
Definition: svga.h:356
@ VGA_AC_OVERSCAN_REG
Definition: svga.h:358
@ VGA_AC_CONTROL_REG
Definition: svga.h:357
@ VGA_AC_COLOR_SEL_REG
Definition: svga.h:361
@ VGA_AC_PAL_9_REG
Definition: svga.h:350
@ VGA_AC_PAL_C_REG
Definition: svga.h:353
@ VGA_AC_PAL_6_REG
Definition: svga.h:347
@ VGA_AC_PAL_0_REG
Definition: svga.h:341
@ VGA_AC_PAL_4_REG
Definition: svga.h:345
@ VGA_AC_PAL_A_REG
Definition: svga.h:351

Function Documentation

◆ C_ASSERT()

C_ASSERT ( sizeof(CHAR_CELL = =2)

◆ VgaCleanup()

VOID VgaCleanup ( VOID  )

Definition at line 2145 of file svga.c.

2146{
2147 /* Do a final display refresh */
2149
2151
2152 /* Leave the current video mode */
2153 VgaLeaveCurrentMode(); // ScreenMode
2154
2155 MemRemoveFastMemoryHook((PVOID)0xA0000, 0x20000);
2156
2158}
VOID DestroyHardwareTimer(PHARDWARE_TIMER Timer)
Definition: clock.c:210
VOID VgaConsoleCleanup(VOID)
Definition: video.c:807
BOOL MemRemoveFastMemoryHook(PVOID Address, ULONG Size)
Definition: memory.c:353
static PHARDWARE_TIMER HSyncTimer
Definition: svga.c:276
static VOID VgaLeaveCurrentMode(VOID)
Definition: svga.c:651
VOID VgaRefreshDisplay(VOID)
Definition: svga.c:1783

Referenced by EmulatorCleanup().

◆ VgaClearMemory()

VOID VgaClearMemory ( VOID  )

Definition at line 2074 of file svga.c.

2075{
2077}
static BYTE VgaMemory[VGA_NUM_BANKS *SVGA_BANK_SIZE]
Definition: svga.c:244
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262

Referenced by VbeSetExtendedVideoMode(), VgaInitialize(), and VidBiosSetVideoMode().

◆ VgaGetDisplayResolution()

COORD VgaGetDisplayResolution ( VOID  )

Definition at line 1727 of file svga.c.

1728{
1730 BYTE MaximumScanLine = 1 + (VgaCrtcRegisters[VGA_CRTC_MAX_SCAN_LINE_REG] & 0x1F);
1731
1732 /* The low 8 bits are in the display registers */
1735
1736 /* Set the top bits from the overflow register */
1738 {
1739 Resolution.Y |= 1 << 8;
1740 }
1742 {
1743 Resolution.Y |= 1 << 9;
1744 }
1745
1746 /* Increase the values by 1 */
1747 Resolution.X++;
1748 Resolution.Y++;
1749
1751 {
1752 /* In "High Resolution" mode, the width of a character is always 8 pixels */
1754 {
1755 Resolution.X *= 8;
1756 }
1757 else
1758 {
1759 /* Multiply the horizontal resolution by the 9/8 dot mode */
1761 ? 8 : 9;
1762
1763 /* The horizontal resolution is halved in 8-bit mode */
1765 }
1766 }
1767
1769 {
1770 /* Halve the vertical resolution */
1771 Resolution.Y >>= 1;
1772 }
1773 else
1774 {
1775 /* Divide the vertical resolution by the maximum scan line (== font size in text mode) */
1776 Resolution.Y /= MaximumScanLine;
1777 }
1778
1779 /* Return the resolution */
1780 return Resolution;
1781}
Definition: bl.h:1338
static BYTE Resolution
Definition: mouse.c:35
static BYTE VgaAcRegisters[VGA_AC_MAX_REG]
Definition: svga.c:263
static BYTE VgaCrtcRegisters[SVGA_CRTC_MAX_REG]
Definition: svga.c:255
static BYTE VgaGcRegisters[SVGA_GC_MAX_REG]
Definition: svga.c:258
static BYTE VgaSeqRegisters[SVGA_SEQ_MAX_REG]
Definition: svga.c:252
#define VGA_CRTC_OVERFLOW_VDE8
Definition: svga.h:172
#define VGA_CRTC_MAXSCANLINE_DOUBLE
Definition: svga.h:184
#define VGA_SEQ_CLOCK_98DM
Definition: svga.h:104
#define VGA_CRTC_OVERFLOW_VDE9
Definition: svga.h:177
#define VGA_AC_CONTROL_8BIT
Definition: svga.h:336
#define VGA_GC_MISC_NOALPHA
Definition: svga.h:259
#define SVGA_SEQ_EXT_MODE_HIGH_RES
Definition: svga.h:120
unsigned char BYTE
Definition: xxhash.c:193

Referenced by DosUpdatePosition(), FromMouseCoordinates(), ToMouseCoordinates(), VgaChangeMode(), and VidBiosSetVideoMode().

◆ VgaInitialize()

BOOLEAN VgaInitialize ( HANDLE  TextHandle)

Definition at line 2100 of file svga.c.

2101{
2102 if (!VgaConsoleInitialize(TextHandle)) return FALSE;
2103
2104 /* Clear the SEQ, GC, CRTC and AC registers */
2109
2110 /* Initialize the VGA palette and fail if it isn't successfully created */
2111 if (!VgaInitializePalette()) return FALSE;
2112 /***/ VgaResetPalette(); /***/
2113
2114 /* Reset the sequencer */
2116
2117 /* Clear the VGA memory */
2119
2120 /* Register the I/O Ports */
2121 RegisterIoPort(0x3CC, VgaReadPort, NULL); // VGA_MISC_READ
2122 RegisterIoPort(0x3C2, VgaReadPort, VgaWritePort); // VGA_MISC_WRITE, VGA_INSTAT0_READ
2123 RegisterIoPort(0x3CA, VgaReadPort, NULL); // VGA_FEATURE_READ
2124 RegisterIoPort(0x3C0, VgaReadPort, VgaWritePort); // VGA_AC_INDEX, VGA_AC_WRITE
2125 RegisterIoPort(0x3C1, VgaReadPort, NULL); // VGA_AC_READ
2126 RegisterIoPort(0x3C4, VgaReadPort, VgaWritePort); // VGA_SEQ_INDEX
2127 RegisterIoPort(0x3C5, VgaReadPort, VgaWritePort); // VGA_SEQ_DATA
2128 RegisterIoPort(0x3C6, VgaReadPort, VgaWritePort); // VGA_DAC_MASK
2129 RegisterIoPort(0x3C7, VgaReadPort, VgaWritePort); // VGA_DAC_READ_INDEX
2130 RegisterIoPort(0x3C8, VgaReadPort, VgaWritePort); // VGA_DAC_WRITE_INDEX
2131 RegisterIoPort(0x3C9, VgaReadPort, VgaWritePort); // VGA_DAC_DATA
2132 RegisterIoPort(0x3CE, VgaReadPort, VgaWritePort); // VGA_GC_INDEX
2133 RegisterIoPort(0x3CF, VgaReadPort, VgaWritePort); // VGA_GC_DATA
2134
2135 /* CGA ports for compatibility, unimplemented */
2136 RegisterIoPort(0x3D8, VgaReadPort, VgaWritePort); // CGA_MODE_CTRL_REG
2137 RegisterIoPort(0x3D9, VgaReadPort, VgaWritePort); // CGA_PAL_CTRL_REG
2138
2140
2141 /* Return success */
2142 return TRUE;
2143}
#define HARDWARE_TIMER_ENABLED
Definition: clock.h:15
#define HZ_TO_NS(Freq)
Definition: clock.h:20
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
PHARDWARE_TIMER CreateHardwareTimer(ULONG Flags, ULONGLONG Delay, PHARDWARE_TIMER_PROC Callback)
Definition: clock.c:144
BOOLEAN VgaConsoleInitialize(HANDLE TextHandle)
Definition: video.c:783
VOID RegisterIoPort(USHORT Port, EMULATOR_INB_PROC InHandler, EMULATOR_OUTB_PROC OutHandler)
Definition: io.c:320
static VOID VgaResetPalette(VOID)
Definition: svga.c:594
static BYTE WINAPI VgaReadPort(USHORT Port)
Definition: svga.c:1104
static BOOLEAN VgaInitializePalette(VOID)
Definition: svga.c:534
static VOID FASTCALL VgaHorizontalRetrace(ULONGLONG ElapsedTime)
Definition: svga.c:1655
static VOID VgaResetSequencer(VOID)
Definition: svga.c:495
static VOID WINAPI VgaWritePort(USHORT Port, BYTE Data)
Definition: svga.c:1420
VOID VgaClearMemory(VOID)
Definition: svga.c:2074

Referenced by DriverEntry(), and EmulatorInitialize().

◆ VgaReadMemory()

VOID FASTCALL VgaReadMemory ( ULONG  Address,
PVOID  Buffer,
ULONG  Size 
)

Definition at line 1802 of file svga.c.

1803{
1804 DWORD i;
1805 DWORD VideoAddress;
1806 PUCHAR BufPtr = (PUCHAR)Buffer;
1807
1808 DPRINT("VgaReadMemory: Address 0x%08X, Size %lu\n", Address, Size);
1809
1810 /* Ignore if video RAM access is disabled */
1811 if (!Size) return;
1812 if ((VgaMiscRegister & VGA_MISC_RAM_ENABLED) == 0) return;
1813
1815 {
1816 VideoAddress = VgaTranslateAddress(Address);
1817
1818 /* Check for packed pixel, chain-4, and odd-even mode */
1820 {
1821 /* Just copy from the video memory */
1822 PVOID VideoMemory = &VgaMemory[VideoAddress + (Address & 3)];
1823
1824 switch (Size)
1825 {
1826 case sizeof(UCHAR):
1827 *(PUCHAR)Buffer = *(PUCHAR)VideoMemory;
1828 return;
1829
1830 case sizeof(USHORT):
1831 *(PUSHORT)Buffer = *(PUSHORT)VideoMemory;
1832 return;
1833
1834 case sizeof(ULONG):
1835 *(PULONG)Buffer = *(PULONG)VideoMemory;
1836 return;
1837
1838 case sizeof(ULONGLONG):
1839 *(PULONGLONG)Buffer = *(PULONGLONG)VideoMemory;
1840 return;
1841
1842 default:
1843#if defined(__GNUC__)
1844 __builtin_memcpy(Buffer, VideoMemory, Size);
1845#else
1846 RtlCopyMemory(Buffer, VideoMemory, Size);
1847#endif
1848 }
1849 }
1851 {
1852 i = 0;
1853
1854 /* Write the unaligned part first */
1855 if (Address & 3)
1856 {
1857 switch (Address & 3)
1858 {
1859 case 1:
1860 BufPtr[i++] = VgaMemory[VideoAddress * VGA_NUM_BANKS + 1];
1861 case 2:
1862 BufPtr[i++] = VgaMemory[VideoAddress * VGA_NUM_BANKS + 2];
1863 case 3:
1864 BufPtr[i++] = VgaMemory[VideoAddress * VGA_NUM_BANKS + 3];
1865 }
1866
1867 VideoAddress += 4;
1868 }
1869
1870 /* Copy the aligned dwords */
1871 while ((i + 3) < Size)
1872 {
1873 *(PULONG)&BufPtr[i] = *(PULONG)&VgaMemory[VideoAddress * VGA_NUM_BANKS];
1874
1875 i += 4;
1876 VideoAddress += 4;
1877 }
1878
1879 /* Write the remaining part */
1880 if (i < Size)
1881 {
1882 switch (Size - i - 3)
1883 {
1884 case 3:
1885 BufPtr[i] = VgaMemory[VideoAddress * VGA_NUM_BANKS + ((Address + i) & 3)];
1886 i++;
1887 case 2:
1888 BufPtr[i] = VgaMemory[VideoAddress * VGA_NUM_BANKS + ((Address + i) & 3)];
1889 i++;
1890 case 1:
1891 BufPtr[i] = VgaMemory[VideoAddress * VGA_NUM_BANKS + ((Address + i) & 3)];
1892 i++;
1893 }
1894 }
1895 }
1897 {
1898 i = 0;
1899
1900 /* Check if the starting address is odd */
1901 if (Address & 1)
1902 {
1903 BufPtr[i++] = VgaMemory[VideoAddress * VGA_NUM_BANKS + 1];
1904 VideoAddress += 2;
1905 }
1906
1907 while (i < (Size - 1))
1908 {
1909 *(PUSHORT)&BufPtr[i] = *(PUSHORT)&VgaMemory[VideoAddress * VGA_NUM_BANKS];
1910
1911 i += 2;
1912 VideoAddress += 2;
1913 }
1914
1915 /* Check if there is one more byte to read */
1916 if (i == Size - 1) BufPtr[i] = VgaMemory[VideoAddress * VGA_NUM_BANKS + ((Address + i) & 1)];
1917 }
1918 else
1919 {
1920 /* Use the selected map */
1922
1923 for (i = 0; i < Size; i++)
1924 {
1925 /* Copy the value to the buffer */
1926 BufPtr[i] = VgaMemory[(VideoAddress++) * VGA_NUM_BANKS + Plane];
1927 }
1928 }
1929 }
1930 else
1931 {
1932 const ULONG BitExpandInvertTable[] =
1933 {
1934 0xFFFFFFFF, 0xFFFFFF00, 0xFFFF00FF, 0xFFFF0000,
1935 0xFF00FFFF, 0xFF00FF00, 0xFF0000FF, 0xFF000000,
1936 0x00FFFFFF, 0x00FFFF00, 0x00FF00FF, 0x00FF0000,
1937 0x0000FFFF, 0x0000FF00, 0x000000FF, 0x00000000
1938 };
1939
1940 ULONG ColorCompareBytes = BitExpandInvertTable[VgaGcRegisters[VGA_GC_COLOR_COMPARE_REG] & 0x0F];
1941 ULONG ColorIgnoreBytes = BitExpandInvertTable[VgaGcRegisters[VGA_GC_COLOR_IGNORE_REG] & 0x0F];
1942
1943 /*
1944 * These values can also be computed in the following way, but using the table seems to be faster:
1945 *
1946 * ColorCompareBytes = VgaGcRegisters[VGA_GC_COLOR_COMPARE_REG] * 0x000204081;
1947 * ColorCompareBytes &= 0x01010101;
1948 * ColorCompareBytes = ~((ColorCompareBytes << 8) - ColorCompareBytes);
1949 *
1950 * ColorIgnoreBytes = VgaGcRegisters[VGA_GC_COLOR_IGNORE_REG] * 0x000204081;
1951 * ColorIgnoreBytes &= 0x01010101;
1952 * ColorIgnoreBytes = ~((ColorIgnoreBytes << 8) - ColorIgnoreBytes);
1953 */
1954
1955 /* Loop through each byte */
1956 for (i = 0; i < Size; i++)
1957 {
1958 ULONG PlaneData = 0;
1959
1960 /* This should always return a plane 0 address */
1961 VideoAddress = VgaTranslateAddress(Address + i);
1962
1963 /* Read all 4 planes */
1964 PlaneData = *(PULONG)&VgaMemory[VideoAddress * VGA_NUM_BANKS];
1965
1966 /* Reverse the bytes for which the color compare register is zero */
1967 PlaneData ^= ColorCompareBytes;
1968
1969 /* Apply the color ignore register */
1970 PlaneData |= ColorIgnoreBytes;
1971
1972 /* Store the value in the buffer */
1973 BufPtr[i] = (PlaneData & (PlaneData >> 8) & (PlaneData >> 16) & (PlaneData >> 24)) & 0xFF;
1974 }
1975 }
1976
1977 /* Load the latch registers */
1978 VideoAddress = VgaTranslateAddress(Address + Size - 1);
1980}
Definition: bufpool.h:45
unsigned long DWORD
Definition: ntddk_ex.h:95
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
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
Definition: ntbasedef.h:383
unsigned short USHORT
Definition: pedump.c:61
static WCHAR Address[46]
Definition: ping.c:68
#define DPRINT
Definition: sndvol32.h:73
static DWORD VgaTranslateAddress(DWORD Address)
Definition: svga.c:342
static BYTE VgaLatchRegisters[VGA_NUM_BANKS]
Definition: svga.c:246
#define WRAP_OFFSET(x)
Definition: svga.c:28
static BYTE VgaMiscRegister
Definition: svga.c:248
#define VGA_MISC_RAM_ENABLED
Definition: svga.h:83
#define VGA_GC_MODE_OE
Definition: svga.h:254
#define VGA_NUM_BANKS
Definition: svga.h:14
#define VGA_GC_MODE_READ
Definition: svga.h:253
#define VGA_SEQ_MEM_C4
Definition: svga.h:113
uint32_t * PULONG
Definition: typedefs.h:59
uint16_t * PUSHORT
Definition: typedefs.h:56
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by VgaWriteGc(), and VgaWritePort().

◆ VgaRefreshDisplay()

VOID VgaRefreshDisplay ( VOID  )

Definition at line 1783 of file svga.c.

1784{
1785 /* Save the scanline size */
1789
1790 /* Save the starting address */
1798
1800}
#define DWORD
Definition: nt_native.h:44
static DWORD ScanlineSizeLatch
Definition: svga.c:279
static VOID VgaVerticalRetrace(VOID)
Definition: svga.c:1613
static DWORD StartAddressLatch
Definition: svga.c:278
#define SVGA_CRTC_EXT_ADDR_BIT16
Definition: svga.h:193
#define SVGA_CRTC_EXT_OFFSET_BIT8
Definition: svga.h:196
#define SVGA_CRTC_EXT_ADDR_BIT19
Definition: svga.h:199
#define SVGA_CRTC_EXT_ADDR_BITS1718
Definition: svga.h:195
#define MAKEWORD(a, b)
Definition: typedefs.h:248

Referenced by EmulatorPause(), EmulatorResume(), ScreenEventHandler(), VgaCleanup(), VidBiosAttachToConsole(), VidBiosDetachFromConsole(), and VidBiosSetVideoMode().

◆ VgaWriteMemory()

BOOLEAN FASTCALL VgaWriteMemory ( ULONG  Address,
PVOID  Buffer,
ULONG  Size 
)

Definition at line 1982 of file svga.c.

1983{
1984 DWORD i, j;
1985 DWORD VideoAddress;
1986 PUCHAR BufPtr = (PUCHAR)Buffer;
1987
1988 DPRINT("VgaWriteMemory: Address 0x%08X, Size %lu\n", Address, Size);
1989
1990 /* Ignore if video RAM access is disabled */
1991 if ((VgaMiscRegister & VGA_MISC_RAM_ENABLED) == 0) return TRUE;
1992
1993 /* Also ignore if write access to all planes is disabled */
1994 if ((VgaSeqRegisters[VGA_SEQ_MASK_REG] & 0x0F) == 0x00) return TRUE;
1995
1997 {
1998 /* Loop through each byte */
1999 for (i = 0; i < Size; i++)
2000 {
2001 VideoAddress = VgaTranslateAddress(Address + i);
2002
2003 for (j = 0; j < VGA_NUM_BANKS; j++)
2004 {
2005 /* Make sure the page is writeable */
2006 if (!(VgaSeqRegisters[VGA_SEQ_MASK_REG] & (1 << j))) continue;
2007
2008 /* Check if this is chain-4 mode */
2010 {
2011 if (((Address + i) & 0x03) != j)
2012 {
2013 /* This plane will not be accessed */
2014 continue;
2015 }
2016 }
2017
2018 /* Check if this is odd-even mode */
2020 {
2021 if (((Address + i) & 0x01) != (j & 1))
2022 {
2023 /* This plane will not be accessed */
2024 continue;
2025 }
2026 }
2027
2028 /* Copy the value to the VGA memory */
2029 VgaMemory[VideoAddress * VGA_NUM_BANKS + j] = VgaTranslateByteForWriting(BufPtr[i], j);
2030 }
2031 }
2032 }
2033 else
2034 {
2035 PVOID VideoMemory;
2036
2037 // TODO: Apply the page write mask!
2038 // TODO: Check whether the write mode stuff applies to packed-pixel modes
2039
2040 /* Just copy to the video memory */
2041 VideoAddress = VgaTranslateAddress(Address);
2042 VideoMemory = &VgaMemory[VideoAddress + (Address & 3)];
2043
2044 switch (Size)
2045 {
2046 case sizeof(UCHAR):
2047 *(PUCHAR)VideoMemory = *(PUCHAR)Buffer;
2048 return TRUE;
2049
2050 case sizeof(USHORT):
2051 *(PUSHORT)VideoMemory = *(PUSHORT)Buffer;
2052 return TRUE;
2053
2054 case sizeof(ULONG):
2055 *(PULONG)VideoMemory = *(PULONG)Buffer;
2056 return TRUE;
2057
2058 case sizeof(ULONGLONG):
2059 *(PULONGLONG)VideoMemory = *(PULONGLONG)Buffer;
2060 return TRUE;
2061
2062 default:
2063#if defined(__GNUC__)
2064 __builtin_memcpy(VideoMemory, Buffer, Size);
2065#else
2066 RtlCopyMemory(VideoMemory, Buffer, Size);
2067#endif
2068 }
2069 }
2070
2071 return TRUE;
2072}
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
static BYTE VgaTranslateByteForWriting(BYTE Data, BYTE Plane)
Definition: svga.c:371

Referenced by VgaWriteGc(), and VgaWritePort().

◆ VgaWriteTextModeFont()

VOID VgaWriteTextModeFont ( UINT  FontNumber,
CONST UCHAR FontData,
UINT  Height 
)

Definition at line 2079 of file svga.c.

2080{
2081 UINT i, j;
2083
2084 for (i = 0; i < VGA_FONT_CHARACTERS; i++)
2085 {
2086 /* Write the character */
2087 for (j = 0; j < Height; j++)
2088 {
2090 }
2091
2092 /* Clear the unused part */
2093 for (j = Height; j < VGA_MAX_FONT_HEIGHT; j++)
2094 {
2096 }
2097 }
2098}
#define ASSERT(a)
Definition: mode.c:44
unsigned int UINT
Definition: ndis.h:50
#define VGA_FONT_BANK
Definition: svga.h:24
#define VGA_MAX_FONT_HEIGHT
Definition: svga.h:26
#define VGA_FONT_CHARACTERS
Definition: svga.h:25
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88

Referenced by VidBiosSetVideoMode(), and VidBiosVideoService().