diff --git a/boot/freeldr/freeldr/arch/i386/pc/machpc.c b/boot/freeldr/freeldr/arch/i386/pc/machpc.c index d280dcbb12e..a8082ed79a4 100644 --- a/boot/freeldr/freeldr/arch/i386/pc/machpc.c +++ b/boot/freeldr/freeldr/arch/i386/pc/machpc.c @@ -1807,6 +1807,7 @@ MachInit(const char *CmdLine) MachVtbl.HwIdle = PcHwIdle; HalpCalibrateStallExecution(); + PcVideoInit(); } VOID diff --git a/boot/freeldr/freeldr/arch/i386/pc/pcvideo.c b/boot/freeldr/freeldr/arch/i386/pc/pcvideo.c index 404b4614711..c85ad112bf8 100644 --- a/boot/freeldr/freeldr/arch/i386/pc/pcvideo.c +++ b/boot/freeldr/freeldr/arch/i386/pc/pcvideo.c @@ -110,6 +110,7 @@ typedef struct UCHAR MachDefaultTextColor = COLOR_GRAY; +static ULONG VideoCard = VIDEOCARD_CGA_OR_OTHER; /* Type of video card installed on the system */ static USHORT BiosVideoMode; /* Current video mode as known by BIOS */ static ULONG ScreenWidth = 80; /* Screen Width in characters */ static ULONG ScreenHeight = 25; /* Screen Height in characters */ @@ -587,7 +588,7 @@ PcVideoSetMode80x25(VOID) static BOOLEAN PcVideoSetMode80x50_80x43(VOID) { - if (VIDEOCARD_VGA == PcVideoDetectVideoCard()) + if (VideoCard == VIDEOCARD_VGA) { PcVideoSetBiosMode(0x03); PcVideoSetFont8x8(); @@ -597,7 +598,7 @@ PcVideoSetMode80x50_80x43(VOID) ScreenWidth = 80; ScreenHeight = 50; } - else if (VIDEOCARD_EGA == PcVideoDetectVideoCard()) + else if (VideoCard == VIDEOCARD_EGA) { PcVideoSetBiosMode(0x03); PcVideoSetFont8x8(); @@ -843,6 +844,13 @@ PcVideoSetMemoryBank(USHORT BankNumber) CurrentMemoryBank = BankNumber; } +VOID +PcVideoInit(VOID) +{ + /* Detect the installed video card */ + VideoCard = PcVideoDetectVideoCard(); +} + VIDEODISPLAYMODE PcVideoSetDisplayMode(PCSTR DisplayModeName, BOOLEAN Init) { @@ -854,21 +862,21 @@ PcVideoSetDisplayMode(PCSTR DisplayModeName, BOOLEAN Init) return DisplayMode; } - if (VIDEOCARD_CGA_OR_OTHER == PcVideoDetectVideoCard()) + if (VideoCard == VIDEOCARD_CGA_OR_OTHER) { TRACE("CGA or other display adapter detected.\n"); printf("CGA or other display adapter detected.\n"); printf("Using 80x25 text mode.\n"); VideoMode = VIDEOMODE_NORMAL_TEXT; } - else if (VIDEOCARD_EGA == PcVideoDetectVideoCard()) + else if (VideoCard == VIDEOCARD_EGA) { TRACE("EGA display adapter detected.\n"); printf("EGA display adapter detected.\n"); printf("Using 80x25 text mode.\n"); VideoMode = VIDEOMODE_NORMAL_TEXT; } - else /* if (VIDEOCARD_VGA == PcVideoDetectVideoCard()) */ + else /* VIDEOCARD_VGA */ { TRACE("VGA display adapter detected.\n"); diff --git a/boot/freeldr/freeldr/include/arch/pc/machpc.h b/boot/freeldr/freeldr/include/arch/pc/machpc.h index 5432266dd1a..79efbf7efdb 100644 --- a/boot/freeldr/freeldr/include/arch/pc/machpc.h +++ b/boot/freeldr/freeldr/include/arch/pc/machpc.h @@ -30,6 +30,7 @@ VOID PcConsPutChar(int Ch); BOOLEAN PcConsKbHit(VOID); int PcConsGetCh(VOID); +VOID PcVideoInit(VOID); VOID PcVideoClearScreen(UCHAR Attr); VIDEODISPLAYMODE PcVideoSetDisplayMode(PCSTR DisplayMode, BOOLEAN Init); VOID PcVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth);