[FREELDR] Add variable for default text color 3301/head
authorStanislav Motylkov <x86corez@gmail.com>
Fri, 16 Oct 2020 21:46:06 +0000 (00:46 +0300)
committerStanislav Motylkov <x86corez@gmail.com>
Sat, 17 Oct 2020 16:28:08 +0000 (19:28 +0300)
On PC/AT-compatible machines it's Gray, and on NEC PC-98 series it's White.

base/setup/lib/utils/bldrsup.c
boot/bootdata/bootcd.ini
boot/bootdata/floppy_pc98.ini
boot/bootdata/hybridcd.ini
boot/bootdata/livecd.ini
boot/freeldr/FREELDR.INI
boot/freeldr/freeldr/arch/i386/pc/pcvideo.c
boot/freeldr/freeldr/arch/i386/pc98/pc98video.c
boot/freeldr/freeldr/arch/i386/xbox/xboxvideo.c
boot/freeldr/freeldr/ui/tui.c

index 0040d77..ac1d200 100644 (file)
@@ -277,7 +277,7 @@ CreateCommonFreeLdrSections(
 
     /* MenuTextColor=White */
     IniCacheInsertKey(IniSection, NULL, INSERT_LAST,
-                      L"MenuTextColor", L"Gray");
+                      L"MenuTextColor", L"Default");
 
     /* MenuColor=Blue */
     IniCacheInsertKey(IniSection, NULL, INSERT_LAST,
@@ -285,15 +285,15 @@ CreateCommonFreeLdrSections(
 
     /* TextColor=Yellow */
     IniCacheInsertKey(IniSection, NULL, INSERT_LAST,
-                      L"TextColor", L"Gray");
+                      L"TextColor", L"Default");
 
     /* SelectedTextColor=Black */
     IniCacheInsertKey(IniSection, NULL, INSERT_LAST,
                       L"SelectedTextColor", L"Black");
 
-    /* SelectedColor=Gray */
+    /* SelectedColor=Default */
     IniCacheInsertKey(IniSection, NULL, INSERT_LAST,
-                      L"SelectedColor", L"Gray");
+                      L"SelectedColor", L"Default");
 
     /* ShowTime=Yes */
     IniCacheInsertKey(IniSection, NULL, INSERT_LAST,
index 588dd8d..4f2017c 100644 (file)
@@ -13,11 +13,11 @@ TitleBoxTextColor=White
 TitleBoxColor=Red
 MessageBoxTextColor=White
 MessageBoxColor=Blue
-MenuTextColor=Gray
+MenuTextColor=Default
 MenuColor=Black
-TextColor=Gray
+TextColor=Default
 SelectedTextColor=Black
-SelectedColor=Gray
+SelectedColor=Default
 ShowTime=No
 MenuBox=No
 CenterMenu=No
index a464896..3828cee 100644 (file)
@@ -13,11 +13,11 @@ TitleBoxTextColor=White
 TitleBoxColor=Red
 MessageBoxTextColor=White
 MessageBoxColor=Blue
-MenuTextColor=Gray
+MenuTextColor=Default
 MenuColor=Black
-TextColor=Gray
+TextColor=Default
 SelectedTextColor=Black
-SelectedColor=Gray
+SelectedColor=Default
 ShowTime=No
 MenuBox=No
 CenterMenu=No
index d53ab95..28697d3 100644 (file)
@@ -13,11 +13,11 @@ TitleBoxTextColor=White
 TitleBoxColor=Red
 MessageBoxTextColor=White
 MessageBoxColor=Blue
-MenuTextColor=Gray
+MenuTextColor=Default
 MenuColor=Black
-TextColor=Gray
+TextColor=Default
 SelectedTextColor=Black
-SelectedColor=Gray
+SelectedColor=Default
 ShowTime=No
 MenuBox=No
 CenterMenu=No
index 914ebf6..d4b37b6 100644 (file)
@@ -13,11 +13,11 @@ TitleBoxTextColor=White
 TitleBoxColor=Red
 MessageBoxTextColor=White
 MessageBoxColor=Blue
-MenuTextColor=Gray
+MenuTextColor=Default
 MenuColor=Black
-TextColor=Gray
+TextColor=Default
 SelectedTextColor=Black
-SelectedColor=Gray
+SelectedColor=Default
 ShowTime=No
 MenuBox=No
 CenterMenu=No
index ac63ff6..0bd420d 100644 (file)
 ;
 ; Text colors can be any one of the background colors and any of the following:
 ; DarkGray, LightBlue, LightGreen, LightCyan, LightRed, LightMagenta,
-; Yellow, White.
+; Yellow, White, Default.
+;
+; Default color is the one that is being used by BIOS firmware by default.
+; On PC/AT-compatible machines it's Gray, and on NEC PC-98 series it's White.
 
 ; [OS-General] Section Commands:
 ;
index 0525293..7050cf3 100644 (file)
@@ -108,6 +108,8 @@ typedef struct
 } SVGA_MODE_INFORMATION, *PSVGA_MODE_INFORMATION;
 #include <poppack.h>
 
+UCHAR MachDefaultTextColor = COLOR_GRAY;
+
 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 */
index 0d9b3b3..5b6f2f7 100644 (file)
@@ -35,6 +35,8 @@ static BOOLEAN UseCGFont = TRUE;
  * This option is possible only with BIOS fonts enabled. */
 static BOOLEAN CGAccelDraw = TRUE;
 
+UCHAR MachDefaultTextColor = COLOR_WHITE;
+
 ULONG VramText;
 static ULONG VramPlaneB;
 static ULONG VramPlaneG;
index 435ad2a..3442017 100644 (file)
@@ -33,6 +33,8 @@ static ULONG BytesPerPixel;
 static ULONG Delta;
 extern multiboot_info_t * MultibootInfoPtr;
 
+UCHAR MachDefaultTextColor = COLOR_GRAY;
+
 #define CHAR_WIDTH  8
 #define CHAR_HEIGHT 16
 
index d8fa402..b932795 100644 (file)
@@ -23,6 +23,7 @@
 #define TAG_TAG_TUI_PALETTE 'PiuT'
 
 PVOID TextVideoBuffer = NULL;
+extern UCHAR MachDefaultTextColor;
 
 /*
  * TuiPrintf()
@@ -724,6 +725,9 @@ UCHAR TuiTextToColor(PCSTR ColorText)
     };
     ULONG i;
 
+    if (_stricmp(ColorText, "Default") == 0)
+        return MachDefaultTextColor;
+
     for (i = 0; i < sizeof(Colors)/sizeof(Colors[0]); ++i)
     {
         if (_stricmp(ColorText, Colors[i].ColorName) == 0)