Thanks to Johannes Fortmann, I learned that the blinking mode can be turned
off to enable bright background colors. It's now always done which enabled me to improve the slider colors a bit. Therefore, console_set_color() no longer clears bit 8 from the background color. Now no longer tries to change the palette in non-8-bit modes; that fixes the strange colors I got in high and true color modes (VESA palette changing would fail and the fallback VGA palette changing was responsible for the effect). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9772 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -125,7 +125,7 @@ console_set_cursor(int32 x, int32 y)
|
||||
void
|
||||
console_set_color(int32 foreground, int32 background)
|
||||
{
|
||||
sColor = (background & 0x7) << 12 | (foreground & 0xf) << 8;
|
||||
sColor = (background & 0xf) << 12 | (foreground & 0xf) << 8;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ enum console_color {
|
||||
PURPLE,
|
||||
BROWN,
|
||||
GRAY,
|
||||
// foreground colors only
|
||||
// foreground colors only if blinking is enabled
|
||||
DARK_GRAY,
|
||||
BRIGHT_BLUE,
|
||||
BRIGHT_GREEN,
|
||||
|
||||
@@ -34,9 +34,9 @@ static const console_color kItemBackgroundColor = kBackgroundColor;
|
||||
static const console_color kSelectedItemBackgroundColor = GRAY;
|
||||
static const console_color kDisabledColor = DARK_GRAY;
|
||||
|
||||
static const console_color kSliderColor = GRAY;
|
||||
static const console_color kSliderBackgroundColor = CYAN;
|
||||
static const console_color kArrowColor = WHITE;
|
||||
static const console_color kSliderColor = CYAN;
|
||||
static const console_color kSliderBackgroundColor = DARK_GRAY;
|
||||
static const console_color kArrowColor = GRAY;
|
||||
|
||||
static int32 sMenuOffset = 0;
|
||||
|
||||
|
||||
@@ -56,6 +56,21 @@ vga_set_palette(const uint8 *palette, int32 firstIndex, int32 numEntries)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
vga_enable_bright_background_colors(void)
|
||||
{
|
||||
// reset attribute controller
|
||||
in8(0x03da);
|
||||
|
||||
// select mode control register
|
||||
out8(0x30, 0x03c0);
|
||||
|
||||
// read mode control register, change it (we need to clear bit 3), and write it back
|
||||
uint8 mode = in8(0x03c1) & 0xf7;
|
||||
out8(mode, 0x3c0);
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
// VESA functions
|
||||
|
||||
@@ -222,11 +237,10 @@ vesa_set_mode(uint16 mode)
|
||||
static status_t
|
||||
vesa_set_palette(const uint8 *palette, int32 firstIndex, int32 numEntries)
|
||||
{
|
||||
#if 0
|
||||
// is this an 8 bit indexed color mode?
|
||||
if (gKernelArgs.fb.bit_depth = modeInfo.bits_per_pixel != 8)
|
||||
if (gKernelArgs.frame_buffer.depth != 8)
|
||||
return B_BAD_TYPE;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
struct bios_regs regs;
|
||||
regs.eax = 0x4f09;
|
||||
@@ -386,13 +400,18 @@ platform_switch_to_logo(void)
|
||||
extern "C" void
|
||||
platform_switch_to_text_mode(void)
|
||||
{
|
||||
if (!gKernelArgs.frame_buffer.enabled)
|
||||
|
||||
if (!gKernelArgs.frame_buffer.enabled) {
|
||||
vga_enable_bright_background_colors();
|
||||
return;
|
||||
}
|
||||
|
||||
bios_regs regs;
|
||||
regs.eax = 3;
|
||||
call_bios(0x10, ®s);
|
||||
gKernelArgs.frame_buffer.enabled = 0;
|
||||
|
||||
vga_enable_bright_background_colors();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user