
Epson Research and Development
Page 55
Vancouver Design Center
Programming Notes and Examples
SED1352
Issue Date: 98/10/08
X16-BG-007-04
//
// In the 16 gray level mode, each pixel is stored as four bits.
// Since a byte holds 8 bits, there are 2 pixels per byte.
// The variable "val" represents the pixel value.
//
val = Bar % 16;
*+ = (unsigned char) ((val << 4) | val);
}
}
}
//
// Point to the beginning of the next scan line
//
pVide= BytesPerScanLine;
pVideo = pVideoStart;
}
}
//-------------------------------------------------------------------------
//
// ShowText()
//
// DESCRIPTION: Writes text to the LCD panel. Text must only contain
// the letters A-Z, and the space character. All other
// characters are replaced by spaces.
//
// NOTES: It is assumed that a pixel set to a value of 0 represents the
// background color (black).
// The character "!" is translated to a block character.
//
//-------------------------------------------------------------------------
void ShowText(unsigned char _far *pdisplayStart, char *str, int color)
{
static const unsigned char *pFont;
static unsigned char _far *pdisplayFirstColumn;
static unsigned char _far *pDisplay;
static unsigned char ch;
static unsigned int y, val, Display;
//
// Each letter in the font is 8 x 8 bits
//
static const unsigned char font[28][8] =
{ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // blank
{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, // block char
{ 0x30, 0x78, 0xCC, 0xCC, 0xFC, 0xCC, 0xCC, 0x00 }, // A
{ 0xFC, 0x66, 0x66, 0x7C, 0x66, 0x66, 0xFC, 0x00 }, // B
{ 0x3C, 0x66, 0xC0, 0xC0, 0xC0, 0x66, 0x3C, 0x00 }, // C