VGA 80x50 or 90x60 mode!

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
zhiayang
Member
Member
Posts: 368
Joined: Tue Dec 27, 2011 7:57 am
Libera.chat IRC: zhiayang

VGA 80x50 or 90x60 mode!

Post 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?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: VGA 80x50 or 90x60 mode!

Post 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)
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply