[comp.sources.wanted] Help with text in graphics mode on PC & PS/2

dvlpde@apollon.cs.umu.se (02/23/90)

Greetings,

Having recently aquired a PS/2 and installing DOS 4.0, I was surprised to
see the DOSSHELL writing very neat text in the black and white graphics mode.
(I am not sure what resolution but it certainly is High >= 640x200.)

I am currently working on a project and would have great use of being able
to produce similar results.  I currently use the MCGA screen, but have seen
the same on EGA and VGA.  My question is:
Where can I find information on how to use and program such text?  Is there
a book one should read?  Is there anyone out there who has some program
examples which I could take a look at?
I work with QuickC and/or MASM.  I can even run TP 5.0 if it is necessary,
so any kind of program code will do.

Any information would be of great help.  Thanks,   Phil.
--
================================================================================
It's amazing what one can accomplish when one doesn't know what one can't do!
Phillip Dale	dvlpde@cs.umu.se
================================================================================

teittinen@cc.helsinki.fi (02/24/90)

In article <1990Feb23.082830.21961@cs.umu.se>, dvlpde@apollon.cs.umu.se writes:
> Having recently aquired a PS/2 and installing DOS 4.0, I was surprised to
> see the DOSSHELL writing very neat text in the black and white graphics mode.
> (I am not sure what resolution but it certainly is High >= 640x200.)
> 
> I am currently working on a project and would have great use of being able
> to produce similar results.  I currently use the MCGA screen, but have seen
> the same on EGA and VGA.  My question is:
> Where can I find information on how to use and program such text?  Is there
> a book one should read?  Is there anyone out there who has some program
> examples which I could take a look at?
> I work with QuickC and/or MASM.  I can even run TP 5.0 if it is necessary,
> so any kind of program code will do.
> 
> Any information would be of great help.  Thanks,   Phil.

As far as I know, DOSSHELL uses the highest available resolution in
graphics mode. That means 640*480 for VGA and 640*350 for EGA. In normal
text mode VGA uses 640*400 and EGA 640*350, so you gain nothing if
you're using EGA. The font size for VGA is 8*16 and for EGA it is 8*14.
That means you can have 30 lines on screen when using VGA. 

You can write to graphics screen by using BIOS calls, but that is
terribly slow. Anyway if you want to try it, here's the info:
	INT 0x10 (video interrupt)
		AH = 0x13  (Write string, EGA or VGA)
		ES:BP = Pointer to string to write
		CX = Character count
		DH = Row
		DL = Column
		BH = Page number
		BL = Color of the text
		AL = 0 -> Do not move cursor
		   = 1 -> Move cursor

You may want to write your own print string function and then you have
to get the info where the bitmap fonts are. You get that info by using
the following BIOS-call:
	INT 0x10 (video interrupt)
		AH = 0x11 (Character generator)
		AL = 0x30 (Information)
		BH = Font to get info on
		   = 0x02 -> 8*14 font
		   = 0x03 -> 8*8 font (lower half, 0-127)
		   = 0x04 -> 8*8 font (upper half, 128-255)
		   = 0x06 -> 8*16 font
	On return:
		CX = Bytes per character (character height)
		DL = Number of rows on screen - 1
		ES:BP = Pointer to font table
The fonts are stored one bit per pixel, so it's quite easy to write the
characters on screen. But that is left for you to implement.

Hope this helps!

-- 
E-Mail: teittinen@finuh.bitnet               ! "Studying is the only way
        teittinen@cc.helsinki.fi             !  to do nothing without
Marko Teittinen, student of computer science !  anyone blaming you" -me