2 Turbo C questions
Daeshik Kim
dkim at wam.umd.edu
Thu Mar 22 16:42:23 AEST 1990
For the first ques.,
/* check your video controller satus */
char *sptr;
sptr = (char*) 0x410L;
/* let's assume CGA */
char *charbase;
charbase = (char*) 0xb8000000L;
charin(c, attr, x, y)
int c,attr,x,y;
{
charbase[x*2+y*160] = c; /* map char to video-mem */
charbase[x*2+y*160+1] = attr; /* map color attr. */
return;
}
This is just an example on CGA.
You have to check the *sptr to find the right video-type.
If it's either ega or vga, it's easier to use asm. than c.
due to the color attr. mapping.
--
Daeshik Kim H: (301) 445-0475/2147 O: (703) 689-5878
SCHOOL: dkim at wam.umd.edu, dskim at eng.umd.edu, mz518 at umd5.umd.edu
WORK: dkim at daffy.uu.net (uunet!daffy!dkim)
More information about the Comp.lang.c
mailing list