Hi Michael,
On Tue, Feb 15, 2022 at 9:49 PM Michael Schmitz <schmitzmic@xxxxxxxxx> wrote:
On 15/02/22 21:11, Geert Uytterhoeven wrote:
Linux' falcon_setcolreg() writes to both the Falcon palette registers
and shifter_tt.color_reg[], so shouldn't the STE color palette contain
the correct colors, too?
I don't think it will:
The STe palette is set like this:
shifter_tt.color_reg[regno] =
(((red & 0xe) >> 1) | ((red & 1) << 3) << 8) |
(((green & 0xe) >> 1) | ((green & 1) << 3) << 4) |
((blue & 0xe) >> 1) | ((blue & 1) << 3);
with all colours downshifted by 12 bits already. Rewriting that in the
same form as is used in falcon_setcolreg(), i.e. without the downshift:
shifter_tt.color_reg[regno] =
(((red & 0xe000) >> 13) | ((red & 1000) >> 9)
<< 8) |
(((green & 0xe000) >> 13) | ((green & 1000) >>
9) << 4) |
((blue & 0xe000) >> 13) | ((blue & 1000) >> 9);
Now look at falcon_setcolreg:
shifter_tt.color_reg[regno] =
(((red & 0xe000) >> 13) | ((red & 0x1000) >>
12) << 8) |
(((green & 0xe000) >> 13) | ((green & 0x1000)
>> 12) << 4) |
((blue & 0xe000) >> 13) | ((blue & 0x1000) >> 12);
My guess would be the two ought to be identical, assuming the STe
palette registers provide backwards hardware compatibility.
The atafb driver references a 'linux/tools/hardware.txt' file for a
description of the Videl registers. Does anyone still have a copy of
that file?
At least full-history-linux doesn't have it.
Failing that - how would I go about setting specific text colours for
the console (or draw a test pattern showing the result of the four
palette entries)?
I typically use fbtest for that.
I also have a script to show the 16 colors (assumed there are 16):
#!/bin/bash
printf "\e[7m"
printf "\e[30m BLACK \n"
printf "\e[31m RED \n"
printf "\e[32m GREEN \n"
printf "\e[33m YELLOW \n"
printf "\e[34m BLUE \n"
printf "\e[35m MAGENTA \n"
printf "\e[36m CYAN \n"
printf "\e[37m WHITE \n"
printf "\e[1m"
printf "\e[30m BLACK \n"
printf "\e[31m RED \n"
printf "\e[32m GREEN \n"
printf "\e[33m YELLOW \n"
printf "\e[34m BLUE \n"
printf "\e[35m MAGENTA \n"
printf "\e[36m CYAN \n"
printf "\e[37m WHITE \n"
printf "\e[0m"
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds