
Epson Research and Development
Page 61
Vancouver Design Center
Programming Notes and Examples
SED1352
Issue Date: 98/10/08
X16-BG-007-04
void SetStartAddress(int x, int y)
{
int addr;
//
// Assume 16 gray shades
//
addr = (x/2 + (VIRTUAL_X/2) * y)/2;
WriteRegister(6, addr & 0xff);
WriteRegister(7, addr >> 8);
}
void PanScroll(void)
{
static unsigned int x, y;
static unsigned int MaxX, MaxY;
static unsigned int val, pitch;
static unsigned char _far *pVideo;
printf("Showing Panning and Scrolling\n");
Initialize();
ClearLCDScreen();
//
// This pitch is calculated for 16 gray shades
//
pitch = ((VIRTUAL_X / 2) - BytesPerScanLine) / 2;
WriteRegister(0x0d, pitch);
BytesPerScanLine = (VIRTUAL_X / 2);
//
// For 64k only
//
FP_SEG(pVideo) = 0xd000;
FP_OFF(pVideo) = 0x0000;
//
// Display random blocks of data. To do so, a text character will be used.
// This character sets all pixels in a character region, so a block is
// shown at the specified gray shade.
//
// Seed the random number generator with current time
srand((unsigned) time(NULL));