Page 84
Epson Research and Development
Vancouver Design Center
S1D13503
Programming Notes and Examples
X18A-G-002-06
Issue Date: 01/01/30
static unsigned int MaxX, MaxY;
static unsigned int val, pitch;
static unsigned char _far *pVideo;
static unsigned char bank, color;
printf("Showing Panning and Scrolling\n");
Initialize();
SetDisplay(OFF);
ClearLCDScreen();
switch (PanelGrayLevel)
{
case 16:
pitch = (unsigned int) (((VIRTUAL_X / 2) - BytesPerScanLine) / 2);
BytesPerScanLine = (VIRTUAL_X / 2);
break;
case 256:
pitch = (unsigned int) ((VIRTUAL_X - BytesPerScanLine) / 2);
BytesPerScanLine = VIRTUAL_X;
break;
}
WriteRegister(0x0d, pitch);
//
// Access memory banks
//
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));
for (x = 0; x < 300; ++x)
{
if (((rand() * 2L) / RAND_MAX) == 1)
bank = BANK0;
else
bank = BANK1;
electronic components distributor