How to fix the bug of the 8th (actualli 9th) pixel black line
Angros47 (no login) Posted Oct 29, 2008 8:15 AM
This routine works by redefining 4 characters, to display the mouse cursor.
In VGA text mode, a character is made of 9X16 pixel (NOT 8X16!!!), but the bit matrix allow to work only on 8 bit, where every bit represent a pixel. So there is no bit for the 9th pixel in each row, and this pixel is always black (to see it, try filling a line with underscore ______)
This quirk is hardware-dependent, but affects only VGA text mode (in fact some games, like Megazeux, used EGA text mode even if you had a VGA, and you see some little differences in characters proportions)
Some semi-graphic characters (in ASCII table they lie all between chr$(192) and chr$(220)) need to have the 9th pixel, because they are used to draw horizontal rows, so VGA productors used a very bad work-around: these characters have the 9th pixel "mirroring" the 8th, and to turn it on you have to turn on the 8th.
So, to remove the black line the simplest solution (used even in PC Tools Desktop and in Norton Utilities for DOS) is to use, for mouse cursor, four characters picked inside the range 192-223 (in the example posted, chars 240-241-242-243 are used, and they are outside the range)
Remember, if you want to create a TUI (text user interface) in Norton style, that you have a limited number of characters between 192-223, so use them wisely (if you don't need the 9th pixel, use characters outside this range)
By now, inside the draw.cursor subroutine, change the line: