Epson Research and Development
Page 29
Vancouver Design Center
Programming Notes and Examples
S1D13704
Issue Date: 01/02/12
X26A-G-002-03
Panning to the right.
StartWord = GetStartAddress();
Sta+;
SetStartAddress(StartWord);
Panning to the left.
StartWord = GetStartAddress();
StartWord --;
if (StartWord < 0)
StartWord = 0;
SetStartAddress(StartWord);
Example 4: Scrolling (Up and Down)
To scroll down, increase the value in the Screen 1 Display Start Address Register by the
number of words in one virtual scan line. To scroll up, decrease the value in the Screen 1
Display Start Address Register by the number of words in one virtual scan line.
Step 1: Determine the number of words in one virtual scanline.
bytes_per_line = pixels_per_line / pixels_per_byte = 320 / 2 = 160
words_per_line = bytes_per_line / 2 = 160 /2 = 80
Step 2: Scroll up or down
To scroll up.
StartWord = GetStartAddress();
StartWord -= words_per_line;
if (StartWord < 0)
StartWord = 0;
SetStartAddress(StartWord);
To scroll down.
StartWord = GetStartAddress();
Sta= words_per_line;
SetStartAddress(StartWord);
long GetStartAddress (void)
{
return (REG[0D] * 256 +REG[0C];
}
void SetStartAddress (long StartWord)
{
REG[0C] = StartWord & 0xFF;
REG[0D] = StartWord / 256;
}
*