Page 1 of 1
Mixed Graphics and Text mode
Posted: Fri Feb 20, 2009 1:13 pm
by johnsa
I was just thinking about how best to implement this, the way the BIOS displays manufacturer logo etc while still in text-mode during POST etc.
a) Switch to graphics mode and use the std. text mode font data ?
b) Some sort of overlay mode?
c) remap the bios font like we used to in the old days (too limited as it eats up available chars and only allows a small area to be custom drawn and in 1 colour).
Re: Mixed Graphics and Text mode
Posted: Fri Feb 20, 2009 1:39 pm
by Firestryke31
I think that the most common 2 are 'a' and 'c' depending on the complexity of the logo.
If you go with 'c' the biggest trick is to try and do it in such a way that you have lots of areas with the same data (think tilemaps in games, as really that's all text mode is).
Re: Mixed Graphics and Text mode
Posted: Fri Feb 20, 2009 1:42 pm
by Troy Martin
I like doing it with option A. Granted, it's easiest to do it in real mode (the BIOS handles all of it for you) but in any mode it comes out great.
Sadly the BIOS doesn't know how to draw fonts in a VBE 800x600 graphics mode. Or maybe it does, I just don't know how to make it work.
Re: Mixed Graphics and Text mode
Posted: Fri Feb 20, 2009 1:53 pm
by johnsa
I've opted for A too for simplicity sake
I'm trying BIOS mode 10h.. seems the closest to 80x25 text mode but not identical.. what mode do you use ? this or a custom one via vga regs?
Re: Mixed Graphics and Text mode
Posted: Fri Feb 20, 2009 2:23 pm
by gzaloprgm
You may check FREEDOS bootloader which does exactly this:
Cheers,
Gonzalo
Re: Mixed Graphics and Text mode
Posted: Fri Feb 20, 2009 3:48 pm
by Combuster
From what I've seen, text output via int 10h still works in graphics mode. So if you set a 640x400x4 mode, fill the top half with artwork, then you can just do anything after that and still pretend its text mode. (As long as you don't decide to access video memory directly)
At least, that's my first guess at what's going on...
Re: Mixed Graphics and Text mode
Posted: Fri Feb 20, 2009 3:59 pm
by johnsa
I was thinking 640x400x16.. and I can't see any reason why you couldn't access display mem directly at the same time as using the bios font write?
Once into pmode you could "copy" out the bios font and use a custom writer I guess too..
Re: Mixed Graphics and Text mode
Posted: Fri Feb 20, 2009 4:10 pm
by Troy Martin
Now what I want to know is why, using my code, when I switch to graphics mode and print using int 10h, the cursor is gone. And can it be put back?
Re: Mixed Graphics and Text mode
Posted: Sat Feb 21, 2009 1:44 am
by Brendan
Hi,
Troy Martin wrote:Now what I want to know is why, using my code, when I switch to graphics mode and print using int 10h, the cursor is gone. And can it be put back?
In text modes the cursor is displayed by hardware (you tell the VGA hardware which row/column and the VGA hardware displays the cursor). In graphics modes there isn't any hardware cursor (excluding mouse pointers done by SVGA and later video cards), and you need to do the cursor yourself.
Also, for all VBE modes (e.g. 800*600 graphics mode), support for the non-VBE/legacy character output functions is optional, so it's likely you won't be able to use the BIOS's insanely slow character output routines and you'll need to write your own fast routines instead. For standard VGA graphics modes (e.g. 640*480*16 graphics mode) the standard VGA BIOS (not VBE) does support the BIOS's insanely slow character output routines (but I'd still recommend writing your own fast routines instead)...
Cheers,
Brendan
Re: Mixed Graphics and Text mode
Posted: Sat Feb 21, 2009 10:19 am
by Troy Martin
Brendan wrote:In text modes the cursor is displayed by hardware (you tell the VGA hardware which row/column and the VGA hardware displays the cursor). In graphics modes there isn't any hardware cursor (excluding mouse pointers done by SVGA and later video cards), and you need to do the cursor yourself.
So does that mean I basically have to draw an underscore at the cursor position?
Re: Mixed Graphics and Text mode
Posted: Sat Feb 21, 2009 10:28 am
by Brendan
Hi,
Troy Martin wrote:So does that mean I basically have to draw an underscore at the cursor position?
You'd need to draw your own underscore, or reverse the colours, or have a vertical bar, or something (it's up to you, but you're not limited to just an underscore).
Also note that for good software the cursor should only be visible when software is waiting for the user to type something, and for menu based systems it's better to highlight the currently selected menu item. In both these cases there shouldn't be any cursor.
Cheers,
Brendan
Re: Mixed Graphics and Text mode
Posted: Sun Feb 22, 2009 12:16 pm
by Dex
You can easy use, un-used fonts, like this:
Re: Mixed Graphics and Text mode
Posted: Mon Feb 23, 2009 5:00 am
by jal
Dex wrote:You can easy use, un-used fonts, like this:
True, but you're limited to two colours per 8x16 pixel block (ZX spectrum galore! :))
JAL
Re: Mixed Graphics and Text mode
Posted: Mon Feb 23, 2009 12:20 pm
by Dex
You can also fake text mode, by using high-res vesa, than mix text and image, like what linux does with its penguine logo.