Commodore 128 Programmer's Reference Manual page 331

Hide thumbs Also See for 128:
Table of Contents

Advertisement

PROGRAMMING THE 80-COLUMN (8563) CHIP
321
'
VERTICAL SCROLLING
Scrolling in the vertical direction is easier than scrolling horizontally. The general
i j
algorithm to scroll vertically is as follows:
/ \
1.
Set the default start of the character RAM storage to $2000 in 8563 RAM.
f"!
This is done through writing to (or using the default contents of) registers
/ |
12 ($0C) and 13 ($0D). Now location $2000 in 8563 RAM marks the start
of the first character in the upper left corner of display memory (the HOME
"
position).
■ ;
At this point, the size of the screen is 80-by-25 and the screen RAM
locations are from $2000 through $27CF in 8563 RAM. Therefore, the first
^
80 bytes store the first 80 characters in the top row of the 8563 screen.
| !
2.
Now add 80 ($50) to the low byte of the display RAM Pointer, register 13.
1 '
Now the second 80 bytes of the display RAM memory are displayed as the
first character row. The screen is now defined by locations $2050 through
PI
$28IF in 8563 memory. This moves the characters up one character row. The
' '
"old" first character row has moved off the top of the screen and the "new"
character row has moved onto the last character row of the screen from a
P
previously non-visible range in display area. The new character row should be
i !
defined in 8563 RAM before it is moved onto the screen as the last character
row.
r-i
3.
Though this moves an entire character row of display RAM up by one row,
I ^
the movement is sudden, abrupt and not smooth. The 8563 allows smooth
scrolling to occur vertically, through the lower four bits of register 24 ($18) in
0
the 8563.
: 1
To scroll smoothly one scan line at a time, write the value 1 to register
f
24. This moves the entire screen up by one scan line. The first previously
visible scan line is now off screen at the top and a new scan line is scrolled
PI
from an off screen location from the bottom onto the last visible scan line of
' s
the screen.
4.
To scroll subsequent scan lines, increment the value of the lower four bits of
p
register 24. By incrementing this value to 2, the entire screen is smoothly scrolled
1 \
an additional scan line.
5.
Continue to increment the value in register 24 until the value equals the value
(—>
stored in the lower four bits of register 9, the total number of vertical scan
| I
lines of a character. Once these values are equal, only the bottom scan line of
the first character row is visible at the top of the screen, and all but the
last scan line of the newly scrolled data is visible at the bottom of the screen.
■ |
6.
To continue to scroll, reset the value in the lower four bits of register 24 to
' !
zero and add 80 more locations to the contents of the display RAM pointer as
you did in step 2.
H
If you plan to use attributes, you must increase the value of the attribute
■ ; I
start pointer also to keep up with the display RAM pointer.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents