Skip to content

Commit f7aa250

Browse files
committed
[FREELDR:PC] pcvideo.c!PcVideoSetMode(): deduplicate VESA mode setting code (reactos#8508)
Group VESA text/graphics modes setting together.
1 parent b050a45 commit f7aa250

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

boot/freeldr/freeldr/arch/i386/pc/pcvideo.c

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -933,27 +933,9 @@ PcVideoSetMode(USHORT NewMode)
933933

934934
return TRUE;
935935
}
936-
else if (0x0108 <= NewMode && NewMode <= 0x010C)
937-
{
938-
/* VESA Text Mode */
939-
if (!PcVideoVesaGetSVGAModeInformation(NewMode, &VesaVideoModeInformation))
940-
return FALSE;
941-
942-
if (!PcVideoSetBiosVesaMode(NewMode))
943-
return FALSE;
944-
945-
ScreenWidth = VesaVideoModeInformation.WidthInPixels;
946-
ScreenHeight = VesaVideoModeInformation.HeightInPixels;
947-
BytesPerScanLine = VesaVideoModeInformation.BytesPerScanLine;
948-
BiosVideoMode = NewMode;
949-
DisplayMode = VideoTextMode;
950-
VesaVideoMode = TRUE;
951-
952-
return TRUE;
953-
}
954936
else
955937
{
956-
/* VESA Graphics Mode */
938+
/* VESA Text/Graphics Mode */
957939
if (!PcVideoVesaGetSVGAModeInformation(NewMode, &VesaVideoModeInformation))
958940
return FALSE;
959941

@@ -964,7 +946,7 @@ PcVideoSetMode(USHORT NewMode)
964946
ScreenHeight = VesaVideoModeInformation.HeightInPixels;
965947
BytesPerScanLine = VesaVideoModeInformation.BytesPerScanLine;
966948
BiosVideoMode = NewMode;
967-
DisplayMode = VideoGraphicsMode;
949+
DisplayMode = (0x0108 <= NewMode && NewMode <= 0x010C) ? VideoTextMode : VideoGraphicsMode;
968950
VesaVideoMode = TRUE;
969951

970952
return TRUE;

0 commit comments

Comments
 (0)