https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8a4273b6ee25c2809bcb0…
commit 8a4273b6ee25c2809bcb0d6e165815917fd10d36
Author: Stanislav Motylkov <x86corez(a)gmail.com>
AuthorDate: Sat Oct 17 00:46:06 2020 +0300
Commit: Stanislav Motylkov <x86corez(a)gmail.com>
CommitDate: Sat Oct 17 19:28:08 2020 +0300
[FREELDR] Add variable for default text color
On PC/AT-compatible machines it's Gray, and on NEC PC-98 series it's White.
---
base/setup/lib/utils/bldrsup.c | 8 ++++----
boot/bootdata/bootcd.ini | 6 +++---
boot/bootdata/floppy_pc98.ini | 6 +++---
boot/bootdata/hybridcd.ini | 6 +++---
boot/bootdata/livecd.ini | 6 +++---
boot/freeldr/FREELDR.INI | 5 ++++-
boot/freeldr/freeldr/arch/i386/pc/pcvideo.c | 2 ++
boot/freeldr/freeldr/arch/i386/pc98/pc98video.c | 2 ++
boot/freeldr/freeldr/arch/i386/xbox/xboxvideo.c | 2 ++
boot/freeldr/freeldr/ui/tui.c | 4 ++++
10 files changed, 30 insertions(+), 17 deletions(-)
diff --git a/base/setup/lib/utils/bldrsup.c b/base/setup/lib/utils/bldrsup.c
index 0040d77180c..ac1d2008ab8 100644
--- a/base/setup/lib/utils/bldrsup.c
+++ b/base/setup/lib/utils/bldrsup.c
@@ -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,
diff --git a/boot/bootdata/bootcd.ini b/boot/bootdata/bootcd.ini
index 588dd8d39c0..4f2017c5939 100644
--- a/boot/bootdata/bootcd.ini
+++ b/boot/bootdata/bootcd.ini
@@ -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
diff --git a/boot/bootdata/floppy_pc98.ini b/boot/bootdata/floppy_pc98.ini
index a46489687e4..3828cee347d 100644
--- a/boot/bootdata/floppy_pc98.ini
+++ b/boot/bootdata/floppy_pc98.ini
@@ -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
diff --git a/boot/bootdata/hybridcd.ini b/boot/bootdata/hybridcd.ini
index d53ab953f65..28697d30b36 100644
--- a/boot/bootdata/hybridcd.ini
+++ b/boot/bootdata/hybridcd.ini
@@ -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
diff --git a/boot/bootdata/livecd.ini b/boot/bootdata/livecd.ini
index 914ebf66fc6..d4b37b646c9 100644
--- a/boot/bootdata/livecd.ini
+++ b/boot/bootdata/livecd.ini
@@ -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
diff --git a/boot/freeldr/FREELDR.INI b/boot/freeldr/FREELDR.INI
index ac63ff653bd..0bd420d06dc 100644
--- a/boot/freeldr/FREELDR.INI
+++ b/boot/freeldr/FREELDR.INI
@@ -50,7 +50,10 @@
;
; 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:
;
diff --git a/boot/freeldr/freeldr/arch/i386/pc/pcvideo.c
b/boot/freeldr/freeldr/arch/i386/pc/pcvideo.c
index 05252936545..7050cf3b64d 100644
--- a/boot/freeldr/freeldr/arch/i386/pc/pcvideo.c
+++ b/boot/freeldr/freeldr/arch/i386/pc/pcvideo.c
@@ -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
*/
diff --git a/boot/freeldr/freeldr/arch/i386/pc98/pc98video.c
b/boot/freeldr/freeldr/arch/i386/pc98/pc98video.c
index 0d9b3b34423..5b6f2f7af3d 100644
--- a/boot/freeldr/freeldr/arch/i386/pc98/pc98video.c
+++ b/boot/freeldr/freeldr/arch/i386/pc98/pc98video.c
@@ -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;
diff --git a/boot/freeldr/freeldr/arch/i386/xbox/xboxvideo.c
b/boot/freeldr/freeldr/arch/i386/xbox/xboxvideo.c
index 435ad2a59aa..34420177c6b 100644
--- a/boot/freeldr/freeldr/arch/i386/xbox/xboxvideo.c
+++ b/boot/freeldr/freeldr/arch/i386/xbox/xboxvideo.c
@@ -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
diff --git a/boot/freeldr/freeldr/ui/tui.c b/boot/freeldr/freeldr/ui/tui.c
index d8fa4028b4c..b9327950f4c 100644
--- a/boot/freeldr/freeldr/ui/tui.c
+++ b/boot/freeldr/freeldr/ui/tui.c
@@ -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)