Re: r269471 make unusable VT console

From: Jean-Sébastien Pédron <dumbbell_at_FreeBSD.org>
Date: Tue, 19 Aug 2014 21:40:29 +0200
On 19.08.2014 21:20, Adrian Chadd wrote:
> Hey, this is cool!
> 
> So hm, why are you still doing any reading? Don't you now have all the
> information you need to write out the font and cursor information for
> each given set of 8 pixels?

I read a lot about VGA in the past days but I'm new to this interface,
so my reasonning may be wrong. Anyway, here it is:

To write a group of 8 pixels with only 2 colors, I write a byte using
background color in an offscreen memory, read it back to load it in the
latches, put the foreground color in the Set/Reset register, then write
the character/cursor to its final location in video memory. Because the
background color almost never changes, only one read is made the first
time we load the background color, and then only writes. This is fast.

If the group of 8 pixels uses 3 or more colors, I can't use Write Mode 3
alone. I see two possibilities:
    1. Set Write Mode 0, then for each plane, compute the byte to write
       (1 bit out of 4 of each pixel's color), activate one plane, write
       the byte (repeat for each plane), restore Write Mode 3 and the
       relevant registers.
    2. Stay in Write Mode 3, do a read/write for each colors.

The first solution has a constant time of execution. The second one
depends on the number of colors. In the end, I guess both solutions are
expensive, but hopefully are rarely used.

-- 
Jean-Sébastien Pédron


Received on Tue Aug 19 2014 - 17:40:37 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:51 UTC