[comp.sys.ibm.pc] EGA Text question

mcdonald@uxe.cso.uiuc.edu (09/09/87)

I tried today to write characters to an EGA screen today while in mode 16
(350x640x16 colors graphics) using the bios INT 010H, AH = 9, which is
write attribute/character. This works fine in mode 3 (24x80 text) but
in mode 16 it writes the character correctly, but refuses to do anything
with the color attributes. It writes white on black. Does anyone know if
it can be made to write in an arbitrary color? I have a graphics drawing
routine to do it, but using the BIOS should work ... or should it?

Doug McDonald
University of Illinois

jack@killer.UUCP (Jack Hudler) (09/13/87)

In article <45900073@uxe.cso.uiuc.edu>, mcdonald@uxe.cso.uiuc.edu writes:
> 
> I tried today to write characters to an EGA screen today while in mode 16
> (350x640x16 colors graphics) using the bios INT 010H, AH = 9, which is
> write attribute/character. This works fine in mode 3 (24x80 text) but
> in mode 16 it writes the character correctly, but refuses to do anything
> with the color attributes. It writes white on black. Does anyone know if
> it can be made to write in an arbitrary color? I have a graphics drawing
> routine to do it, but using the BIOS should work ... or should it?
> 
> Doug McDonald
> University of Illinois

Your right you can't write chars to the EGA in graphics mode using a
background color thats why I wrote my own, however you should be
able to set the foreground color. What I did was to get the memory
address of the font used and set the color mask with my forground 
color then set the bit mask with the byte that represents one scan
line of the char then send that to the screen at the proper address
then set the color mask for the background color NOTed the char byte
and set the bit mask and wrote it to the same location. You have
to calculate the location on the screen and the byte offset of
the char in the font table.. all which is very easy. But you will
need the EGA tech reference to do it well or at all.

Jack Hudler
Computer Support Corp.

ins_bjjb@jhunix.UUCP (Jared J Brennan) (09/14/87)

In article <45900073@uxe.cso.uiuc.edu> mcdonald@uxe.cso.uiuc.edu writes:
>I tried today to write characters to an EGA screen today while in mode 16
>(350x640x16 colors graphics) using the bios INT 010H, AH = 9, which is
>write attribute/character. This works fine in mode 3 (24x80 text) but
>in mode 16 it writes the character correctly, but refuses to do anything
>with the color attributes. It writes white on black. Does anyone know if
>it can be made to write in an arbitrary color? I have a graphics drawing
>routine to do it, but using the BIOS should work ... or should it?
>Doug McDonald

   The EGA-specific modes seem to require using the EGA BIOS INT 010H,
AH=01?H functions.  AH=13H outputs a string with attribute.  I don't
think there's an equivalent character output function in the EGA BIOS.

--
"Disclaimers?  We got disclaimers?"
Jared J. Brennan
BITNET: INS_BJJB@JHUVMS, INS_BJJB@JHUNIX
ARPA: ins_bjjb%jhunix@hopkins.ARPA
UUCP: {allegra!hopkins, seismo!umcp-cs, ihnp4!whuxcc} !jhunix!ins_bjjb