Epson Research and Development
Page 73
Vancouver Design Center
Programming Notes and Examples
S1D13503
Issue Date: 01/01/30
X18A-G-002-06
val2 = ReadRegister(3);
val2 &= 0xfe; // Clear bit 0
val2 |= (val >> 8) & 0x01;
WriteRegister(3, val2); // Mode Register 1
PanelGrayLevel = 256;
ShowVerticalBars(pVideo, 0);
//
// Show text. The lightest color is set to PanelGrayLevel-1.
//
ShowText(pVideo, BANK0, "Horizontal/Vertical Bars at 256 Colors", PanelGrayLevel-
1);
SetDisplay(ON);
Delay(2000);
}
else
SetDisplay(ON);
ShowMenu();
}
//-------------------------------------------------------------------------
//
// 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).
//
//-------------------------------------------------------------------------
void ShowText(unsigned char _far *pVideoStart, unsigned char bank, char *str, int
color)
{
static const unsigned char *pFont;
static unsigned char _far *pVideoFirstColumn;
static unsigned char _far *pVideo;
static unsigned char ch;
static unsigned int y, val, Video;
static unsigned int count;
//
// Each letter in the font is 8 x 8 bits
//
#define MAX_FONT 97
static const unsigned char font[MAX_FONT][8] =
{ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // (blank)
electronic components distributor