ReactOS 0.4.16-dev-1993-gbf8741d
pcvideo.c File Reference
#include <freeldr.h>
#include <suppress.h>
#include <debug.h>
#include <pshpack2.h>
#include <poppack.h>
Include dependency graph for pcvideo.c:

Go to the source code of this file.

Classes

struct  SVGA_MODE_INFORMATION
 

Macros

#define VIDEOPORT_PALETTE_READ   0x03C7
 
#define VIDEOPORT_PALETTE_WRITE   0x03C8
 
#define VIDEOPORT_PALETTE_DATA   0x03C9
 
#define VIDEOPORT_VERTICAL_RETRACE   0x03DA
 
#define VIDEOVGA_MEM_ADDRESS   0xA0000
 
#define VIDEOTEXT_MEM_ADDRESS   0xB8000
 
#define VIDEOTEXT_MEM_SIZE   0x8000
 
#define VIDEOCARD_CGA_OR_OTHER   0
 
#define VIDEOCARD_EGA   1
 
#define VIDEOCARD_VGA   2
 
#define VIDEOMODE_NORMAL_TEXT   0
 
#define VIDEOMODE_EXTENDED_TEXT   1
 
#define VIDEOMODE_80X28   0x501C
 
#define VIDEOMODE_80X30   0x501E
 
#define VIDEOMODE_80X34   0x5022
 
#define VIDEOMODE_80X43   0x502B
 
#define VIDEOMODE_80X60   0x503C
 
#define VIDEOMODE_132X25   0x8419
 
#define VIDEOMODE_132X43   0x842B
 
#define VIDEOMODE_132X50   0x8432
 
#define VIDEOMODE_132X60   0x843C
 
#define VERTRES_200_SCANLINES   0x00
 
#define VERTRES_350_SCANLINES   0x01
 
#define VERTRES_400_SCANLINES   0x02
 

Typedefs

typedef struct SVGA_MODE_INFORMATIONPSVGA_MODE_INFORMATION
 

Enumerations

enum  {
  INT1FhFont = 0x00 , INT43hFont = 0x01 , ROM_8x14CharacterFont = 0x02 , ROM_8x8DoubleDotFontLo = 0x03 ,
  ROM_8x8DoubleDotFontHi = 0x04 , ROM_AlphaAlternate = 0x05 , ROM_8x16Font = 0x06 , ROM_Alternate9x16Font = 0x07 ,
  UltraVision_8x20Font = 0x11 , UltraVision_8x10Font = 0x12
}
 

Functions

 DBG_DEFAULT_CHANNEL (UI)
 
static ULONG PcVideoDetectVideoCard (VOID)
 
static VOID PcVideoSetBiosMode (UCHAR VideoMode)
 
static VOID PcVideoSetFont8x8 (VOID)
 
static VOID PcVideoSetFont8x14 (VOID)
 
static VOID PcVideoSelectAlternatePrintScreen (VOID)
 
static VOID PcVideoDisableCursorEmulation (VOID)
 
static VOID PcVideoDefineCursor (UCHAR StartScanLine, UCHAR EndScanLine)
 
static VOID PcVideoSetVerticalResolution (UCHAR VerticalResolutionMode)
 
static VOID PcVideoSet480ScanLines (VOID)
 
static VOID PcVideoSetDisplayEnd (VOID)
 
static BOOLEAN PcVideoVesaGetSVGAModeInformation (USHORT Mode, PSVGA_MODE_INFORMATION ModeInformation)
 
static BOOLEAN PcVideoSetBiosVesaMode (USHORT Mode)
 
static BOOLEAN PcVideoSetMode80x25 (VOID)
 
static BOOLEAN PcVideoSetMode80x50_80x43 (VOID)
 
static BOOLEAN PcVideoSetMode80x28 (VOID)
 
static BOOLEAN PcVideoSetMode80x30 (VOID)
 
static BOOLEAN PcVideoSetMode80x34 (VOID)
 
static BOOLEAN PcVideoSetMode80x43 (VOID)
 
static BOOLEAN PcVideoSetMode80x60 (VOID)
 
static BOOLEAN PcVideoSetMode (USHORT NewMode)
 
static VOID PcVideoSetBlinkBit (BOOLEAN Enable)
 
static VOID PcVideoSetMemoryBank (USHORT BankNumber)
 
VIDEODISPLAYMODE PcVideoSetDisplayMode (PCSTR DisplayModeName, BOOLEAN Init)
 
VOID PcVideoGetDisplaySize (PULONG Width, PULONG Height, PULONG Depth)
 
ULONG PcVideoGetBufferSize (VOID)
 
VOID PcVideoGetFontsFromFirmware (PULONG RomFontPointers)
 
VOID PcVideoSetTextCursorPosition (UCHAR X, UCHAR Y)
 
VOID PcVideoHideShowTextCursor (BOOLEAN Show)
 
VOID PcVideoCopyOffScreenBufferToVRAM (PVOID Buffer)
 
VOID PcVideoClearScreen (UCHAR Attr)
 
VOID PcVideoPutChar (int Ch, UCHAR Attr, unsigned X, unsigned Y)
 
BOOLEAN PcVideoIsPaletteFixed (VOID)
 
