svn commit: r316642 - head/sys/dev/syscons

Bruce Evans brde at optusnet.com.au
Sun Apr 9 07:58:47 UTC 2017


On Sun, 9 Apr 2017, Andrey Chernov wrote:

> On 09.04.2017 7:54, Andrey Chernov wrote:
>> On 08.04.2017 13:00, Bruce Evans wrote:
>>> Log:
>>>   Quick fix for removal of the mouse cursor in vga direct graphics modes
>>> ...
>>
>> Please don't forget that this 5 cells range (0xd0-0xd4, last one becomes
>> SC_CURSOR_CHAR) can be redefined with "vidcontrol -M", it is needed for
>> the case they overlap valid characters region for some code tables.
>
> Probably we just can change default to remove additional vidcontrol -M
> setup. I usually have this range started with 0x03.

That can only work if you also avoid 9-bit text modes.  9-bit modes
give 1-bit separations between characters, except for those in the
graphics range (starting at about 0xd0).

Hmm, syscons already seems to have bugs handling this.  The mouse cursor
is always 8x16, usually split into 4.  For cells placed outside the graphics
region, this gives 1-bit gaps in 9-bit mode.  For cells placed in the
graphics region, it is a difficult or impossible transformation which is
not done to rearrange the pixels to fill in the gaps correctly.

9-bit mode basically gives an 9x16 cursor, but the 9th bit is already
unusable within a single cell, since it would extend the rightmost
pixels in the 8x16 cursor in an ugly way.  These pixels are for 1 end
of the arrow and the end of its right barb.  The extension occurs
every 8th x position when the cursor is moved from left to right.  Also,
when the cursor is moved over an ordinary character, the ordinary
character is merged into the cursor and drawn as part of the cursor.
This gives ugly extensions of '0' characters in a font carefully
designed for 9-bit mode (the '0' characters are a full 8 bits wide
and if they are in the graphics range the become 9 bits wide with
extra pixels on the right).

This problem doesn't occur in graphics mode.  However, graphics mode
should support 9-bit mode in software, so that the fonts carefully
designed for 9-bit mode can be used.  8 bits wide is too narrow for
a good font (it requires '0' to be only 7 bits wide...), and is even
worse when used with fonts designed for 9-bit mode (their '0's and
'M's are not separated).

vt uses a 10x16 mouse cursor and only supports it in graphics mode.
The extra bit makes it look much better.  Support for 9-bit mode is
otherwise worse in vt than in sc.  E.g, the cp437 glyphs for line
drawing characters don't work in 9-bit text mode, since a gap is
left between then.  I think the bit that controls extension is forced
off together with the bit that controls blinking fg/bg brightness,
so even if these glyphs are rendered using a char in the graphics
range, they are not extended.

9-bit text modes are hard to avoid.  90-column sc modes avoid them,
but tend to be broken on newer hardware.  The newer hardware tends
to force 9-bit modes because this is normal and works better.  I
have just 1 system (an 11 year old laptop) than forces 8-bit mode
instead.

Bruce


More information about the svn-src-all mailing list