
5 ADVANCED TECHNIQUES
C-2-16
EPSON
SID13705 PROGRAMMING NOTES
AND EXAMPLES
Examples
Example 1
In this example we go through the calculations to display a 640
× 480 image on a
320
× 240 panel at 1 bpp.
Step 1: Calculate the number of pixels per word for this color depth.
At 1 bpp each byte is comprised of 8 pixels, therefore each word contains 16 pixels.
pixels_per_word = 16 / bpp = 16 / 1 = 16
Step 2: Calculate the Memory Address Offset register value
We require a total of 640 pixels. The horizontal display register will account for 320
pixels, this leaves 320 pixels for the Memory Address Offset register to account for.
offset = pixels / pixels_per_word = 320 / 16 = 20 = 14h
The Memory Address Offset register, REG[11h], will have to be set to 28h to satisfy the
above condition.
Example 2
From the above, what is the maximum number of lines our image can contain?
Step 1: Calculate the number of bytes on each line.
bytes_per_line = pixels_per_line / pixels_per_byte = 640 / 8 = 80
Each line of the display requires 80 bytes.
Step 2: Calculate the number of lines the SID13705 block is capable of.
total_lines = memory / bytes_per_line = 40960 / 80 = 512
We can display a maximum of 512 lines. Our example image requires 480 lines so this
example can be done.
5.2 Panning and Scrolling
Panning and scrolling describe the operation of moving a physical display viewport about a virtual
image in order to view the entire image a portion at time. For example, after setting up the
previous example (virtual display) and drawing an image into it we would only be able to view one
quarter of the image. Panning and scrolling are used to reveal the rest of the image.
Panning describes the horizontal (side to side) motion of the viewport. When panning to the right
the image in the viewport appears to slide to the left. When panning to the left the image to appears
to slide to the right. Scrolling describes the vertical (up and down) motion of the viewport.
Scrolling down causes the image to appear to slide up and scrolling up causes the image to appear
to slide down.
Both panning and scrolling are performed by modifying the start address register. The start
address registers in the SID13705 block are a word offset to the data to be displayed in the top left
corner of a frame. Changing the start address by one means a change on the display of the number
of pixels in one word. The number of pixels in word varies according to the color depth. At 1 bit-
per-pixel a word contains sixteen pixels. At 2 bit-per-pixel there are eight pixels, at 4 bit-per-pixel
there are four pixels and at 8 bit-per-pixel there is two pixels in each word. The number of pixels
in each word represent the finest step we can pan to the left or right.
When portrait mode (see “7 HARDWARE ROTATION” on page C-2-25) is enabled the start
address registers become offsets to bytes. In this mode the step rate for the start address registers if
halved making for smoother panning.