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
50#define VERTRES_200_SCANLINES 0x00
51#define VERTRES_350_SCANLINES 0x01
52#define VERTRES_400_SCANLINES 0x02
161 Int386(0x10, &Regs, &Regs);
164 if (Regs.
b.
bl == 0x10)
197 Int386(0x10, &Regs, &Regs);
199 if (Regs.
b.
al == 0x1a)
235 Int386(0x10, &Regs, &Regs);
237 if (Regs.
w.
ax != 0x004F)
243 TRACE(
"BiosVesaGetSVGAModeInformation(Mode 0x%x)\n",
Mode);
244 TRACE(
"ModeAttributes = 0x%04x\n", ModeInformation->ModeAttributes);
245 TRACE(
"WindowAttributesA = 0x%02x\n", ModeInformation->WindowAttributesA);
246 TRACE(
"WindowAttributesB = 0x%02x\n", ModeInformation->WindowsAttributesB);
247 TRACE(
"WindowGranularity = %huKB\n", ModeInformation->WindowGranularity);
248 TRACE(
"WindowSize = %huKB\n", ModeInformation->WindowSize);
249 TRACE(
"WindowAStartSegment = 0x%04x\n", ModeInformation->WindowAStartSegment);
250 TRACE(
"WindowBStartSegment = 0x%04x\n", ModeInformation->WindowBStartSegment);
251 TRACE(
"WindowPositioningFunction = 0x%x\n", ModeInformation->WindowPositioningFunction);
252 TRACE(
"BytesPerScanLine = %hu\n", ModeInformation->BytesPerScanLine);
253 TRACE(
"WidthInPixels = %hu\n", ModeInformation->WidthInPixels);
254 TRACE(
"HeightInPixels = %hu\n", ModeInformation->HeightInPixels);
255 TRACE(
"CharacterWidthInPixels = %u\n", ModeInformation->CharacterWidthInPixels);
256 TRACE(
"CharacterHeightInPixels = %u\n", ModeInformation->CharacterHeightInPixels);
257 TRACE(
"NumberOfMemoryPlanes = %u\n", ModeInformation->NumberOfMemoryPlanes);
258 TRACE(
"BitsPerPixel = %u\n", ModeInformation->BitsPerPixel);
259 TRACE(
"NumberOfBanks = %u\n", ModeInformation->NumberOfBanks);
260 TRACE(
"MemoryModel = %u\n", ModeInformation->MemoryModel);
261 TRACE(
"BankSize = %u\n", ModeInformation->BankSize);
262 TRACE(
"NumberOfImagePanes = %u\n", ModeInformation->NumberOfImagePanes);
263 TRACE(
"Reserved1 = 0x%02x\n", ModeInformation->Reserved1);
264 TRACE(
"---VBE v1.2+ ---\n");
265 TRACE(
"RedMaskSize = %u\n", ModeInformation->RedMaskSize);
266 TRACE(
"RedMaskPosition = %u\n", ModeInformation->RedMaskPosition);
267 TRACE(
"GreenMaskSize = %u\n", ModeInformation->GreenMaskSize);
268 TRACE(
"GreenMaskPosition = %u\n", ModeInformation->GreenMaskPosition);
269 TRACE(
"BlueMaskSize = %u\n", ModeInformation->BlueMaskSize);
270 TRACE(
"BlueMaskPosition = %u\n", ModeInformation->BlueMaskPosition);
271 TRACE(
"ReservedMaskSize = %u\n", ModeInformation->ReservedMaskSize);
272 TRACE(
"ReservedMaskPosition = %u\n", ModeInformation->ReservedMaskPosition);
273 TRACE(
"DirectColorModeInfo = 0x%02x\n", ModeInformation->DirectColorModeInfo);
274 TRACE(
"---VBE v2.0+ ---\n");
275 TRACE(
"LinearVideoBufferAddress = 0x%x\n", ModeInformation->LinearVideoBufferAddress);
276 TRACE(
"OffscreenMemoryPointer = 0x%x\n", ModeInformation->OffscreenMemoryPointer);
277 TRACE(
"OffscreenMemorySize = %huKB\n", ModeInformation->OffscreenMemorySize);
278 TRACE(
"---VBE v3.0 ---\n");
279 TRACE(
"LinearBytesPerScanLine = %hu\n", ModeInformation->LinearBytesPerScanLine);
280 TRACE(
"BankedNumberOfImages = %u\n", ModeInformation->BankedNumberOfImages);
281 TRACE(
"LinearNumberOfImages = %u\n", ModeInformation->LinearNumberOfImages);
282 TRACE(
"LinearRedMaskSize = %u\n", ModeInformation->LinearRedMaskSize);
283 TRACE(
"LinearRedMaskPosition = %u\n", ModeInformation->LinearRedMaskPosition);
284 TRACE(
"LinearGreenMaskSize = %u\n", ModeInformation->LinearGreenMaskSize);
285 TRACE(
"LinearGreenMaskPosition = %u\n", ModeInformation->LinearGreenMaskPosition);
286 TRACE(
"LinearBlueMaskSize = %u\n", ModeInformation->LinearBlueMaskSize);
287 TRACE(
"LinearBlueMaskPosition = %u\n", ModeInformation->LinearBlueMaskPosition);
288 TRACE(
"LinearReservedMaskSize = %u\n", ModeInformation->LinearReservedMaskSize);
289 TRACE(
"LinearReservedMaskPosition = %u\n", ModeInformation->LinearReservedMaskPosition);
290 TRACE(
"MaximumPixelClock = %luHz\n", ModeInformation->MaximumPixelClock);
323 Int386(0x10, &Regs, &Regs);
325 if (Regs.
w.
ax != 0x004F)
370 Int386(0x10, &Regs, &Regs);
388 TRACE(
"VESA mode detected\n");
408 TRACE(
"BIOS mode detected\n");
447 TRACE(
"Fallback mode detected\n");
526 Int386(0x10, &Regs, &Regs);
527 return (Regs.
w.
ax == 0x004F);
549 Int386(0x10, &Regs, &Regs);
567 Int386(0x10, &Regs, &Regs);
585 Int386(0x10, &Regs, &Regs);
609 Int386(0x10, &Regs, &Regs);
634 Int386(0x10, &Regs, &Regs);
668 Regs.
b.
ch = StartScanLine;
669 Regs.
b.
cl = EndScanLine;
670 Int386(0x10, &Regs, &Regs);
696 Regs.
b.
al = VerticalResolutionMode;
697 Int386(0x10, &Regs, &Regs);
924 else if (NewMode == 0x13)
980 Int386(0x10, &Regs, &Regs);
1012 Regs.
w.
dx = BankNumber;
1013 Int386(0x10, &Regs, &Regs);
1015 if (Regs.
w.
ax == 0x004F)
1038#define TRACE_printf(Format, ...) \
1040 TRACE(Format, ##__VA_ARGS__); \
1041 printf(Format, ##__VA_ARGS__); \
1049 if (!DisplayModeName || *DisplayModeName ==
'\0')
1054 TRACE_printf(
"CGA or other display adapter detected.\n");
1069 size_t NameLen =
strcspn(DisplayModeName,
",");
1073 if (
_strnicmp(DisplayModeName,
"NORMAL_VGA", NameLen) == 0)
1075 else if (
_strnicmp(DisplayModeName,
"EXTENDED_VGA", NameLen) == 0)
1085 printf(
"Press any key to continue.\n");
1134 BiosRegs.
d.
eax = 0x1130;
1136 Int386(0x10, &BiosRegs, &BiosRegs);
1140 Int386(0x10, &BiosRegs, &BiosRegs);
1144 Int386(0x10, &BiosRegs, &BiosRegs);
1148 Int386(0x10, &BiosRegs, &BiosRegs);
1152 Int386(0x10, &BiosRegs, &BiosRegs);
1156 Int386(0x10, &BiosRegs, &BiosRegs);
1182 Int386(0x10, &Regs, &Regs);
1198 ULONG BytesInLastBank;
1218 for (CurrentBank = 0; CurrentBank < BanksToCopy; CurrentBank++)
1241 AttrChar = ((
USHORT)Attr << 8) |
' ';
1257 *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
static BOOLEAN PcVideoGetBiosMode(_Out_ PUSHORT Mode)
#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)
#define VERTRES_200_SCANLINES
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)
#define VERTRES_400_SCANLINES
static BOOLEAN PcVideoSetMode80x28(VOID)
VOID PcVideoCopyOffScreenBufferToVRAM(PVOID Buffer)
static BOOLEAN PcVideoVesaGetCurrentSVGAMode(_Out_ PUSHORT Mode)
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