mirror of
https://github.com/reactos/reactos.git
synced 2026-05-31 16:31:07 +08:00
[FREELDR:PC] pcvideo.c!PcVideoSetMode(): deduplicate VESA mode setting code (#8508)
Group VESA text/graphics modes setting together.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user