Epson Research and Development
Page 61
Vancouver Design Center
Programming Notes and Examples
S1D13503
Issue Date: 01/01/30
X18A-G-002-06
//
// Line Byte/Word Count Register
//
// Bits 0-7 are in AUX[2], Bit 8 is in AUX[3].
//
// Because the Memory Interface is set to 16 bits, the
// Line Byte/Word Count Register counts in words.
// To calculate the Line Byte Count for different numbers of
// gray shades/colors, use the following formula:
//
// BitsPerPixel
// ---------------------- x Horizontal Resolution - 1
// Memory Interface Width
//
switch (PanelGrayLevel)
{
case 2:
val = (PanelX / 16) - 1; // For black and white mode
break;
case 4:
val = (PanelX / 8) - 1; // For 4 gray shades/colors
break;
case 16:
val = (PanelX / 4) - 1; // For 16 gray shades/colors
break;
case 256:
val = (PanelX / 2) - 1; // For 256 colors
break;
}
WriteRegister(2, val & 0xff); // Line Byte/Word Count Register
val2 = (val >> 8) & 0x01;
if (PanelD == PANEL_COLOR)
{
val2 |= 0x06; // Select color mode and 256 colors
if ((Interface == 8) && (PanelF == 2))
val2 |= 0x08; // Select format 2
}
WriteRegister(3, val2); // Mode Register 1
//
// BytesPerScanLine is a global variable
//
switch (PanelGrayLevel)
{
electronic components distributor