5.6 Hardware Scroll Hardware Scrolling
The following text describe techniques to do continuous hardware
scroll with STe and FALCON machines. This technique make the scroll in
very little time.
With continuous I mean, scroll like to XENON or IMPOSSAMOLE but fine. Is very possible that ZOOL and ENCHANTED LAND uses such
techniques.
You must know how make normal hardware scroll (you must know
exactly how control $FF820F and $FF8265 registers), ok?.
To make horizontal scroll one pixel for every VBL at the left
direction, make the following passes:
1) Define two contiguous screens (320X200 and 320X200) ($FF820F=80) 0 319 |0 319 ------------------------------|------------------------------ 0 | | | | | | | main | secondary | | | | | screen | screen | | | | | | | | | | 199------------------------------|------------------------------
2) Now you must write some graphics at right border in secondary screen. 16 bit wide for example: 0 319 |0 15 319 ------------------------------|------------------------------ | | | | | | extra | | | | | | | |graphic| | | | | | | | | | | | | | | | | | ------------------------------|------------------------------ ^----current visible window---^
3) On the first VBL it's necessary to scroll one pixel ($FF8265=1)
19) Now it's necessary copy the 1600 bytes (8 bytes for every
plane * 200 lines=1600 bytes) of the new graphics zone to old graphics
zone screen (the left zone):
|<<<<<copy byte here<<<<<<<<<<| | | 0 15 319 |0 15 319 ------------------------------|------------------------------ | | | | | | | | | | | old | | new | | | | | | | | zone | |graphic| | | | | | | |screen| | | | | | | | | ------------------------------|------------------------------ ^----current visible window----^
0 15 319 |0 15 31 319 ------------------------------|------------------------------ | | | | new | | | | | | | | | old | | | extra | | | | | | | | | zone | | |graphic| | | | | | | | |screen| | | | | | | | | | | ------------------------------|------------------------------ ^-----current visible window---^ Now control $FF8265 register in order to repeating pass 3 to 18
and another time more, copy new graphics zone to old graphics zone
(pass 19):
|<<<<<copy byte here<<<<<<<<<<| | | 0 15 31 319 |0 15 31 319 ------------------------------|------------------------------ | | | | | new | | | | | | | | | | | old | | | extra | | | | | | | | | | |graphic| | |graphic| | | | | | | | | | | zone | | | | | | | | | | | | ------------------------------|------------------------------ ^----current visible window----^
The process is repeated until when the current visible window is
the secondary window and the main screen is a copy of the secondary
screen:
0 319 |0 319 ------------------------------|------------------------------ | | | | main screen is exactly | secondary screen is | | | | | like to the secondary | exactly like to main | | | | | screen | screen | | | | | | | ------------------------------|------------------------------ ^----current visible window---^
At this point, you must set the main screen pointers (FF8205,7 and
9) to point to the main screen (another time more):
0 319 |0 319 ------------------------------|------------------------------ | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------|------------------------------ ^----current visible window---^
How you see, only 1600 bytes is copied every 16 VBL. If the scroll
is at two pixel (more speed) for every VBL, you must copy 1600 bytes
every 8 VBL etc.ok? this is very easy!! no?
Do you imagine how make the vertical scroll?.
First you must make two screen one above the other one. Second you
now must copy 160 bytes every VBL from "the new line" to
"the old line".
Mixing the above techniques make possible multi-directional (8
directions) scrolling.
Copyright © Robert Schaffner (support@doitarchive.de) Letzte Aktualisierung am 23. Dezember 2003 |