Cymric wrote:
Can someone explain how that was done?
The programmer's description was pretty accurate.
Take a couple pieces of paper. Draw an image on one in pencil. Now set the 2nd piece to the right of the first. Draw the continuation of that image on the next piece of paper. Now slide them to the left until the 2nd one is sitting where the first one was. Now erase the picture on the first piece of paper, set it to the right of the other piece and draw a continuation of what is on the 2nd piece.
That's a simple way of showing what is going on.
However, on the computer you start drawing once a part of the displayed image is offscreen so you don't have to draw the entire thing at once.
The difficulty is calculating when you can start drawing to the image that is onscreen, updating the copper list, etc.
You have to use a consistant timer to trigger the copper list update for smooth scrolling. Probably an interrupt driven counter. The interrupt handler updates the copper list and a counter telling the rest of the game where the screen is. It could also update sprites for clouds or whatever but the handler needs to be small.
I'd say the counter is used as an index into a table for updating the copper list and you just copy from the table into the copper list or point to a new copper list.
When the screen gets scrolled to a certain point you can draw a porting of the screen. Usually just blits of blocks or sections in a list of what goes on the screen horizontally. For example, if the screen is split up so that it is 16 blocks high, the dataset will have 16 numbers telling the draw routine what image is to go into each of those blocks. The block could be an image of a brick, metal plate, piece of sky, mountain, Tree, whatever. The program just loops through the data blitting the appropriate block into each place from top to bottom.
It's just repeated over and over as you go and once you get to a screen is no longer visible you update the copper list to place it to the right.
Lots of looping and swapping pointers to things around for what screen is on the left or right.
Any objects that do more than scroll or appear over the backdrow are sprites so you don't have to update the buffer... the sprites just overlay it and can be moved on their own or you can have a more complex copper list that uses a split screen top and bottom. However, there are limitations to that (2 scan lines have to be blank or something like that between top an bottom sections)
Once you get the hang of it it's not bad.
You just have to calculate where or when every event takes place. Draw blocks, update copper, swap screens left-right, etc.
You have to calculate:
How many copper moves between drawing to the screen. (if copper moves > width of blocks then scrollposition++;
When to swap the screens (If scrollposition > width of screen then temp =left; left = right; right = temp; scrollposition = 0; whatever)
Where blits are on a screen for a specific scollposition (a table).
What to draw... you can start with simple blocks and create a data set to scroll through in an endless loop just to get the scrolling working.
How to draw. (
for(i=0; i<16: i++) Drawblock( Screenmap(scrollposition, i), scrollposition, i)

Something like that where Screenmap is the data set telling what is displayed at any point along the way and it is 16 blocks high.
Once you get the hang of it you can increase the complexity by adding more data and having stages. Once you get to a certain point you load a new set of image blocks to display and the data telling which ones go where.
I think there's actually code on Aminet that does this. At least there used to be. Probably a game that includes source.
The second thing which always bugged me were letter transformation tricks in the greetings of demos (and of course, cracks). Letters would be positioned along a sine wave, or bump, stretch and be mangled in various other ways. Nowadays, I would just define the letter as a 3D-shape and let the 3D API of my gfx-card handle it; CPU power is cheap. However, in those days we just had a 68000 and a Blitter. (And a Copper). How do you do a sine scroller with that kind of hardware?
Look at some of the demo source code... I know there is some out there that does this because I modified it for a store demo.
Keep in mind that demo's rarely do things in a system friendly way and don't work on all machines.