Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Aug 2014 15:36:43 -0700
From:      Adrian Chadd <adrian@freebsd.org>
To:        =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= <dumbbell@freebsd.org>
Cc:        freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: r269471 make unusable VT console
Message-ID:  <CAJ-Vmonjc94oGLX%2BEK5iViPD43UOcfZyxxYbZ0qVxZZ0z%2BMSFg@mail.gmail.com>
In-Reply-To: <53F3A82D.4090000@FreeBSD.org>
References:  <20140812232807.0f3aa02570becec15e056af2@fbsd.es> <20140816011444.301a98d6187aca27e3a2481b@ddteam.net> <CAJ-Vmon3OS3fY1VoHu1n_T=N9NN64U7ZsxdbCkWsXAGbdMhp0g@mail.gmail.com> <53EE9CFF.4080607@freebsd.org> <53F30DF3.1090301@dumbbell.fr> <53F37B2D.3070807@FreeBSD.org> <53F38D8E.8090605@freebsd.org> <53F39F3D.9010104@FreeBSD.org> <CAJ-VmokDskruQB8g8AhaTt9R-eQwFt8-WLwJugtiocr9q%2BwF4A@mail.gmail.com> <53F3A82D.4090000@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,


On 19 August 2014 12:40, Jean-S=C3=A9bastien P=C3=A9dron <dumbbell@freebsd.=
org> wrote:
> 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.

Yup. That's how I've done it in the past. There's no read required and
computing that stuff on modern CPUs is really cheap.


-a



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmonjc94oGLX%2BEK5iViPD43UOcfZyxxYbZ0qVxZZ0z%2BMSFg>