Hey,
I am considering using video mode 12h and was wondering how to display text in this mode, it is meant to be a text and graphics mode. I would like to do it by directly writing to the video memory rather than use the BIOS.
Cheers.
Display Text in Mode 12h
Re:Display Text in Mode 12h
Well, you can print text in any graphics mode by having font, and then drawing (hint: bitblt) the characters to the screen as graphics.
Re:Display Text in Mode 12h
hehe you make it sound so simple (not lol)
i'm using mode 12h for my text/graphics and it looks fine (although it doesn't work in bochs and you have to refresh the video mode a few times in QEMU).
if anyone knows a tutorial or something for making your own fonts for text in graphics mode please tell me
i'm using mode 12h for my text/graphics and it looks fine (although it doesn't work in bochs and you have to refresh the video mode a few times in QEMU).
if anyone knows a tutorial or something for making your own fonts for text in graphics mode please tell me
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Display Text in Mode 12h
you should find that in game development tutorials. (Very) basically, you'll use the character value to retrieve a bitmap telling how you must draw it...
e.g.
e.g.
Code: Select all
font['A']="..****.."
".**..**."
"**....**"
"**....**"
"********"
"**....**"
"**....**";
for (row=0;row<8;row++)
for (col=0; col<8; col++)
if (font[i++]=='*')
putpixel(base+row*scrwidth+col);
Re:Display Text in Mode 12h
Yeah, I was aware that you need fonts however this mode is listed as being text and graphics so I thought there may have been a way to have it draw the font for you. Anyway, that is no big deal, so can anyone tell me where in memory I can find the standard font that is used in normal text modes, I would really like to avoid adding 4KB to my file just to have a font defined, especially at boot time when loading should be as quick as possible. I assume the font would be in the BIOS data area but how can I find it?
Cheers.
Cheers.
Re:Display Text in Mode 12h
Why not use 50x80 text mode, you can still add logo and things, much easier than mode 12h for text.
http://myfilebucket.com/u/ASHLEY40/dir.PNG
Or if you want better graphics, why not do 32bpp, just as easy as mode 12h and easily fits in the boot sector .
http://myfilebucket.com/u/ASHLEY40/ASHLEY4.jpg
\\\\||////
(@@)
ASHLEY4.
Batteries not included, Some assembly required.
http://myfilebucket.com/u/ASHLEY40/dir.PNG
Or if you want better graphics, why not do 32bpp, just as easy as mode 12h and easily fits in the boot sector .
http://myfilebucket.com/u/ASHLEY40/ASHLEY4.jpg
\\\\||////
(@@)
ASHLEY4.
Batteries not included, Some assembly required.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Display Text in Mode 12h
There is: BIOS interrupt ... But i guess you'll not find it really useful since once in pmode, you cannot call it.XStream wrote: Yeah, I was aware that you need fonts however this mode is listed as being text and graphics so I thought there may have been a way to have it draw the font for you.
Iirc, it is on the second bitplane in textmode. I dunno for that specific graphic mode and i don't think it will be at the same place between 2 different bios'es.Anyway, that is no big deal, so can anyone tell me where in memory I can find the standard font that is used in normal text modes, I would really like to avoid adding 4KB to my file just to have a font defined, especially at boot time when loading should be as quick as possible. I assume the font would be in the BIOS data area but how can I find it?
So what i'd suggest if you wish a font for free is that you switch to the fonts bitplane while in text mode and copy font data in some other area you'll use afterwards.