25#define VIDEOPORT_PALETTE_READ 0x03C7
26#define VIDEOPORT_PALETTE_WRITE 0x03C8
27#define VIDEOPORT_PALETTE_DATA 0x03C9
28#define VIDEOPORT_VERTICAL_RETRACE 0x03DA
30#define VIDEOVGA_MEM_ADDRESS 0xA0000
31#define VIDEOTEXT_MEM_ADDRESS 0xB8000
32#define VIDEOTEXT_MEM_SIZE 0x8000
34#define VIDEOCARD_CGA_OR_OTHER 0
35#define VIDEOCARD_EGA 1
36#define VIDEOCARD_VGA 2
38#define VIDEOMODE_NORMAL_TEXT 0
39#define VIDEOMODE_EXTENDED_TEXT 1
40#define VIDEOMODE_80X28 0x501C
41#define VIDEOMODE_80X30 0x501E
42#define VIDEOMODE_80X34 0x5022
43#define VIDEOMODE_80X43 0x502B
44#define VIDEOMODE_80X60 0x503C
45#define VIDEOMODE_132X25 0x8419
46#define VIDEOMODE_132X43 0x842B
47#define VIDEOMODE_132X50 0x8432
48#define VIDEOMODE_132X60 0x843C
51#define VERTRES_200_SCANLINES 0x00
52#define VERTRES_350_SCANLINES 0x01
53#define VERTRES_400_SCANLINES 0x02
54#define VERTRES_480_SCANLINES 0x03
163 Int386(0x10, &Regs, &Regs);
166 if (Regs.
b.
bl == 0x10)
199 Int386(0x10, &Regs, &Regs);
201 if (Regs.
b.
al == 0x1a)
237 Int386(0x10, &Regs, &Regs);
239 if (Regs.
w.
ax != 0x004F)
245 TRACE(
"BiosVesaGetSVGAModeInformation(Mode 0x%x)\n",
Mode);
246 TRACE(
"ModeAttributes = 0x%04x\n", ModeInformation->ModeAttributes);
247 TRACE(
"WindowAttributesA = 0x%02x\n", ModeInformation->WindowAttributesA);
248 TRACE(
"WindowAttributesB = 0x%02x\n", ModeInformation->WindowsAttributesB);
249 TRACE(
"WindowGranularity = %huKB\n", ModeInformation->WindowGranularity);
250 TRACE(
"WindowSize = %huKB\n", ModeInformation->WindowSize);
251 TRACE(
"WindowAStartSegment = 0x%04x\n", ModeInformation->WindowAStartSegment);
252 TRACE(
"WindowBStartSegment = 0x%04x\n", ModeInformation->WindowBStartSegment);
253 TRACE(
"WindowPositioningFunction = 0x%x\n", ModeInformation->WindowPositioningFunction);
254 TRACE(
"BytesPerScanLine = %hu\n", ModeInformation->BytesPerScanLine);
255 TRACE(
"WidthInPixels = %hu\n", ModeInformation->WidthInPixels);
256 TRACE(
"HeightInPixels = %hu\n", ModeInformation->HeightInPixels);
257 TRACE(
"CharacterWidthInPixels = %u\n", ModeInformation->CharacterWidthInPixels);
258 TRACE(
"CharacterHeightInPixels = %u\n", ModeInformation->CharacterHeightInPixels);
259 TRACE(
"NumberOfMemoryPlanes = %u\n", ModeInformation->NumberOfMemoryPlanes);
260 TRACE(
"BitsPerPixel = %u\n", ModeInformation->BitsPerPixel);
261 TRACE(
"NumberOfBanks = %u\n", ModeInformation->NumberOfBanks);
262 TRACE(
"MemoryModel = %u\n", ModeInformation->MemoryModel);
263 TRACE(
"BankSize = %u\n", ModeInformation->BankSize);
264 TRACE(
"NumberOfImagePanes = %u\n", ModeInformation->NumberOfImagePanes);
265 TRACE(
"Reserved1 = 0x%02x\n", ModeInformation->Reserved1);
266 TRACE(
"---VBE v1.2+ ---\n");
267 TRACE(
"RedMaskSize = %u\n", ModeInformation->RedMaskSize);
268 TRACE(
"RedMaskPosition = %u\n", ModeInformation->RedMaskPosition);
269 TRACE(
"GreenMaskSize = %u\n", ModeInformation->GreenMaskSize);
270 TRACE(
"GreenMaskPosition = %u\n", ModeInformation->GreenMaskPosition);
271 TRACE(
"BlueMaskSize = %u\n", ModeInformation->BlueMaskSize);
272 TRACE(
"BlueMaskPosition = %u\n", ModeInformation->BlueMaskPosition);
273 TRACE(
"ReservedMaskSize = %u\n", ModeInformation->ReservedMaskSize);
274 TRACE(
"ReservedMaskPosition = %u\n", ModeInformation->ReservedMaskPosition);
275 TRACE(
"DirectColorModeInfo = 0x%02x\n", ModeInformation->DirectColorModeInfo);
276 TRACE(
"---VBE v2.0+ ---\n");
277 TRACE(
"LinearVideoBufferAddress = 0x%x\n", ModeInformation->LinearVideoBufferAddress);
278 TRACE(
"OffscreenMemoryPointer = 0x%x\n", ModeInformation->OffscreenMemoryPointer);
279 TRACE(
"OffscreenMemorySize = %huKB\n", ModeInformation->OffscreenMemorySize);
280 TRACE(
"---VBE v3.0 ---\n");
281 TRACE(
"LinearBytesPerScanLine = %hu\n", ModeInformation->LinearBytesPerScanLine);
282 TRACE(
"BankedNumberOfImages = %u\n", ModeInformation->BankedNumberOfImages);
283 TRACE(
"LinearNumberOfImages = %u\n", ModeInformation->LinearNumberOfImages);
284 TRACE(
"LinearRedMaskSize = %u\n", ModeInformation->LinearRedMaskSize);
285 TRACE(
"LinearRedMaskPosition = %u\n", ModeInformation->LinearRedMaskPosition);
286 TRACE(
"LinearGreenMaskSize = %u\n", ModeInformation->LinearGreenMaskSize);
287 TRACE(
"LinearGreenMaskPosition = %u\n", ModeInformation->LinearGreenMaskPosition);
288 TRACE(
"LinearBlueMaskSize = %u\n", ModeInformation->LinearBlueMaskSize);
289 TRACE(
"LinearBlueMaskPosition = %u\n", ModeInformation->LinearBlueMaskPosition);
290 TRACE(
"LinearReservedMaskSize = %u\n", ModeInformation->LinearReservedMaskSize);
291 TRACE(
"LinearReservedMaskPosition = %u\n", ModeInformation->LinearReservedMaskPosition);
292 TRACE(
"MaximumPixelClock = %luHz\n", ModeInformation->MaximumPixelClock);
325 Int386(0x10, &Regs, &Regs);
327 if (Regs.
w.
ax != 0x004F)
373 Int386(0x10, &Regs, &Regs);
379 *WidthInChars = Regs.
b.
ah;
393 TRACE(
"VESA mode detected\n");
413 TRACE(
"BIOS mode detected\n");
426 TRACE(
"Fallback mode detected\n");
505 Int386(0x10, &Regs, &Regs);
506 return (Regs.
w.
ax == 0x004F);
528 Int386(0x10, &Regs, &Regs);
546 Int386(0x10, &Regs, &Regs);
564 Int386(0x10, &Regs, &Regs);
588 Int386(0x10, &Regs, &Regs);
613 Int386(0x10, &Regs, &Regs);
647 Regs.
b.
ch = StartScanLine;
648 Regs.
b.
cl = EndScanLine;
649 Int386(0x10, &Regs, &Regs);
675 Regs.
b.
al = VerticalResolutionMode;
676 Int386(0x10, &Regs, &Regs);
908 else if (NewMode == 0x13)
960 Int386(0x10, &Regs, &Regs);
992 Regs.
w.
dx = BankNumber;
993 Int386(0x10, &Regs, &Regs);
995 if (Regs.
w.
ax == 0x004F)
1018#define TRACE_printf(Format, ...) \
1020 TRACE(Format, ##__VA_ARGS__); \
1021 printf(Format, ##__VA_ARGS__); \
1029 if (!DisplayModeName || *DisplayModeName ==
'\0')
1034 TRACE_printf(
"CGA or other display adapter detected.\n");
1049 size_t NameLen =
strcspn(DisplayModeName,
",");
1053 if (
_strnicmp(DisplayModeName,
"NORMAL_VGA", NameLen) == 0)
1055 else if (
_strnicmp(DisplayModeName,
"EXTENDED_VGA", NameLen) == 0)
1065 printf(
"Press any key to continue.\n");
1114 BiosRegs.
d.
eax = 0x1130;
1116 Int386(0x10, &BiosRegs, &BiosRegs);
1120 Int386(0x10, &BiosRegs, &BiosRegs);
1124 Int386(0x10, &BiosRegs, &BiosRegs);
1128 Int386(0x10, &BiosRegs, &BiosRegs);
1132 Int386(0x10, &BiosRegs, &BiosRegs);
1136 Int386(0x10, &BiosRegs, &BiosRegs);
1162 Int386(0x10, &Regs, &Regs);
1178 ULONG BytesInLastBank;
1198 for (CurrentBank = 0; CurrentBank < BanksToCopy; CurrentBank++)
1221 AttrChar = ((
USHORT)Attr << 8) |
' ';
1237 *BufPtr = ((
USHORT)Attr << 8) | (
Ch & 0xff);
#define DBG_DEFAULT_CHANNEL(ch)
enum tagVIDEODISPLAYMODE VIDEODISPLAYMODE
struct _VideoMode VideoMode
#define _strnicmp(_String1, _String2, _MaxCount)
_ACRTIMP __msvcrt_ulong __cdecl strtoul(const char *, char **, int)
_ACRTIMP size_t __cdecl strcspn(const char *, const char *)
VOID NTAPI WRITE_PORT_USHORT(IN PUSHORT Port, IN USHORT Value)
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
#define READ_PORT_UCHAR(p)
#define WRITE_PORT_UCHAR(p, d)
int __cdecl Int386(int ivec, REGS *in, REGS *out)
#define VIDEOPORT_PALETTE_WRITE
#define VIDEOCARD_CGA_OR_OTHER
VOID PcVideoSetTextCursorPosition(UCHAR X, UCHAR Y)
static SVGA_MODE_INFORMATION VesaVideoModeInformation
VOID PcVideoPrepareForReactOS(VOID)
struct SVGA_MODE_INFORMATION * PSVGA_MODE_INFORMATION
static BOOLEAN PcVideoSetMode80x34(VOID)
#define VIDEOTEXT_MEM_ADDRESS
BOOLEAN PcVideoIsPaletteFixed(VOID)
#define TRACE_printf(Format,...)
static VOID PcVideoDisableCursorEmulation(VOID)
VOID PcVideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
static BOOLEAN PcVideoSetMode80x25(VOID)
#define VIDEOPORT_PALETTE_READ
static VOID PcVideoSetFont8x8(VOID)
#define VIDEOPORT_PALETTE_DATA
static ULONG ScreenHeight
static ULONG PcVideoDetectVideoCard(VOID)
static ULONG CurrentMemoryBank
static VIDEODISPLAYMODE DisplayMode
static VOID PcVideoSetVerticalResolution(UCHAR VerticalResolutionMode)
VOID PcVideoGetFontsFromFirmware(PULONG RomFontPointers)
#define VIDEOTEXT_MEM_SIZE
#define VIDEOMODE_NORMAL_TEXT
static VOID PcVideoSetDisplayEnd(VOID)
static ULONG BytesPerScanLine
static BOOLEAN PcVideoSetMode80x60(VOID)
static VOID PcVideoSet480ScanLines(VOID)
static BOOLEAN PcVideoSetMode80x30(VOID)
#define VIDEOPORT_VERTICAL_RETRACE
static BOOLEAN PcVideoSetMode(USHORT NewMode)
#define VIDEOMODE_EXTENDED_TEXT
static VOID PcVideoDefineCursor(UCHAR StartScanLine, UCHAR EndScanLine)
UCHAR MachDefaultTextColor
static VOID PcVideoSetBiosMode(UCHAR VideoMode)
static BOOLEAN PcVideoVesaGetSVGAModeInformation(_In_ USHORT Mode, _Out_ PSVGA_MODE_INFORMATION ModeInformation)
static BOOLEAN PcVideoSetMode80x43(VOID)
static VOID PcVideoSetFont8x14(VOID)
#define VIDEOVGA_MEM_ADDRESS
static BOOLEAN VesaVideoMode
static VOID PcVideoSetMemoryBank(USHORT BankNumber)
static BOOLEAN PcVideoSetBiosVesaMode(USHORT Mode)
VOID PcVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth)
static VOID PcVideoSelectAlternatePrintScreen(VOID)
#define VERTRES_350_SCANLINES
VOID PcVideoGetPaletteColor(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
VIDEODISPLAYMODE PcVideoSetDisplayMode(PCSTR DisplayModeName, BOOLEAN Init)
static BOOLEAN PcVideoSetMode80x50_80x43(VOID)
ULONG PcVideoGetBufferSize(VOID)
VOID PcVideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y)
static VOID PcVideoGetDisplayMode(VOID)
VOID PcVideoClearScreen(UCHAR Attr)
static BOOLEAN PcVideoSetMode80x28(VOID)
VOID PcVideoCopyOffScreenBufferToVRAM(PVOID Buffer)
static BOOLEAN PcVideoVesaGetCurrentSVGAMode(_Out_ PUSHORT Mode)
static BOOLEAN PcVideoGetBiosMode(_Out_ PUSHORT Mode, _Out_ PUSHORT WidthInChars)
static VOID PcVideoSetBlinkBit(BOOLEAN Enable)
VOID PcVideoHideShowTextCursor(BOOLEAN Show)
static USHORT BiosVideoMode
#define __WARNING_DEREF_NULL_PTR
#define _PRAGMA_WARNING_SUPPRESS(x)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
_In_ HFONT _Out_ PUINT Height
#define BIOSCALLBUFSEGMENT
#define BIOSCALLBUFOFFSET
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth