Epson Research and Development
Page 77
Vancouver Design Center
Programming Notes and Examples
S1D13503
Issue Date: 01/01/30
X18A-G-002-06
Video |= color;
*+ = (unsigned char) Video;
CheckBank(pVideo, &bank);
pVideoFirst= BytesPerScanLine;
}
++pVideoStart; // Point to next character
pVideoFirstColumn = pVideoStart;
}
break;
case 4:
//
// If there are 4 colors/gray levels, there are 4 pixels/byte
//
color &= 0x03;
while (*str != 0)
{
ch = *str++;
if ((ch < ' ') || (ch - ' ' > MAX_FONT-1))
ch = '.';
pFont = &font[ch - ' '][0];
for (y = 0; y < 8; ++y)
{
pVideo = pVideoFirstColumn;
Video = 0;
val = *pFont++;
//
// Since there are 4 colors/gray shades, each bit in the font will be
// represented in video memory as a two bit pixel.
//
if (val & 0x80)
Video |= (color << 6);
if (val & 0x40)
Video |= (color << 4);
if (val & 0x20)
Video |= (color << 2);
if (val & 0x10)
Video |= color;
*+ = (unsigned char) Video;
CheckBank(pVideo, &bank);
electronic components distributor