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 159 Int386(0x10, &Regs, &Regs);
162 if (0x10 == Regs.
b.
bl)
198 Int386(0x10, &Regs, &Regs);
200 if (0x1a == Regs.
b.
al)
228 Int386(0x10, &Regs, &Regs);
246 Int386(0x10, &Regs, &Regs);
264 Int386(0x10, &Regs, &Regs);
288 Int386(0x10, &Regs, &Regs);
313 Int386(0x10, &Regs, &Regs);
347 Regs.
b.
ch = StartScanLine;
348 Regs.
b.
cl = EndScanLine;
349 Int386(0x10, &Regs, &Regs);
375 Regs.
b.
al = VerticalResolutionMode;
376 Int386(0x10, &Regs, &Regs);
486 Int386(0x10, &Regs, &Regs);
488 if (Regs.
w.
ax != 0x004F)
496 TRACE(
"BiosVesaGetSVGAModeInformation() mode 0x%x\n",
Mode);
516 TRACE(
"---VBE v1.2+ ---\n");
592 Int386(0x10, &Regs, &Regs);
594 if (0x004F != Regs.
w.
ax)
764 else if (0x13 == NewMode)
776 else if (0x0108 <= NewMode && NewMode <= 0x010C)
846 Int386(0x10, &Regs, &Regs);
877 Regs.
w.
dx = BankNumber;
878 Int386(0x10, &Regs, &Regs);
880 if (0x004F == Regs.
w.
ax)
892 if (
NULL == DisplayModeName ||
'\0' == *DisplayModeName)
900 TRACE(
"CGA or other display adapter detected.\n");
901 printf(
"CGA or other display adapter detected.\n");
902 printf(
"Using 80x25 text mode.\n");
907 TRACE(
"EGA display adapter detected.\n");
908 printf(
"EGA display adapter detected.\n");
909 printf(
"Using 80x25 text mode.\n");
914 TRACE(
"VGA display adapter detected.\n");
916 if (0 ==
_stricmp(DisplayModeName,
"NORMAL_VGA"))
920 else if (0 ==
_stricmp(DisplayModeName,
"EXTENDED_VGA"))
932 printf(
"Error: unable to set video display mode 0x%x\n", (
int)
VideoMode);
933 printf(
"Defaulting to 80x25 text mode.\n");
934 printf(
"Press any key to continue.\n");
983 BiosRegs.
d.
eax = 0x1130;
985 Int386(0x10, &BiosRegs, &BiosRegs);
989 Int386(0x10, &BiosRegs, &BiosRegs);
993 Int386(0x10, &BiosRegs, &BiosRegs);
997 Int386(0x10, &BiosRegs, &BiosRegs);
1001 Int386(0x10, &BiosRegs, &BiosRegs);
1005 Int386(0x10, &BiosRegs, &BiosRegs);
1031 Int386(0x10, &Regs, &Regs);
1051 ULONG BytesInLastBank;
1071 for (CurrentBank = 0; CurrentBank < BanksToCopy; CurrentBank++)
1094 AttrChar = ((
USHORT) Attr << 8) |
' ';
1110 *BufPtr = ((
USHORT) Attr << 8) | (
Ch & 0xff);
static VOID PcVideoSetFont8x14(VOID)
#define VIDEOTEXT_MEM_SIZE
#define VIDEOCARD_CGA_OR_OTHER
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
UINT32 strtoul(const char *String, char **Terminator, UINT32 Base)
static BOOLEAN PcVideoSetMode80x50_80x43(VOID)
VOID PcVideoGetFontsFromFirmware(PULONG RomFontPointers)
static BOOLEAN PcVideoSetMode(USHORT NewMode)
struct SVGA_MODE_INFORMATION * PSVGA_MODE_INFORMATION
VOID NTAPI WRITE_PORT_USHORT(IN PUSHORT Port, IN USHORT Value)
static BOOLEAN PcVideoSetMode80x43(VOID)
#define READ_PORT_UCHAR(p)
#define VIDEOMODE_EXTENDED_TEXT
#define VIDEOMODE_NORMAL_TEXT
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
#define VIDEOPORT_PALETTE_READ
static SVGA_MODE_INFORMATION VesaVideoModeInformation
static USHORT BiosVideoMode
static BOOLEAN PcVideoSetMode80x25(VOID)
static BOOLEAN VesaVideoMode
static ULONG ScreenHeight
static ULONG BytesPerScanLine
#define VIDEOVGA_MEM_ADDRESS
static VOID PcVideoSetDisplayEnd(VOID)
int __cdecl Int386(int ivec, REGS *in, REGS *out)
#define VIDEOTEXT_MEM_ADDRESS
#define __WARNING_DEREF_NULL_PTR
#define BIOSCALLBUFSEGMENT
VOID PcVideoHideShowTextCursor(BOOLEAN Show)
VOID PcVideoSetTextCursorPosition(UCHAR X, UCHAR Y)
VOID PcVideoClearScreen(UCHAR Attr)
static VOID PcVideoSelectAlternatePrintScreen(VOID)
static VOID PcVideoSetBlinkBit(BOOLEAN Enable)
static ULONG CurrentMemoryBank
static VOID PcVideoSetMemoryBank(USHORT BankNumber)
static BOOLEAN PcVideoVesaGetSVGAModeInformation(USHORT Mode, PSVGA_MODE_INFORMATION ModeInformation)
struct _VideoMode VideoMode
static BOOLEAN PcVideoSetBiosVesaMode(USHORT Mode)
VIDEODISPLAYMODE PcVideoSetDisplayMode(char *DisplayModeName, BOOLEAN Init)
BOOLEAN PcVideoIsPaletteFixed(VOID)
VOID PcVideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
static ULONG PcVideoDetectVideoCard(VOID)
#define BIOSCALLBUFOFFSET
static BOOLEAN PcVideoSetMode80x30(VOID)
static VIDEODISPLAYMODE DisplayMode
static BOOLEAN PcVideoSetMode80x28(VOID)
#define VIDEOPORT_VERTICAL_RETRACE
#define VERTRES_350_SCANLINES
static VOID PcVideoSetVerticalResolution(UCHAR VerticalResolutionMode)
#define WRITE_PORT_UCHAR(p, d)
static BOOLEAN PcVideoSetMode80x34(VOID)
enum tagVIDEODISPLAYMODE VIDEODISPLAYMODE
VOID PcVideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y)
VOID PcVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth)
UCHAR MachDefaultTextColor
static VOID PcVideoDisableCursorEmulation(VOID)
#define VIDEOPORT_PALETTE_WRITE
static VOID PcVideoDefineCursor(UCHAR StartScanLine, UCHAR EndScanLine)
static VOID PcVideoSetFont8x8(VOID)
static VOID PcVideoSetBiosMode(UCHAR VideoMode)
VOID PcVideoPrepareForReactOS(VOID)
static VOID PcVideoSet480ScanLines(VOID)
VOID PcVideoCopyOffScreenBufferToVRAM(PVOID Buffer)
VOID PcVideoGetPaletteColor(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
#define VIDEOPORT_PALETTE_DATA
#define RtlZeroMemory(Destination, Length)
#define RtlCopyMemory(Destination, Source, Length)
ULONG PcVideoGetBufferSize(VOID)
static BOOLEAN PcVideoSetMode80x60(VOID)
#define _PRAGMA_WARNING_SUPPRESS(x)