[FREELDR:PC] pcvideo.c!PcVideoSetMode(): deduplicate VESA mode setting code (#8508)

Group VESA text/graphics modes setting together.
This commit is contained in:
Hermès Bélusca-Maïto
2025-12-18 16:03:00 +01:00
parent b050a4544e
commit f7aa25044e

View File

@@ -933,27 +933,9 @@ PcVideoSetMode(USHORT NewMode)
return TRUE;
}
else if (0x0108 <= NewMode && NewMode <= 0x010C)
{
/* VESA Text Mode */
if (!PcVideoVesaGetSVGAModeInformation(NewMode, &VesaVideoModeInformation))
return FALSE;
if (!PcVideoSetBiosVesaMode(NewMode))
return FALSE;
ScreenWidth = VesaVideoModeInformation.WidthInPixels;
ScreenHeight = VesaVideoModeInformation.HeightInPixels;
BytesPerScanLine = VesaVideoModeInformation.BytesPerScanLine;
BiosVideoMode = NewMode;
DisplayMode = VideoTextMode;
VesaVideoMode = TRUE;
return TRUE;
}
else
{
/* VESA Graphics Mode */
/* VESA Text/Graphics Mode */
if (!PcVideoVesaGetSVGAModeInformation(NewMode, &VesaVideoModeInformation))
return FALSE;
@@ -964,7 +946,7 @@ PcVideoSetMode(USHORT NewMode)
ScreenHeight = VesaVideoModeInformation.HeightInPixels;
BytesPerScanLine = VesaVideoModeInformation.BytesPerScanLine;
BiosVideoMode = NewMode;
DisplayMode = VideoGraphicsMode;
DisplayMode = (0x0108 <= NewMode && NewMode <= 0x010C) ? VideoTextMode : VideoGraphicsMode;
VesaVideoMode = TRUE;
return TRUE;