VOID PcVideoSetPaletteColor (UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
 
VOID PcVideoGetPaletteColor (UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
 
VOID PcVideoSync (VOID)
 
VOID PcVideoPrepareForReactOS (VOID)
 

Variables

UCHAR MachDefaultTextColor = COLOR_GRAY
 
static USHORT BiosVideoMode
 
static ULONG ScreenWidth = 80
 
static ULONG ScreenHeight = 25
 
static ULONG BytesPerScanLine = 160
 
static VIDEODISPLAYMODE DisplayMode = VideoTextMode
 
static BOOLEAN VesaVideoMode = FALSE
 
static SVGA_MODE_INFORMATION VesaVideoModeInformation
 
static ULONG CurrentMemoryBank = 0
 

Macro Definition Documentation

◆ VERTRES_200_SCANLINES

#define VERTRES_200_SCANLINES   0x00

Definition at line 50 of file pcvideo.c.

◆ VERTRES_350_SCANLINES

#define VERTRES_350_SCANLINES   0x01

Definition at line 51 of file pcvideo.c.

◆ VERTRES_400_SCANLINES

#define VERTRES_400_SCANLINES   0x02

Definition at line 52 of file pcvideo.c.

◆ VIDEOCARD_CGA_OR_OTHER

#define VIDEOCARD_CGA_OR_OTHER   0

Definition at line 34 of file pcvideo.c.

◆ VIDEOCARD_EGA

#define VIDEOCARD_EGA   1

Definition at line 35 of file pcvideo.c.

◆ VIDEOCARD_VGA

#define VIDEOCARD_VGA   2

Definition at line 36 of file pcvideo.c.

◆ VIDEOMODE_132X25

#define VIDEOMODE_132X25   0x8419

Definition at line 45 of file pcvideo.c.

◆ VIDEOMODE_132X43

#define VIDEOMODE_132X43   0x842B

Definition at line 46 of file pcvideo.c.

◆ VIDEOMODE_132X50

#define VIDEOMODE_132X50   0x8432

Definition at line 47 of file pcvideo.c.

◆ VIDEOMODE_132X60

#define VIDEOMODE_132X60   0x843C

Definition at line 48 of file pcvideo.c.

◆ VIDEOMODE_80X28

#define VIDEOMODE_80X28   0x501C

Definition at line 40 of file pcvideo.c.

◆ VIDEOMODE_80X30

#define VIDEOMODE_80X30   0x501E

Definition at line 41 of file pcvideo.c.

◆ VIDEOMODE_80X34

#define VIDEOMODE_80X34   0x5022

Definition at line 42 of file pcvideo.c.

◆ VIDEOMODE_80X43

#define VIDEOMODE_80X43   0x502B

Definition at line 43 of file pcvideo.c.

◆ VIDEOMODE_80X60

#define VIDEOMODE_80X60   0x503C

Definition at line 44 of file pcvideo.c.

◆ VIDEOMODE_EXTENDED_TEXT

#define VIDEOMODE_EXTENDED_TEXT   1

Definition at line 39 of file pcvideo.c.

◆ VIDEOMODE_NORMAL_TEXT

#define VIDEOMODE_NORMAL_TEXT   0

Definition at line 38 of file pcvideo.c.

◆ VIDEOPORT_PALETTE_DATA

#define VIDEOPORT_PALETTE_DATA   0x03C9

Definition at line 27 of file pcvideo.c.

◆ VIDEOPORT_PALETTE_READ

#define VIDEOPORT_PALETTE_READ   0x03C7

Definition at line 25 of file pcvideo.c.

◆ VIDEOPORT_PALETTE_WRITE

#define VIDEOPORT_PALETTE_WRITE   0x03C8

Definition at line 26 of file pcvideo.c.

◆ VIDEOPORT_VERTICAL_RETRACE

#define VIDEOPORT_VERTICAL_RETRACE   0x03DA

Definition at line 28 of file pcvideo.c.

◆ VIDEOTEXT_MEM_ADDRESS

#define VIDEOTEXT_MEM_ADDRESS   0xB8000

Definition at line 31 of file pcvideo.c.

◆ VIDEOTEXT_MEM_SIZE

#define VIDEOTEXT_MEM_SIZE   0x8000

Definition at line 32 of file pcvideo.c.

◆ VIDEOVGA_MEM_ADDRESS

#define VIDEOVGA_MEM_ADDRESS   0xA0000

Definition at line 30 of file pcvideo.c.

Typedef Documentation

◆ PSVGA_MODE_INFORMATION

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
INT1FhFont 
INT43hFont 
ROM_8x14CharacterFont 
ROM_8x8DoubleDotFontLo 
ROM_8x8DoubleDotFontHi 
ROM_AlphaAlternate 
ROM_8x16Font 
ROM_Alternate9x16Font 
UltraVision_8x20Font 
UltraVision_8x10Font 

Definition at line 122 of file pcvideo.c.

123{
124 INT1FhFont = 0x00,
125 INT43hFont = 0x01,
129 ROM_AlphaAlternate = 0x05,
130 ROM_8x16Font = 0x06,
134};
@ INT43hFont
Definition: pcvideo.c:125
@ UltraVision_8x20Font
Definition: pcvideo.c:132
@ ROM_AlphaAlternate
Definition: pcvideo.c:129
@ ROM_8x16Font
Definition: pcvideo.c:130
@ ROM_8x14CharacterFont
Definition: pcvideo.c:126
@ INT1FhFont
Definition: pcvideo.c:124
@ UltraVision_8x10Font
Definition: pcvideo.c:133
@ ROM_8x8DoubleDotFontHi
Definition: pcvideo.c:128
@ ROM_8x8DoubleDotFontLo
Definition: pcvideo.c:127
@ ROM_Alternate9x16Font
Definition: pcvideo.c:131

Function Documentation

◆ DBG_DEFAULT_CHANNEL()

DBG_DEFAULT_CHANNEL ( UI  )

◆ PcVideoClearScreen()

VOID PcVideoClearScreen ( UCHAR  Attr)

Definition at line 1088 of file pcvideo.c.

1089{
1090 USHORT AttrChar;
1091 USHORT *BufPtr;
1092
1093 AttrChar = ((USHORT) Attr << 8) | ' ';
1094 for (BufPtr = (USHORT *) VIDEOTEXT_MEM_ADDRESS;
1096 BufPtr++)
1097 {
1099 *BufPtr = AttrChar;
1100 }
1101}
#define VIDEOTEXT_MEM_ADDRESS
Definition: pcvideo.c:31
#define VIDEOTEXT_MEM_SIZE
Definition: pcvideo.c:32
unsigned short USHORT
Definition: pedump.c:61
#define __WARNING_DEREF_NULL_PTR
Definition: suppress.h:32
#define _PRAGMA_WARNING_SUPPRESS(x)
Definition: suppress.h:28

Referenced by MachInit().

◆ PcVideoCopyOffScreenBufferToVRAM()

VOID PcVideoCopyOffScreenBufferToVRAM ( PVOID  Buffer)

Definition at line 1047 of file pcvideo.c.

1048{
1049 USHORT BanksToCopy;
1050 ULONG BytesInLastBank;
1051 USHORT CurrentBank;
1052 ULONG BankSize;
1053
1054 /* PcVideoWaitForVerticalRetrace(); */
1055
1056 /* Text mode (BIOS or VESA) */
1058 {
1060 }
1061 /* VESA graphics mode */
1063 {
1067
1068 /* Copy all the banks but the last one because
1069 * it is probably a partial bank */
1070 for (CurrentBank = 0; CurrentBank < BanksToCopy; CurrentBank++)
1071 {
1072 PcVideoSetMemoryBank(CurrentBank);
1073 RtlCopyMemory((PVOID) VIDEOVGA_MEM_ADDRESS, (char *) Buffer + CurrentBank * BankSize, BankSize);
1074 }
1075
1076 /* Copy the remaining bytes into the last bank */
1077 PcVideoSetMemoryBank(CurrentBank);
1078 RtlCopyMemory((PVOID)VIDEOVGA_MEM_ADDRESS, (char *) Buffer + CurrentBank * BankSize, BytesInLastBank);
1079 }
1080 /* BIOS graphics mode */
1081 else
1082 {
1084 }
1085}
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
@ VideoTextMode
Definition: machine.h:35
@ VideoGraphicsMode
Definition: machine.h:36
Definition: bufpool.h:45
static SVGA_MODE_INFORMATION VesaVideoModeInformation
Definition: pcvideo.c:119
static VIDEODISPLAYMODE DisplayMode
Definition: pcvideo.c:117
#define VIDEOVGA_MEM_ADDRESS
Definition: pcvideo.c:30
static BOOLEAN VesaVideoMode
Definition: pcvideo.c:118
static VOID PcVideoSetMemoryBank(USHORT BankNumber)
Definition: pcvideo.c:849
ULONG PcVideoGetBufferSize(VOID)
Definition: pcvideo.c:969
USHORT HeightInPixels
Definition: pcvideo.c:68
USHORT BytesPerScanLine
Definition: pcvideo.c:65
USHORT WindowGranularity
Definition: pcvideo.c:60
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint32_t ULONG
Definition: typedefs.h:59

Referenced by MachInit().

◆ PcVideoDefineCursor()

static VOID PcVideoDefineCursor ( UCHAR  StartScanLine,
UCHAR  EndScanLine 
)
static

Definition at line 316 of file pcvideo.c.

317{
318 REGS Regs;
319
320 /* Int 10h AH=01h
321 * VIDEO - SET TEXT-MODE CURSOR SHAPE
322 *
323 * AH = 01h
324 * CH = cursor start and options
325 * CL = bottom scan line containing cursor (bits 0-4)
326 * Return:
327 * Nothing
328 *
329 * Specify the starting and ending scan lines to be occupied
330 * by the hardware cursor in text modes.
331 *
332 * AMI 386 BIOS and AST Premier 386 BIOS will lock up the
333 * system if AL is not equal to the current video mode.
334 *
335 * Bitfields for cursor start and options:
336 *
337 * Bit(s) Description
338 * 7 should be zero
339 * 6,5 cursor blink
340 * (00=normal, 01=invisible, 10=erratic, 11=slow).
341 * (00=normal, other=invisible on EGA/VGA)
342 * 4-0 topmost scan line containing cursor
343 */
344 Regs.b.ah = 0x01;
345 Regs.b.al = 0x03;
346 Regs.b.ch = StartScanLine;
347 Regs.b.cl = EndScanLine;
348 Int386(0x10, &Regs, &Regs);
349}
int __cdecl Int386(int ivec, REGS *in, REGS *out)
unsigned char ch
Definition: pcbios.h:140
unsigned char cl
Definition: pcbios.h:139
unsigned char al
Definition: pcbios.h:133
unsigned char ah
Definition: pcbios.h:134
Definition: pcbios.h:161
BYTEREGS b
Definition: pcbios.h:165

Referenced by PcVideoHideShowTextCursor(), PcVideoSetMode80x28(), PcVideoSetMode80x34(), PcVideoSetMode80x43(), PcVideoSetMode80x50_80x43(), and PcVideoSetMode80x60().

◆ PcVideoDetectVideoCard()

static ULONG PcVideoDetectVideoCard ( VOID  )
static

Definition at line 137 of file pcvideo.c.

138{
139 REGS Regs;
140
141 /* Int 10h AH=12h BL=10h
142 * VIDEO - ALTERNATE FUNCTION SELECT (PS,EGA,VGA,MCGA) - GET EGA INFO
143 *
144 * AH = 12h
145 * BL = 10h
146 * Return:
147 * BH = video state
148 * 00h color mode in effect (I/O port 3Dxh)
149 * 01h mono mode in effect (I/O port 3Bxh)
150 * BL = installed memory (00h = 64K, 01h = 128K, 02h = 192K, 03h = 256K)
151 * CH = feature connector bits
152 * CL = switch settings
153 * AH destroyed (at least by Tseng ET4000 BIOS v8.00n)
154 *
155 * Installation check;EGA
156 */
157 Regs.b.ah = 0x12;
158 Regs.b.bl = 0x10;
159 Int386(0x10, &Regs, &Regs);
160
161 /* If BL is still equal to 0x10 then there is no EGA/VGA present */
162 if (0x10 == Regs.b.bl)
163 {
165 }
166
167 /* Int 10h AX=1A00h
168 * VIDEO - GET DISPLAY COMBINATION CODE (PS,VGA/MCGA)
169 *
170 * AX = 1A00h
171 * Return:
172 * AL = 1Ah if function was supported
173 * BL = active display code
174 * BH = alternate display code
175 *
176 * This function is commonly used to check for the presence of a VGA.
177 *
178 * Installation check;VGA
179 *
180 * Values for display combination code:
181 * 00h no display
182 * 01h monochrome adapter w/ monochrome display
183 * 02h CGA w/ color display
184 * 03h reserved
185 * 04h EGA w/ color display
186 * 05h EGA w/ monochrome display
187 * 06h PGA w/ color display
188 * 07h VGA w/ monochrome analog display
189 * 08h VGA w/ color analog display
190 * 09h reserved
191 * 0Ah MCGA w/ digital color display
192 * 0Bh MCGA w/ monochrome analog display
193 * 0Ch MCGA w/ color analog display
194 * FFh unknown display type
195 */
196 Regs.w.ax = 0x1A00;
197 Int386(0x10, &Regs, &Regs);
198
199 if (0x1a == Regs.b.al)
200 {
201 return VIDEOCARD_VGA;
202 }
203 else
204 {
205 return VIDEOCARD_EGA;
206 }
207}
#define VIDEOCARD_VGA
Definition: pcvideo.c:36
#define VIDEOCARD_CGA_OR_OTHER
Definition: pcvideo.c:34
#define VIDEOCARD_EGA
Definition: pcvideo.c:35
unsigned char bl
Definition: pcbios.h:136
unsigned short ax
Definition: pcbios.h:113
WORDREGS w
Definition: pcbios.h:164

Referenced by PcVideoSetDisplayMode(), and PcVideoSetMode80x50_80x43().

◆ PcVideoDisableCursorEmulation()

static VOID PcVideoDisableCursorEmulation ( VOID  )
static

Definition at line 291 of file pcvideo.c.

292{
293 REGS Regs;
294
295 /* Int 10h AH=12h BL=34h
296 * VIDEO - ALTERNATE FUNCTION SELECT (VGA) - CURSOR EMULATION
297 *
298 * AH = 12h
299 * BL = 34h
300 * AL = new state
301 * 00h enable alphanumeric cursor emulation
302 * 01h disable alphanumeric cursor emulation
303 * Return:
304 * AL = 12h if function supported
305 *
306 * Specify whether the BIOS should automatically remap cursor start/end
307 * according to the current character height in text modes.
308 */
309 Regs.b.ah = 0x12;
310 Regs.b.bl = 0x34;
311 Regs.b.al = 0x01;
312 Int386(0x10, &Regs, &Regs);
313}

Referenced by PcVideoSetMode80x43(), PcVideoSetMode80x50_80x43(), and PcVideoSetMode80x60().

◆ PcVideoGetBufferSize()

ULONG PcVideoGetBufferSize ( VOID  )

Definition at line 969 of file pcvideo.c.

970{
972}
static ULONG ScreenHeight
Definition: pcvideo.c:115
static ULONG BytesPerScanLine
Definition: pcvideo.c:116

Referenced by MachInit(), and PcVideoCopyOffScreenBufferToVRAM().

◆ PcVideoGetDisplaySize()

VOID PcVideoGetDisplaySize ( PULONG  Width,
PULONG  Height,
PULONG  Depth 
)

Definition at line 945 of file pcvideo.c.

946{
950 {
952 {
953 /* 16-bit color modes give green an extra bit (5:6:5)
954 * 15-bit color modes have just 5:5:5 for R:G:B */
955 *Depth = (6 == VesaVideoModeInformation.GreenMaskSize ? 16 : 15);
956 }
957 else
958 {
960 }
961 }
962 else
963 {
964 *Depth = 0;
965 }
966}
static ULONG ScreenWidth
Definition: pcvideo.c:114
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:819

Referenced by MachInit().

◆ PcVideoGetFontsFromFirmware()

VOID PcVideoGetFontsFromFirmware ( PULONG  RomFontPointers)

Definition at line 975 of file pcvideo.c.

976{
977 REGS BiosRegs;
978
979 /* Get the address of the BIOS ROM fonts.
980 Int 10h, AX=1130h, BH = pointer specifier
981 returns: es:bp = address */
982 BiosRegs.d.eax = 0x1130;
983 BiosRegs.b.bh = ROM_8x14CharacterFont;
984 Int386(0x10, &BiosRegs, &BiosRegs);
985 RomFontPointers[0] = BiosRegs.w.es << 4 | BiosRegs.w.bp;
986
987 BiosRegs.b.bh = ROM_8x8DoubleDotFontLo;
988 Int386(0x10, &BiosRegs, &BiosRegs);
989 RomFontPointers[1] = BiosRegs.w.es << 16 | BiosRegs.w.bp;
990
991 BiosRegs.b.bh = ROM_8x8DoubleDotFontHi;
992 Int386(0x10, &BiosRegs, &BiosRegs);
993 RomFontPointers[2] = BiosRegs.w.es << 16 | BiosRegs.w.bp;
994
995 BiosRegs.b.bh = ROM_AlphaAlternate;
996 Int386(0x10, &BiosRegs, &BiosRegs);
997 RomFontPointers[3] = BiosRegs.w.es << 16 | BiosRegs.w.bp;
998
999 BiosRegs.b.bh = ROM_8x16Font;
1000 Int386(0x10, &BiosRegs, &BiosRegs);
1001 RomFontPointers[4] = BiosRegs.w.es << 16 | BiosRegs.w.bp;
1002
1003 BiosRegs.b.bh = ROM_Alternate9x16Font;
1004 Int386(0x10, &BiosRegs, &BiosRegs);
1005 RomFontPointers[5] = BiosRegs.w.es << 16 | BiosRegs.w.bp;
1006}
#define RomFontPointers
Definition: winldr.c:348
unsigned char bh
Definition: pcbios.h:137
unsigned long eax
Definition: pcbios.h:93
unsigned short bp
Definition: pcbios.h:120
unsigned short es
Definition: pcbios.h:123
DWORDREGS d
Definition: pcbios.h:163

Referenced by MachInit().

◆ PcVideoGetPaletteColor()

VOID PcVideoGetPaletteColor ( UCHAR  Color,
UCHAR Red,
UCHAR Green,
UCHAR Blue 
)

Definition at line 1128 of file pcvideo.c.

1129{
1134}
@ Green
Definition: bl.h:199
@ Red
Definition: bl.h:201
@ Blue
Definition: bl.h:198
#define READ_PORT_UCHAR(p)
Definition: pc98vid.h:22
#define WRITE_PORT_UCHAR(p, d)
Definition: pc98vid.h:21
#define VIDEOPORT_PALETTE_READ
Definition: pcvideo.c:25
#define VIDEOPORT_PALETTE_DATA
Definition: pcvideo.c:27
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by MachInit().

◆ PcVideoHideShowTextCursor()

VOID PcVideoHideShowTextCursor ( BOOLEAN  Show)

Definition at line 1034 of file pcvideo.c.

1035{
1036 if (Show)
1037 {
1038 PcVideoDefineCursor(0x0D, 0x0E);
1039 }
1040 else
1041 {
1042 PcVideoDefineCursor(0x20, 0x00);
1043 }
1044}
static VOID PcVideoDefineCursor(UCHAR StartScanLine, UCHAR EndScanLine)
Definition: pcvideo.c:316

Referenced by MachInit(), and PcVideoPrepareForReactOS().

◆ PcVideoIsPaletteFixed()

BOOLEAN PcVideoIsPaletteFixed ( VOID  )

Definition at line 1113 of file pcvideo.c.

1114{
1115 return FALSE;
1116}
#define FALSE
Definition: types.h:117

Referenced by MachInit().

◆ PcVideoPrepareForReactOS()

VOID PcVideoPrepareForReactOS ( VOID  )

Definition at line 1160 of file pcvideo.c.

1161{
1162 // PcVideoSetMode80x50_80x43();
1165}
static BOOLEAN PcVideoSetMode80x25(VOID)
Definition: pcvideo.c:602
VOID PcVideoHideShowTextCursor(BOOLEAN Show)
Definition: pcvideo.c:1034

Referenced by PcPrepareForReactOS().

◆ PcVideoPutChar()

VOID PcVideoPutChar ( int  Ch,
UCHAR  Attr,
unsigned  X,
unsigned  Y 
)

Definition at line 1104 of file pcvideo.c.

1105{
1106 USHORT *BufPtr;
1107
1108 BufPtr = (USHORT *) (ULONG_PTR)(VIDEOTEXT_MEM_ADDRESS + Y * BytesPerScanLine + X * 2);
1109 *BufPtr = ((USHORT) Attr << 8) | (Ch & 0xff);
1110}
#define Y(I)
#define Ch(x, y, z)
Definition: sha2.c:141
uint32_t ULONG_PTR
Definition: typedefs.h:65

Referenced by MachInit().

◆ PcVideoSelectAlternatePrintScreen()

static VOID PcVideoSelectAlternatePrintScreen ( VOID  )
static

Definition at line 267 of file pcvideo.c.

268{
269 REGS Regs;
270
271 /* Int 10h AH=12h BL=20h
272 * VIDEO - ALTERNATE FUNCTION SELECT (PS,EGA,VGA,MCGA) - ALTERNATE PRTSC
273 *
274 * AH = 12h
275 * BL = 20h select alternate print screen routine
276 * Return:
277 * Nothing
278 *
279 * Installs a PrtSc routine from the video card's BIOS to replace the
280 * default PrtSc handler from the ROM BIOS, which usually does not
281 * understand screen heights other than 25 lines.
282 *
283 * Some adapters disable print-screen instead of enhancing it.
284 */
285 Regs.b.ah = 0x12;
286 Regs.b.bl = 0x20;
287 Int386(0x10, &Regs, &Regs);
288}

Referenced by PcVideoSetMode80x43(), PcVideoSetMode80x50_80x43(), and PcVideoSetMode80x60().

◆ PcVideoSet480ScanLines()

static VOID PcVideoSet480ScanLines ( VOID  )
static

Definition at line 379 of file pcvideo.c.

380{
382
383 /* Read CRTC port */
384 CRTC = READ_PORT_UCHAR((PUCHAR)0x03CC);
385
386 if (CRTC & 1)
387 {
388 CRTC = 0x3D4;
389 }
390 else
391 {
392 CRTC = 0x3B4;
393 }
394
395 /* Vertical sync end (also unlocks CR0-7) */
397 WRITE_PORT_UCHAR((PUCHAR)CRTC+1, 0x0C);
398
399 /* Vertical total */
401 WRITE_PORT_UCHAR((PUCHAR)CRTC+1, 0x0B);
402
403 /* (vertical) overflow */
405 WRITE_PORT_UCHAR((PUCHAR)CRTC+1, 0x3E);
406
407 /* Vertical sync start */
409 WRITE_PORT_UCHAR((PUCHAR)CRTC+1, 0xEA);
410
411 /* Vertical display end */
413 WRITE_PORT_UCHAR((PUCHAR)CRTC+1, 0xDF);
414
415 /* Vertical blank start */
417 WRITE_PORT_UCHAR((PUCHAR)CRTC+1, 0xE7);
418
419 /* Vertical blank end */
421 WRITE_PORT_UCHAR((PUCHAR)CRTC+1, 0x04);
422
423 /* Misc output register (read) */
424 CRTC = READ_PORT_UCHAR((PUCHAR)0x03CC);
425
426 /* Preserve clock select bits and color bit */
427 CRTC = (CRTC & 0x0D);
428 /* Set correct sync polarity */
429 CRTC = (CRTC | 0xE2);
430
431 /* (write) */
433}
#define CRTC
Definition: blue.h:111
int32_t INT_PTR
Definition: typedefs.h:64
unsigned char * PUCHAR
Definition: typedefs.h:53

Referenced by PcVideoSetMode80x30(), PcVideoSetMode80x34(), and PcVideoSetMode80x60().

◆ PcVideoSetBiosMode()

static VOID PcVideoSetBiosMode ( UCHAR  VideoMode)
static

Definition at line 209 of file pcvideo.c.

210{
211 REGS Regs;
212
213 /* Int 10h AH=00h
214 * VIDEO - SET VIDEO MODE
215 *
216 * AH = 00h
217 * AL = desired video mode
218 * Return:
219 * AL = video mode flag (Phoenix, AMI BIOS)
220 * 20h mode > 7
221 * 30h modes 0-5 and 7
222 * 3Fh mode 6
223 * AL = CRT controller mode byte (Phoenix 386 BIOS v1.10)
224 */
225 Regs.b.ah = 0x00;
226 Regs.b.al = VideoMode;
227 Int386(0x10, &Regs, &Regs);
228}
struct _VideoMode VideoMode

Referenced by PcVideoSetMode(), PcVideoSetMode80x25(), and PcVideoSetMode80x50_80x43().

◆ PcVideoSetBiosVesaMode()

static BOOLEAN PcVideoSetBiosVesaMode ( USHORT  Mode)
static

Definition at line 530 of file pcvideo.c.

531{
532 REGS Regs;
533
534 /* Int 10h AX=4F02h
535 * VESA SuperVGA BIOS - SET SuperVGA VIDEO MODE
536 *
537 * AX = 4F02h
538 * BX = new video mode
539 * ES:DI -> (VBE 3.0+) CRTC information block, bit mode bit 11 set
540 * Return:
541 * AL = 4Fh if function supported
542 * AH = status
543 * 00h successful
544 * 01h failed
545 *
546 * Values for VESA video mode:
547 * 00h-FFh OEM video modes (see #00010 at AH=00h)
548 * 100h 640x400x256
549 * 101h 640x480x256
550 * 102h 800x600x16
551 * 103h 800x600x256
552 * 104h 1024x768x16
553 * 105h 1024x768x256
554 * 106h 1280x1024x16
555 * 107h 1280x1024x256
556 * 108h 80x60 text
557 * 109h 132x25 text
558 * 10Ah 132x43 text
559 * 10Bh 132x50 text
560 * 10Ch 132x60 text
561 * ---VBE v1.2+ ---
562 * 10Dh 320x200x32K
563 * 10Eh 320x200x64K
564 * 10Fh 320x200x16M
565 * 110h 640x480x32K
566 * 111h 640x480x64K
567 * 112h 640x480x16M
568 * 113h 800x600x32K
569 * 114h 800x600x64K
570 * 115h 800x600x16M
571 * 116h 1024x768x32K
572 * 117h 1024x768x64K
573 * 118h 1024x768x16M
574 * 119h 1280x1024x32K (1:5:5:5)
575 * 11Ah 1280x1024x64K (5:6:5)
576 * 11Bh 1280x1024x16M
577 * ---VBE 2.0+ ---
578 * 120h 1600x1200x256
579 * 121h 1600x1200x32K
580 * 122h 1600x1200x64K
581 * 81FFh special full-memory access mode
582 *
583 * Notes: The special mode 81FFh preserves the contents of the video memory and gives
584 * access to all of the memory; VESA recommends that the special mode be a packed-pixel
585 * mode. For VBE 2.0+, it is required that the VBE implement the mode, but not place it
586 * in the list of available modes (mode information for this mode can be queried
587 * directly, however).. As of VBE 2.0, VESA will no longer define video mode numbers
588 */
589 Regs.w.ax = 0x4F02;
590 Regs.w.bx = Mode;
591 Int386(0x10, &Regs, &Regs);
592
593 if (0x004F != Regs.w.ax)
594 {
595 return FALSE;
596 }
597
598 return TRUE;
599}
#define TRUE
Definition: types.h:120
_In_ ULONG Mode
Definition: hubbusif.h:303
unsigned short bx
Definition: pcbios.h:114

Referenced by PcVideoSetMode().

◆ PcVideoSetBlinkBit()

static VOID PcVideoSetBlinkBit ( BOOLEAN  Enable)
static

Definition at line 824 of file pcvideo.c.

825{
826 REGS Regs;
827
828 /* Int 10h AX=1003h
829 * VIDEO - TOGGLE INTENSITY/BLINKING BIT (Jr, PS, TANDY 1000, EGA, VGA)
830 *
831 * AX = 1003h
832 * BL = new state
833 * 00h background intensity enabled
834 * 01h blink enabled
835 * BH = 00h to avoid problems on some adapters
836 * Return:
837 * Nothing
838 *
839 * Note: although there is no function to get
840 * the current status, bit 5 of 0040h:0065h
841 * indicates the state.
842 */
843 Regs.w.ax = 0x1003;
844 Regs.w.bx = Enable ? 0x0001 : 0x0000;
845 Int386(0x10, &Regs, &Regs);
846}
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:142

Referenced by PcVideoSetDisplayMode().

◆ PcVideoSetDisplayEnd()

static VOID PcVideoSetDisplayEnd ( VOID  )
static

Definition at line 436 of file pcvideo.c.

437{
439
440 /* Read CRTC port */
441 CRTC = READ_PORT_UCHAR((PUCHAR)0x03CC);
442
443 if (CRTC & 1)
444 {
445 CRTC = 0x3D4;
446 }
447 else
448 {
449 CRTC = 0x3B4;
450 }
451
452 /* Vertical display end */
454 WRITE_PORT_UCHAR((PUCHAR)CRTC+1, 0xDF);
455}

Referenced by PcVideoSetMode80x34(), and PcVideoSetMode80x60().

◆ PcVideoSetDisplayMode()

VIDEODISPLAYMODE PcVideoSetDisplayMode ( PCSTR  DisplayModeName,
BOOLEAN  Init 
)

Definition at line 887 of file pcvideo.c.

888{
890
891 if (NULL == DisplayModeName || '\0' == *DisplayModeName)
892 {
894 return DisplayMode;
895 }
896
898 {
899 TRACE("CGA or other display adapter detected.\n");
900 printf("CGA or other display adapter detected.\n");
901 printf("Using 80x25 text mode.\n");
903 }
905 {
906 TRACE("EGA display adapter detected.\n");
907 printf("EGA display adapter detected.\n");
908 printf("Using 80x25 text mode.\n");
910 }
911 else /* if (VIDEOCARD_VGA == PcVideoDetectVideoCard()) */
912 {
913 TRACE("VGA display adapter detected.\n");
914
915 if (0 == _stricmp(DisplayModeName, "NORMAL_VGA"))
916 {
918 }
919 else if (0 == _stricmp(DisplayModeName, "EXTENDED_VGA"))
920 {
922 }
923 else
924 {
925 VideoMode = (USHORT)strtoul(DisplayModeName, NULL, 0);
926 }
927 }
928
930 {
931 printf("Error: unable to set video display mode 0x%x\n", (int) VideoMode);
932 printf("Defaulting to 80x25 text mode.\n");
933 printf("Press any key to continue.\n");
934 PcConsGetCh();
935
937 }
938
940
941 return DisplayMode;
942}
UINT32 strtoul(const char *String, char **Terminator, UINT32 Base)
Definition: utclib.c:696
#define _stricmp
Definition: cat.c:22
#define NULL
Definition: types.h:112
#define printf
Definition: freeldr.h:97
int PcConsGetCh(void)
Definition: pccons.c:84
static ULONG PcVideoDetectVideoCard(VOID)
Definition: pcvideo.c:137
#define VIDEOMODE_NORMAL_TEXT
Definition: pcvideo.c:38
static BOOLEAN PcVideoSetMode(USHORT NewMode)
Definition: pcvideo.c:716
#define VIDEOMODE_EXTENDED_TEXT
Definition: pcvideo.c:39
static VOID PcVideoSetBlinkBit(BOOLEAN Enable)
Definition: pcvideo.c:824
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by MachInit().

◆ PcVideoSetFont8x14()

static VOID PcVideoSetFont8x14 ( VOID  )
static

Definition at line 249 of file pcvideo.c.

250{
251 REGS Regs;
252
253 /* Int 10h AX=1111h
254 * VIDEO - TEXT-MODE CHARGEN - LOAD ROM MONOCHROME PATTERNS (PS,EGA,VGA)
255 *
256 * AX = 1111h
257 * BL = block to load
258 * Return:
259 * Nothing
260 */
261 Regs.w.ax = 0x1111;
262 Regs.b.bl = 0;
263 Int386(0x10, &Regs, &Regs);
264}

Referenced by PcVideoSetMode80x28(), and PcVideoSetMode80x34().

◆ PcVideoSetFont8x8()

static VOID PcVideoSetFont8x8 ( VOID  )
static

Definition at line 231 of file pcvideo.c.

232{
233 REGS Regs;
234
235 /* Int 10h AX=1112h
236 * VIDEO - TEXT-MODE CHARGEN - LOAD ROM 8x8 DBL-DOT PATTERNS (PS,EGA,VGA)
237 *
238 * AX = 1112h
239 * BL = block to load
240 * Return:
241 * Nothing
242 */
243 Regs.w.ax = 0x1112;
244 Regs.b.bl = 0x00;
245 Int386(0x10, &Regs, &Regs);
246}

Referenced by PcVideoSetMode80x43(), PcVideoSetMode80x50_80x43(), and PcVideoSetMode80x60().

◆ PcVideoSetMemoryBank()

static VOID PcVideoSetMemoryBank ( USHORT  BankNumber)
static

Definition at line 849 of file pcvideo.c.

850{
851 REGS Regs;
852
853 if (CurrentMemoryBank != BankNumber)
854 {
855 /* Int 10h AX=4F05h
856 * VESA SuperVGA BIOS - CPU VIDEO MEMORY CONTROL
857 *
858 * AX = 4F05h
859 * BH = subfunction
860 * 00h select video memory window
861 * 01h get video memory window
862 * DX = window address in video memory (in granularity units)
863 * Return:
864 * DX = window address in video memory (in gran. units)
865 * BL = window number
866 * 00h window A
867 * 01h window B.
868 * Return:
869 * AL = 4Fh if function supported
870 * AH = status
871 * 00h successful
872 * 01h failed
873 */
874 Regs.w.ax = 0x4F05;
875 Regs.w.bx = 0x0000;
876 Regs.w.dx = BankNumber;
877 Int386(0x10, &Regs, &Regs);
878
879 if (0x004F == Regs.w.ax)
880 {
881 CurrentMemoryBank = BankNumber;
882 }
883 }
884}
static ULONG CurrentMemoryBank
Definition: pcvideo.c:120
unsigned short dx
Definition: pcbios.h:116

Referenced by PcVideoCopyOffScreenBufferToVRAM().

◆ PcVideoSetMode()

static BOOLEAN PcVideoSetMode ( USHORT  NewMode)
static

Definition at line 716 of file pcvideo.c.

717{
719
720 /* Set the values for the default text modes
721 * If they are setting a graphics mode then
722 * these values will be changed.
723 */
724 BiosVideoMode = NewMode;
725 ScreenWidth = 80;
726 ScreenHeight = 25;
727 BytesPerScanLine = 160;
730
731 switch (NewMode)
732 {
734 case 0x03: /* BIOS 80x25 text mode number */
735 return PcVideoSetMode80x25();
738 case VIDEOMODE_80X28:
739 return PcVideoSetMode80x28();
740 case VIDEOMODE_80X30:
741 return PcVideoSetMode80x30();
742 case VIDEOMODE_80X34:
743 return PcVideoSetMode80x34();
744 case VIDEOMODE_80X43:
745 return PcVideoSetMode80x43();
746 case VIDEOMODE_80X60:
747 return PcVideoSetMode80x60();
748 }
749
750 if (0x12 == NewMode)
751 {
752 /* 640x480x16 */
753 PcVideoSetBiosMode((UCHAR)NewMode);
754 WRITE_PORT_USHORT((USHORT*)0x03CE, 0x0F01); /* For some reason this is necessary? */
755 ScreenWidth = 640;
756 ScreenHeight = 480;
757 BytesPerScanLine = 80;
758 BiosVideoMode = NewMode;
760
761 return TRUE;
762 }
763 else if (0x13 == NewMode)
764 {
765 /* 320x200x256 */
766 PcVideoSetBiosMode((UCHAR)NewMode);
767 ScreenWidth = 320;
768 ScreenHeight = 200;
769 BytesPerScanLine = 320;
770 BiosVideoMode = NewMode;
772
773 return TRUE;
774 }
775 else if (0x0108 <= NewMode && NewMode <= 0x010C)
776 {
777 /* VESA Text Mode */
779 {
780 return FALSE;
781 }
782
783 if (! PcVideoSetBiosVesaMode(NewMode))
784 {
785 return FALSE;
786 }
787
791 BiosVideoMode = NewMode;
794
795 return TRUE;
796 }
797 else
798 {
799 /* VESA Graphics Mode */
801 {
802 return FALSE;
803 }
804
805 if (! PcVideoSetBiosVesaMode(NewMode))
806 {
807 return FALSE;
808 }
809
813 BiosVideoMode = NewMode;
816
817 return TRUE;
818 }
819
820 return FALSE;
821}
VOID NTAPI WRITE_PORT_USHORT(IN PUSHORT Port, IN USHORT Value)
Definition: portio.c:115
#define VIDEOMODE_80X28
Definition: pcvideo.c:40
static BOOLEAN PcVideoSetMode80x34(VOID)
Definition: pcvideo.c:668
#define VIDEOMODE_80X34
Definition: pcvideo.c:42
#define VIDEOMODE_80X43
Definition: pcvideo.c:43
static BOOLEAN PcVideoSetMode80x60(VOID)
Definition: pcvideo.c:699
static BOOLEAN PcVideoSetMode80x30(VOID)
Definition: pcvideo.c:656
#define VIDEOMODE_80X60
Definition: pcvideo.c:44
#define VIDEOMODE_80X30
Definition: pcvideo.c:41
static VOID PcVideoSetBiosMode(UCHAR VideoMode)
Definition: pcvideo.c:209
static BOOLEAN PcVideoSetMode80x43(VOID)
Definition: pcvideo.c:683
static BOOLEAN PcVideoSetBiosVesaMode(USHORT Mode)
Definition: pcvideo.c:530
static BOOLEAN PcVideoVesaGetSVGAModeInformation(USHORT Mode, PSVGA_MODE_INFORMATION ModeInformation)
Definition: pcvideo.c:458
static BOOLEAN PcVideoSetMode80x50_80x43(VOID)
Definition: pcvideo.c:612
static BOOLEAN PcVideoSetMode80x28(VOID)
Definition: pcvideo.c:643
static USHORT BiosVideoMode
Definition: pcvideo.c:113
USHORT WidthInPixels
Definition: pcvideo.c:67

Referenced by PcVideoSetDisplayMode().

◆ PcVideoSetMode80x25()

static BOOLEAN PcVideoSetMode80x25 ( VOID  )
static

◆ PcVideoSetMode80x28()

static BOOLEAN PcVideoSetMode80x28 ( VOID  )
static

Definition at line 643 of file pcvideo.c.

644{
645 /* FIXME: Is this VGA-only? */
648 PcVideoDefineCursor(11, 12);
649 ScreenWidth = 80;
650 ScreenHeight = 28;
651
652 return TRUE;
653}
static VOID PcVideoSetFont8x14(VOID)
Definition: pcvideo.c:249

Referenced by PcVideoSetMode().

◆ PcVideoSetMode80x30()

static BOOLEAN PcVideoSetMode80x30 ( VOID  )
static

Definition at line 656 of file pcvideo.c.

657{
658 /* FIXME: Is this VGA-only? */
661 ScreenWidth = 80;
662 ScreenHeight = 30;
663
664 return TRUE;
665}
static VOID PcVideoSet480ScanLines(VOID)
Definition: pcvideo.c:379

Referenced by PcVideoSetMode().

◆ PcVideoSetMode80x34()

static BOOLEAN PcVideoSetMode80x34 ( VOID  )
static

Definition at line 668 of file pcvideo.c.

669{
670 /* FIXME: Is this VGA-only? */
674 PcVideoDefineCursor(11, 12);
676 ScreenWidth = 80;
677 ScreenHeight = 34;
678
679 return TRUE;
680}
static VOID PcVideoSetDisplayEnd(VOID)
Definition: pcvideo.c:436

Referenced by PcVideoSetMode().

◆ PcVideoSetMode80x43()

static BOOLEAN PcVideoSetMode80x43 ( VOID  )
static

Definition at line 683 of file pcvideo.c.

684{
685 /* FIXME: Is this VGA-only? */
692 ScreenWidth = 80;
693 ScreenHeight = 43;
694
695 return TRUE;
696}
static VOID PcVideoDisableCursorEmulation(VOID)
Definition: pcvideo.c:291
static VOID PcVideoSetFont8x8(VOID)
Definition: pcvideo.c:231
static VOID PcVideoSetVerticalResolution(UCHAR VerticalResolutionMode)
Definition: pcvideo.c:352
static VOID PcVideoSelectAlternatePrintScreen(VOID)
Definition: pcvideo.c:267
#define VERTRES_350_SCANLINES
Definition: pcvideo.c:51

Referenced by PcVideoSetMode().

◆ PcVideoSetMode80x50_80x43()

static BOOLEAN PcVideoSetMode80x50_80x43 ( VOID  )
static

Definition at line 612 of file pcvideo.c.

613{
615 {
616 PcVideoSetBiosMode(0x03);
621 ScreenWidth = 80;
622 ScreenHeight = 50;
623 }
625 {
626 PcVideoSetBiosMode(0x03);
631 ScreenWidth = 80;
632 ScreenHeight = 43;
633 }
634 else /* VIDEOCARD_CGA_OR_OTHER */
635 {
636 return FALSE;
637 }
638
639 return TRUE;
640}

Referenced by PcVideoSetMode().

◆ PcVideoSetMode80x60()

static BOOLEAN PcVideoSetMode80x60 ( VOID  )
static

Definition at line 699 of file pcvideo.c.

700{
701 /* FIXME: Is this VGA-only? */
709 ScreenWidth = 80;
710 ScreenHeight = 60;
711
712 return TRUE;
713}

Referenced by PcVideoSetMode().

◆ PcVideoSetPaletteColor()

VOID PcVideoSetPaletteColor ( UCHAR  Color,
UCHAR  Red,
UCHAR  Green,
UCHAR  Blue 
)

◆ PcVideoSetTextCursorPosition()

VOID PcVideoSetTextCursorPosition ( UCHAR  X,
UCHAR  Y 
)

Definition at line 1009 of file pcvideo.c.

1010{
1011 REGS Regs;
1012
1013 /* Int 10h AH=02h
1014 * VIDEO - SET CURSOR POSITION
1015 *
1016 * AH = 02h
1017 * BH = page number
1018 * 0-3 in modes 2&3
1019 * 0-7 in modes 0&1
1020 * 0 in graphics modes
1021 * DH = row (00h is top)
1022 * DL = column (00h is left)
1023 * Return:
1024 * Nothing
1025 */
1026 Regs.b.ah = 0x02;
1027 Regs.b.bh = 0x00;
1028 Regs.b.dh = Y;
1029 Regs.b.dl = X;
1030 Int386(0x10, &Regs, &Regs);
1031}
#define X(b, s)
unsigned char dl
Definition: pcbios.h:142
unsigned char dh
Definition: pcbios.h:143

Referenced by MachInit().

◆ PcVideoSetVerticalResolution()

static VOID PcVideoSetVerticalResolution ( UCHAR  VerticalResolutionMode)
static

Definition at line 352 of file pcvideo.c.

353{
354 REGS Regs;
355
356 /* Int 10h AH=12h BL=30h
357 * VIDEO - ALTERNATE FUNCTION SELECT (VGA) - SELECT VERTICAL RESOLUTION
358 *
359 * AH = 12h
360 * BL = 30h
361 * AL = vertical resolution
362 * 00h 200 scan lines
363 * 01h 350 scan lines
364 * 02h 400 scan lines
365 * Return:
366 * AL = 12h if function supported
367 *
368 * Specify the number of scan lines used to display text modes.
369 *
370 * The specified resolution will take effect on the next mode set.
371 */
372 Regs.b.ah = 0x12;
373 Regs.b.bl = 0x30;
374 Regs.b.al = VerticalResolutionMode;
375 Int386(0x10, &Regs, &Regs);
376}

Referenced by PcVideoSetMode80x43().

◆ PcVideoSync()

VOID PcVideoSync ( VOID  )

Definition at line 1137 of file pcvideo.c.

1138{
1140 {
1141 /*
1142 * Keep reading the port until bit 3 is clear
1143 * This waits for the current retrace to end and
1144 * we can catch the next one so we know we are
1145 * getting a full retrace.
1146 */
1147 }
1148
1150 {
1151 /*
1152 * Keep reading the port until bit 3 is set
1153 * Now that we know we aren't doing a vertical
1154 * retrace we need to wait for the next one.
1155 */
1156 }
1157}
#define VIDEOPORT_VERTICAL_RETRACE
Definition: pcvideo.c:28

Referenced by MachInit().

◆ PcVideoVesaGetSVGAModeInformation()

static BOOLEAN PcVideoVesaGetSVGAModeInformation ( USHORT  Mode,
PSVGA_MODE_INFORMATION  ModeInformation 
)
static

Definition at line 458 of file pcvideo.c.

459{
460 REGS Regs;
461
463
464 /* VESA SuperVGA BIOS - GET SuperVGA MODE INFORMATION
465 * AX = 4F01h
466 * CX = SuperVGA video mode (see #04082 for bitfields)
467 * ES:DI -> 256-byte buffer for mode information (see #00079)
468 * Return:
469 * AL = 4Fh if function supported
470 * AH = status
471 * 00h successful
472 * ES:DI buffer filled
473 * 01h failed
474 *
475 * Desc: Determine the attributes of the specified video mode
476 *
477 * Note: While VBE 1.1 and higher will zero out all unused bytes
478 * of the buffer, v1.0 did not, so applications that want to be
479 * backward compatible should clear the buffer before calling
480 */
481 Regs.w.ax = 0x4F01;
482 Regs.w.cx = Mode;
483 Regs.w.es = BIOSCALLBUFSEGMENT;
484 Regs.w.di = BIOSCALLBUFOFFSET;
485 Int386(0x10, &Regs, &Regs);
486
487 if (Regs.w.ax != 0x004F)
488 {
489 return FALSE;
490 }
491
492 RtlCopyMemory(ModeInformation, (PVOID)BIOSCALLBUFFER, sizeof(SVGA_MODE_INFORMATION));
493
494 TRACE("\n");
495 TRACE("BiosVesaGetSVGAModeInformation() mode 0x%x\n", Mode);
496 TRACE("ModeAttributes = 0x%x\n", ModeInformation->ModeAttributes);
497 TRACE("WindowAttributesA = 0x%x\n", ModeInformation->WindowAttributesA);
498 TRACE("WindowAttributesB = 0x%x\n", ModeInformation->WindowsAttributesB);
499 TRACE("WindowGranularity = %dKB\n", ModeInformation->WindowGranularity);
500 TRACE("WindowSize = %dKB\n", ModeInformation->WindowSize);
501 TRACE("WindowAStartSegment = 0x%x\n", ModeInformation->WindowAStartSegment);
502 TRACE("WindowBStartSegment = 0x%x\n", ModeInformation->WindowBStartSegment);
503 TRACE("WindowPositioningFunction = 0x%x\n", ModeInformation->WindowPositioningFunction);
504 TRACE("BytesPerScanLine = %d\n", ModeInformation->BytesPerScanLine);
505 TRACE("WidthInPixels = %d\n", ModeInformation->WidthInPixels);
506 TRACE("HeightInPixels = %d\n", ModeInformation->HeightInPixels);
507 TRACE("CharacterWidthInPixels = %d\n", ModeInformation->CharacterWidthInPixels);
508 TRACE("CharacterHeightInPixels = %d\n", ModeInformation->CharacterHeightInPixels);
509 TRACE("NumberOfMemoryPlanes = %d\n", ModeInformation->NumberOfMemoryPlanes);
510 TRACE("BitsPerPixel = %d\n", ModeInformation->BitsPerPixel);
511 TRACE("NumberOfBanks = %d\n", ModeInformation->NumberOfBanks);
512 TRACE("MemoryModel = %d\n", ModeInformation->MemoryModel);
513 TRACE("BankSize = %d\n", ModeInformation->BankSize);
514 TRACE("NumberOfImagePlanes = %d\n", ModeInformation->NumberOfImagePanes);
515 TRACE("---VBE v1.2+ ---\n");
516 TRACE("RedMaskSize = %d\n", ModeInformation->RedMaskSize);
517 TRACE("RedMaskPosition = %d\n", ModeInformation->RedMaskPosition);
518 TRACE("GreenMaskSize = %d\n", ModeInformation->GreenMaskSize);
519 TRACE("GreenMaskPosition = %d\n", ModeInformation->GreenMaskPosition);
520 TRACE("BlueMaskSize = %d\n", ModeInformation->BlueMaskSize);
521 TRACE("BlueMaskPosition = %d\n", ModeInformation->BlueMaskPosition);
522 TRACE("ReservedMaskSize = %d\n", ModeInformation->ReservedMaskSize);
523 TRACE("ReservedMaskPosition = %d\n", ModeInformation->ReservedMaskPosition);
524 TRACE("\n");
525
526 return TRUE;
527}
UCHAR ReservedMaskPosition
Definition: pcvideo.c:86
UCHAR GreenMaskPosition
Definition: pcvideo.c:82
UCHAR BlueMaskPosition
Definition: pcvideo.c:84
USHORT WindowAStartSegment
Definition: pcvideo.c:62
UCHAR CharacterHeightInPixels
Definition: pcvideo.c:70
UCHAR NumberOfMemoryPlanes
Definition: pcvideo.c:71
UCHAR WindowsAttributesB
Definition: pcvideo.c:59
UCHAR WindowAttributesA
Definition: pcvideo.c:58
ULONG WindowPositioningFunction
Definition: pcvideo.c:64
UCHAR CharacterWidthInPixels
Definition: pcvideo.c:69
USHORT WindowBStartSegment
Definition: pcvideo.c:63
UCHAR ReservedMaskSize
Definition: pcvideo.c:85
UCHAR NumberOfImagePanes
Definition: pcvideo.c:76
USHORT ModeAttributes
Definition: pcvideo.c:57
unsigned short di
Definition: pcbios.h:119
unsigned short cx
Definition: pcbios.h:115
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define BIOSCALLBUFSEGMENT
Definition: x86common.h:24
#define BIOSCALLBUFOFFSET
Definition: x86common.h:25
#define BIOSCALLBUFFER
Definition: x86common.h:12

Referenced by PcVideoSetMode().

Variable Documentation

◆ BiosVideoMode

USHORT BiosVideoMode
static

Definition at line 113 of file pcvideo.c.

Referenced by PcVideoSetMode().

◆ BytesPerScanLine

ULONG BytesPerScanLine = 160
static

Definition at line 116 of file pcvideo.c.

Referenced by PcVideoGetBufferSize(), PcVideoPutChar(), and PcVideoSetMode().

◆ CurrentMemoryBank

ULONG CurrentMemoryBank = 0
static

Definition at line 120 of file pcvideo.c.

Referenced by PcVideoSetMemoryBank(), and PcVideoSetMode().

◆ DisplayMode

◆ MachDefaultTextColor

UCHAR MachDefaultTextColor = COLOR_GRAY

Definition at line 111 of file pcvideo.c.

◆ ScreenHeight

◆ ScreenWidth

◆ VesaVideoMode

BOOLEAN VesaVideoMode = FALSE
static

◆ VesaVideoModeInformation

SVGA_MODE_INFORMATION VesaVideoModeInformation
static