DENTHOR/ASPHYXIA'S VGA TRAINERS THE SCROLLING SAGA
This is Denthor here with the 5th part of the ASPHYXIA VGA Trainer Series: The Scrolling Saga. I have had many requests for information on scrolling, so I decided to make it this week’s topic. If you have ever seen a demo, you have probably seen some form of scrolling.
DENTHOR, coder for ... _____ _____ ____ __ __ ___ ___ ___ ___ __ _____ / _ \ / ___> | _ \ | |_| | \ \/ / \ \/ / | | / _ \ | _ | \___ \ | __/ | _ | \ / > < | | | _ | \_/ \_/ <_____/ |__| |__| |__| |__| /__/\__\ |__| \_/ \_/ firstname.lastname@example.org The great South African Demo Team! Contact us for info/code exchange!
Grant Smith, alias Denthor of Asphyxia, wrote up several articles on the creation of demo effects in the 90s. I reproduce them here, as they offer so much insight into the demo scene of the time.
These articles apply some formatting to Denthor's original ASCII files, plus a few typo fixes.
Our SILKYDEMO has quite a nice example of scrolling. What it is, is a long row of text moving across your screen, usually from right to left, e.g.:
What do we scroll?
Usually, letters. Most groups put greetings and information in their ‘scrollies’, as they are termed. You can also scroll and entire screen using the scrolling technique. Scrolling your text is a hell of a lot less boring then just having it appear on your screen. Unfortunately, ‘scrollies’ have been used so many times in demos they are wearing a bit thin, so usually they are accompanied by a cool picture or some nice routine happening at the same time (In our SILKYDEMO we had a moving checkerboard and colour bars going at the same time).
How do we scroll from side to side?
The theory behind scrolling is quite easy. Let us imagine that we are scrolling a 16x16 font grabbed by TEXTER (;-)) across the top of the screen (i.e. 320 pixels) As we know, the VGA screen starts at zero at the top left hand part of the screen, then counts up to the right to 319, then goes back to the left hand side one pixel down at 320 (see part 1). This means that a 16*320 scroller takes up the space 0 to 5119 on the screen. In ASCII this looks like this:
Simple enough. Now what we do is we put down the first Y-line of the first character onto the very right hand side of the screen , like so:
This will draw some stuff on the very right hand side. Your screen should now look like this:
Next, we move each line one to the left, i.e.:
This scrolls the screen from right to left, which is the easiest to read. To scroll the screen from left to right, swap the +1 onto the other side of the command. Also, to increase the size of the portion scrolled, increase the 15 to however many lines from the top you wish to
After this move, your screen will look like this:
What you then do is draw in the next line on the right hand side, move it, draw the next line, move it etc. etc. Tah-Dah! You have a scrolly! Fairly simple, isn’t it?
How do we scroll up or down?
To scroll up or down is also fairly simple. This can be used for ‘movie credit’ endings (I once wrote a little game with a desert scrolling down with you being a little robot on the bottom of the screen). The theory is this: draw the top line (or bottom line) then move the entire screen:
For scrolling down, or:
…for scrolling up. You then draw the next line and repeat.
Because of the simplicity of coding in a scrolly, most demos have one. It is usually best to have something extra happening on the screen so that the viewer doesn’t get too bored, even, as I say, if it is only a really nice picture.