S.D.S. & O.L.V.A. - new raster tricks

Basic and Machine Language

Moderator: Moderators

Post Reply
mercifier
Vic 20 Drifter
Posts: 23
Joined: Sun Jun 18, 2006 4:17 pm

S.D.S. & O.L.V.A. - new raster tricks

Post by mercifier »

During the last months I've been exploring the VIC-I chip a bit, and more or less by accident I've found no less than two different ways to scroll the screen vertically by one line, instead of two lines. After searching the Internet for information on known raster tricks on the VIC-20, not finding anything similar, and now also verifying that the latest version of VICE doesn't recognize these tricks, I feel that destiny wants me to reveal them. (Assuming nobody discovered this before, but kept it a secret.)

SDS is short for Suspended Display Start, and it's the most convenient way to position the display to start on any line, not just even ones. It's done by setting $9000 to a high value. I'll be back soon with a little demo demonstrating this, and further explanation on how it works.

OLVA is short for Odd Line Vertical Alignment, as opposed to Even Line Vertical Alignment, which is the normal operation of the VIC-I. When $9000 (horizontal position) is set to zero, two things happen with the display. 1) There is one extra raster line of garbage showing at the bottom of display, and 2) the whole display is moved down one line, relative to other values in $9000. This can be demonstrated by the following POKES:

POKE 36864,1 - just moves the screen to the left
POKE 36864,0 - screen jumps 4 additional pixels left, and one line down. Garbage at bottom.

It surprises me that noone have noticed this before. When doing it in VICE, the garbage line is indeed shown, but the vertical screen position does not differ.

OLVA can be used to position the display to start on any line this way: For even lines, set $9001 as you would normally. For odd lines, set $9001 to the closest lower (even) value, and during VBlank, set $9000 to zero. Now the display won't start on the even line. To get the screen where you want it, horizontally, set $9000 to normal value before the end of that line. Voila!

Both SDS and OLVA have been tested on two different PAL machines. One of the old kind with two-prong 9v AC power input, with swedish characters and serial number 'WG A40405'. The other is the newer kind with DIN power input and international keyboard. It has serial number 'WG C192xxx'. (Don't remember the exact number.) It seems like these features are common to all PAL VIC-I's. NTSC chip remains to investigate.
a1bert
Vic 20 Dabbler
Posts: 96
Joined: Mon Jan 23, 2006 12:49 am

Post by a1bert »

Yes, well, theSDS has been used by I think Aleksi Eeben in one of his demos (interlaced upwards scroller if I remember correctly). At least I have heard about it before.

Using $9000 = 0 for vertical scrolling is a new idea, I think.
Unfortunately in NTSC the value is different..

-Pasi
TMR
Vic 20 Amateur
Posts: 65
Joined: Fri Jul 01, 2005 3:00 am

Post by TMR »

a1bert wrote:Yes, well, theSDS has been used by I think Aleksi Eeben in one of his demos (interlaced upwards scroller if I remember correctly). At least I have heard about it before.
Someone passed me their demo coding notes over a year ago and this technique was documented there, if memory serves, so it's fairly well established already.
mercifier
Vic 20 Drifter
Posts: 23
Joined: Sun Jun 18, 2006 4:17 pm

Post by mercifier »

It must have been discovered quite recently (during the last couple of years or so) and/or kept secret by the discoverers, because I've seen a lot of programs obviously not using anyting but standard vertical scrolling. Even software made later than 2000.

Do you know the name of a demo using this?

Another thing: Is there any interlace mode on PAL machines? I can not notice any difference when turning it on. If there is, it would be possble to scroll smoothly by 1/2 a line per frame...
a1bert
Vic 20 Dabbler
Posts: 96
Joined: Mon Jan 23, 2006 12:49 am

Post by a1bert »

mercifier wrote:It must have been discovered quite recently (during the last couple of years or so) and/or kept secret by the discoverers
It is post-2000, yes. There has not been much vic20 demo coding discussions anywhere, so it has only come up in private mails. Anyway, it is close to what $D011 does in VIC-II, so maybe that is why there has not been any fuss about it. I seem to have a mail dated 14 Jun 2002 from Aleksi Eeben mentioning it.

I found out that scrolling by only one line is too slow for most applications anyway.
mercifier wrote:Do you know the name of a demo using this?
It is fully possible that that code has not been used in any released production.
mercifier wrote:Is there any interlace mode on PAL machines?
No, interlace is only available in NTSC.

-Pasi
mercifier
Vic 20 Drifter
Posts: 23
Joined: Sun Jun 18, 2006 4:17 pm

Post by mercifier »

a1bert wrote:I found out that scrolling by only one line is too slow for most applications anyway.
But what about 3 lines, or 5? =)

However, it's encouraging to realize that there are still things to discover. These tricks are really very simple, you don't even have to have a stable raster routine to make it work! Who knows what else hides inside the VIC-I chip? Tweaking its registers on cycle timing basis may cause effects which are still left to reveal...
Post Reply