
Epson Research and Development
Page 51
Vancouver Design Center
Programming Notes and Examples
SED1352
Issue Date: 98/10/08
X16-BG-007-04
// Since this demo program uses only 64k, the Display Start Address
// Registers must be adjusted to point to the D000 segment. To do so,
// note that these registers refer to words of data, not bytes,
// since the Memory Interface is set to 16 bits. Consequently adding
// the value 8000h (words) to the address registers will effectively
// add 10000h (bytes) to the address. Adding 10000h to C000:0000 will
// point to D000:0000, which is why this address correction works.
//
WriteRegister(7, 0x80); // MSB of Screen 1 Display Start Address
val = ReadRegister(9); // MSB of Screen 2 Display Start Address
val += 0x80;
WriteRegister(9, val);
//--------------------------------------
//
// Set Address Pitch Adjustment to 0
//
WriteRegister(0x0d, 0); // Write to Address Pitch Adjustment Register
//--------------------------------------
//
// Update Look-Up Table for 16 gray shades
//
for (x = 0; x < 16; ++x)
{
WriteRegister(0x0e, x);
WriteRegister(0x0f, x);
}
//--------------------------------------
//
// Now that system is initialized, enable LCDE
//
val = ReadRegister(1);
val |= 0x10; // LCDE enabled
WriteRegister(1, val);
}