Page 1 of 1

VGA 80x50 or 90x60 mode!

Posted: Sun Feb 05, 2012 6:56 am
by zhiayang
I got some code from http://geezer.osdevbrasil.net/osd/graphics/modes.c, mainly set_plane, write_font and the support functions they require. I also "extracted :p" some code form http://forum.osdev.org/viewtopic.php?f= ... 58&start=0...


I can get both 80x50 and 90x60 modes running, however it would seem that my font is seriously screwed up/corrupted.


When i use 80x50 mode, with the 8x8 font and a height of 8 (straight from chris giese's code), the font proportions look ok, but they are squished both vertically and horizontally.

When i use 8x16 font and height of 8 instead, I get random gibberish, mostly right-angled triangles.

When I use 8x8 font and height of 16, I get gibberish as well, though it's mostly '@'s this time.

When I use 8x16 and 16 as height, the text LOOKS to be fine, but it would appear that the lower half of the font is cut-off.


Either way, I cannot get my text to display properly. Help?

Re: VGA 80x50 or 90x60 mode!

Posted: Sun Feb 05, 2012 4:58 pm
by Combuster
If you realized what an 8x8 font did, you'd notice that:
a letter, like a G would need about the entire size to maintain detail.
a lowercase letter, would have to be lower to make the distinction, which gets you characters that are nearly twice as wide as tall. That looks ok for letters like lowercase m, but imagine the letter i that has to be twice as wide as tall (!).

The good engineers at IBM made it look as good as humanely possible (and as legible as humanely possible), but it is still ugly.

It is also completely normal.



The remaining issues seem to come from not matching up the character cell height with the font height with the exact location of the source font in ram and the destination font in video memory. (which reeks of not knowing what the code and hardware actually does, so I'll leave those keywords for your homework)