Color in MSC using *printf?

Dave Burton daveb at laidbak.UUCP
Fri May 27 00:12:33 AEST 1988


In article <14608 at brl-adm.ARPA> C03601DM%WUVMD.BITNET at cornellc.ccs.cornell.edu (Derek Morgan) writes:
|Has anybody gotten printf,(c-,v-,-f) to produce colors inside of MSC 5.0? I
|can get color text by using _outtext, but _outtext doesn't have formatting
|capabilities.  To use ANSI.SYS is cheating, because not everybody has DEVICE=
|ANSI.SYS in their config.sys file.

Nocando. Printf() as implemented by MS uses DOS calls to allow I/O redirection.
The DOS interrupt functions will eventually use a BIOS call 'wrtty' I think
(int 0x10, func 0x14?). Anyway, allowing color info in the stream would hinder
the usefulness of redirection.

You may want to use sprintf() first, then use _outtext() to dump it in color.
If you could devise a decent enough parameter list, perhaps even write a
wrapper printf that did what you wanted.

I once wrote a high-performance PC screen management library, but used MASM
for the lowest level (replacing the BIOS routines). The first motivation for
this was because I couldn't get printf() to output color info. The second
motivation was because printf() (in MSC4.0) was slooooow. As for portability,
I only cared about true blue and 100% compatibles. You may also want to do
the same, depending upon your circumstances.



More information about the Comp.lang.c mailing list