Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!mips!dimacs.rutgers.edu!aramis.rutgers.edu!paul.rutgers.edu!njin!princeton!newross!samadams!tr
From: tr@samadams.princeton.edu (Tom Reingold)
Newsgroups: comp.os.msdos.programmer
Subject: blitting text to a hercules
Message-ID:
Date: 6 Jun 91 19:30:49 GMT
Sender: news@newross.Princeton.EDU (USENET News System)
Organization: Princeton University, Dept. of Computer Science
Lines: 34
Is there something I need to know about blitting characters onto the
screen with a Hercules board? The following function works just fine
on regular color and monochrome boards. Do I have to access some
register or something before I do direct access to video RAM? The
Hercules BIOS says it's a monochrome board. I assume that the RAM
addresses for monochrome are coorect.
Thanks.
/* display a character at row, col with attribute and repetition */
/* uses video RAM */
void disp_char(int row, int col, char val, char attribute, int times)
{
static char far *v_off = (char far *) 0;
char far *p;
if (v_off == (char far *) 0) {
if (video_type() == COLOR)
v_off = (char far *) 0xb8000000;
else
v_off = (char far *) 0xb0000000;
}
p = v_off + (((row * 80) + col) << 1);
while (times--) {
*p++ = val;
*p++ = attribute;
}
}
--
Tom Reingold
tr@samadams.princeton.edu OR ...!princeton!samadams!tr
"Warning: Do not drive with Auto-Shade in place. Remove
from windshield before starting ignition."