Mixed Graphics and Text 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
johnsa
Member
Member
Posts: 296
Joined: Mon Oct 15, 2007 3:04 pm

Mixed Graphics and Text mode

Post 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).
User avatar
Firestryke31
Member
Member
Posts: 550
Joined: Sat Nov 29, 2008 1:07 pm
Location: Throw a dart at central Texas
Contact:

Re: Mixed Graphics and Text mode

Post 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).
Owner of Fawkes Software.
Wierd Al wrote: You think your Commodore 64 is really neato,
What kind of chip you got in there, a Dorito?
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Mixed Graphics and Text mode

Post 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.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
johnsa
Member
Member
Posts: 296
Joined: Mon Oct 15, 2007 3:04 pm

Re: Mixed Graphics and Text mode

Post 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?
User avatar
gzaloprgm
Member
Member
Posts: 141
Joined: Sun Sep 23, 2007 4:53 pm
Location: Buenos Aires, Argentina
Contact:

Re: Mixed Graphics and Text mode

Post by gzaloprgm »

You may check FREEDOS bootloader which does exactly this:

Image

Cheers,
Gonzalo
Visit https://gzalo.com : my web site with electronic circuits, articles, schematics, pcb, calculators, and other things related to electronics.
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: Mixed Graphics and Text mode

Post 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...
"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 ]
johnsa
Member
Member
Posts: 296
Joined: Mon Oct 15, 2007 3:04 pm

Re: Mixed Graphics and Text mode

Post 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..
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Mixed Graphics and Text mode

Post 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?
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Mixed Graphics and Text mode

Post 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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Mixed Graphics and Text mode

Post 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?
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Mixed Graphics and Text mode

Post 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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: Mixed Graphics and Text mode

Post by Dex »

You can easy use, un-used fonts, like this:
Attachments
logo.png
logo.png (785 Bytes) Viewed 3783 times
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: Mixed Graphics and Text mode

Post 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
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: Mixed Graphics and Text mode

Post 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.
Post Reply