Other C64-related stuff -> http://www.iki.fi/a1bert/Dev/

A couple of previews for VICI ITERUM MMII that runs on the unexpanded VIC20.
Code by Albert of Pu-239, music by Anders Carlsson Goto the VIMMII page.

VICI ITERUM MM

Autodetecting PAL/NTSC version for 16k mem expansion - Supports 1540/41,1570/71,1581
Copyright © 2000 Pasi Ojala, Anders Carlsson - Dec 20th 2000
Download it from here: vimm.zip vimm.d64.gz
Serious note: run this demo on a real VIC20.
If you use VICE, use this palette: 6561-101.vpl

Introduction

Writing this VIC20 demo started a long, long, long time ago, in a galax.. Ahem. A friend gave me a VIC20 around 1989, and I played with it a bit, converting some C64 fonts to VIC's 16x8 font system. Nothing really became of it though, because I didn't have time or great motivation to really study the operation of the chips inside the VIC20. I just continued to write C64 demos.

Quite a many years later, working with Marko Mäkelä rekindled my interest in VIC20, and I started to convert some of my C64 effects to VIC20. Meanwhile, Marko spread the VIC20 'awareness' and programming information and created the "Veni Vidi Vic!" demo. Although impressive on its own right, I already had a VIC20 version of my "trademark", the copper scroller, and were in the process of creating more parts to surpass that first and only VIC20 megademo.

As so many times before and since, other interests (programming or otherwise) also required their slices of my free time, but finally I just decided that this year is it, and started to think about a name. The latin theme Marko (and the Commodore marketing) started seemed a good idea, and also including the year created the name: "Vici Iterum MM", freely translated as "Won again, 2000", or maybe "VIC again, 2000", or combined "VIC won again, 2000".

The four or so parts I had sort of ready when the year 2000 started still required tuning, linking, music and additional parts. All other I could handle, but music was the greatest catch-22. Fortunately Anders Carlsson answered my call for help (twice even:-) and I could count on him to provide me with a tune or two. The rest was just a matter of thinking up more demo ideas (of course some of them are left for future productions), figuring out the algorithms, programming the code, creating and converting the graphics, writing scrolltexts, adding fadein and fadeout effects where appropriate, compiling, compressing with pucrunch (see http://www.iki.fi/a1bert/Dev/pucrunch) and testing.. :-)

The following goes through the parts in the order they are shown in the demo. Note that the explanations concern the PAL versions of the parts. In NTSC versions part of the effects may be left out, or downsized, like some of the stuff on screen (PAL has a larger viewable screen size). Still, all of the parts have their essence there in both PAL and NTSC versions, mainly because I did not NTSC-fix them, but simply concurrently developed both PAL and NTSC versions: both are compiled from the same source.

Some of the parts would have totally different implementations, if they were written only for NTSC machines, but I didn't have time for that. Btw, did you know that the video matrix can be as large as 1024 bytes? Although that doesn't always help, because then you can't double-buffer the color memory if you use it all.

The fastloader used is based on the fastloader © 1998 Marko Mäkelä. (As found in the "Veni Vidi Vic!" demo in ftp.funet.fi:/pub/cbm/) All music composed and/or arranged by Anders Carlsson. The music routine written by Anders Carlsson, based on Asger Alstrup's routine from "Veni Vidi VIC!" and Adam Bergström's in VICPLAY (unreleased).

Okay, enough of introduction, just load vimm.prg, run it and watch the demo and read the part-by-part descriptions.

Other stuff:


1. VIMM - simple upscroller

I always wanted to create an upscroller part when I was writing demos for C64, but it took until 1998 before I finally implemented one for the "Roots" megademo for Zoo'98. In that demo the upscroller was the last part giving the demo credits.

VIMM (Vici Iterum MM) needed a loader part, which would also give some facts about the system and the operating instructions (pressing X or joystick button selects manual mode). To be as clear as possible, the part would need quite a large font, and an upscroller was the perfect choice. I also had a font idea, and that font was originally used for this starting part and later also for the last part.

However, using the same font for two parts seemed lame, and I tried another font idea to see how it would work. I spent a couple of hours beside my A3000 drawing, which showed that the idea would work fantastically. A lot of tinkering later you see the result. A little more resolution would've helped, but the end result isn't half bad.

This starting part also detects the video system and installs the first music and the 154x/157x/1581 fastloader, which is based on Marko Mäkelä's fastloader.

Other stuff:


2. VICPIC - FLI-type graphics mode

VIC-I (the video chip in VIC20) does not have a bitmapped mode, thus all graphics must be created with user-defined character sets. To allow more screen area to be covered, VIC-I has a 16x8-character mode, in which the normal character height is doubled from 8 bytes to 16 bytes. Because there is no bitmap mode, in multicolor mode three colors are common to the whole screen area and the fourth is read from the color memory.

I have played with C64 graphics converters in the past and decided to create a raster-assisted graphics mode (not quite FLI) for VIC20. Using a graphics converter would not require a drawing program (and I'm a poor graphician anyway), and the converter can perform dithering and as clever color selection as I can manage to program.

I tried different aspect ratios, but 100x160 (width x height) pixels seemed the best for several reasons:

The color memory resolution was increased from 16-line cells to 8-line cells by duplicating the video matrix and multiplexing the two color memories.

Some of the pictures I had converted seemed quite cool, thus creating a slideshow part for this "ultimate" VIC20 megademo was a must.

Other stuff:


3. TECH^2 - Tech-tech and DYCP in one

Two simple effects, mainly to see how they are done in VIC20.

VIC-I doesn't have a smooth-scroll register, but the screen can be shifted in half-character (one clock cycle) increments. Because of this the tech-tech effect fine-adjust must be done using character sets and the coarse-adjust with screen positioning, just the opposite way than in C64.

DYCP can be implemented just like in C64, the 16x8-character mode does not help in this case. Double-buffering is needed and is used. There was just enough free time to add the color cycling, although double-buffering the color memory was not possible (sorry). You can notice the lack of color memory double-buffering when you set the sin(up-down) speed high enough.

I had some of the character codes and part of the character set memory free, so I decided to add a little pacman-bonus to this screen.


4. PLASMA - a multicolor plasma w/ 13 colors

The plasma part was one of the latest additions to this demo. "Veni Vidi Vic!" had a black'n'white plasma effect, and I had created a sprite plasma effect for "Roots" (just one of my crazy ideas), so why not make a better one for VIMM?

VIC-I color restrictions really are restrictions. Two of the screen colors can only be colors 0-7, while the other two can be any of the sixteen colors. Not using half of the colors seemed so uncool, especially because orange and light orange create one more color scale. With careful planning the plasma effect actually uses 13 of the 16 possible colors, and the reason why not all of them are used is simply that the remaining 3 colors just didn't fit in the color scheme..

The more or less smooth scrolling needs some raster trickery to make it appear that the whole screen area is covered. Another sleigh of a hand tries to convince you that we are in 8x8-character mode, although for that you would need a 1008-byte video matrix (28 columns, 288 raster lines in PAL).

Other stuff:


5. COPPER - Copper scroller, "curtain" display, "sprite" plotter

One of my specialties in C64 demos besides sprite stretching is copper effects, where the screen could be blanked and all that you could see was created by changing just the border color synchronized to the screen refresh. Knowing this you should not be surprised when you see this part. The top scroller is created by changing the background color register with the processor while the VIC-I chip is drawing it. For VIC20 version I also added a character overlay to make the font clearer.

The middle of the screen implements my idea of a curtain scroller, where the text is hidden and/or reappears with differend 'fade' effects. If you are familiar with VIC-I and/or raster bars, you may notice that in fact creating that effect is not so easy after all.. If you don't know why, the effect may still look cool :-)

Using double-buffered copper code left some raster time still unused so I decided to try implementing my first sprite plotter for VIC20. The result may not be so impressive, but it fills the bottom of the screen nicely.. The NTSC version only has two sprites, because clearing the plot area takes so much time.


6. SHEKKI - Double checkerboard and scroller

"Veni Vidi Vic!" had a chessboard zoomer and Marko Mäkelä suggested that I make a version with two chessboards zooming independently. The result was quite good, but a good idea can sometimes be made better.

Anyone can think of how the boards are implemented (multicolor mode, character set plotter, and raster routine), but some tricks were still unused. The letters PU239 are flashed on top of the zoomer and like that weren't enough, the Pu-239 logo appears and disappears after a while.

Still I had the feeling that something else can be added to make this part even better. When I saw a checkered flag waved on TV, I knew what I had to try: wave it. After hard and long code optimization I managed to make one of the boards wave both horizontally and vertically, while the other board waves only vertically. (And not even that in the NTSC version.)

Taking into account that the horizontal resolution is one multicolor pixel, and the vertical resolution is three raster-lines, the wave effect seems even cooler. Integrators/accumulators rule -- real-time dithering!

Other stuff:


7. CREDIZ - Overlapping scrolls with a twist

Again an idea which originated from "Veni Vidi Vic!", but only indirectly. One of the first parts in that demo has a flag zoomer, which shows the nationalities of the demo programmers/artists. My original idea was to have two scrolls in the cross formation and the border and backgrounds could be flashed to reveal the Finnish and Swedish flags (for me and Anders).

This required that the scrolls overlap and I first had to implement that. The flag color idea was dismissed because it turned out to be impossible because of the way I implemented the overlapping scrolls (and I wanted to use three colors for the font), but other ideas replaced that.

This part performs a lot of graphics plotting, but only as much as needed. On the other hand, plotting the overlap is slower than necessary because what you see as the black background is actually the border color, which has the bit pattern 01 instead of 00. Fiddling the bits around to produce the correct overlapping takes almost 40% of the plotting time. This was necessary because the screen is in fact shaped as a plus sign.

Because the vertical scroller is implemented by moving the screen (both vertically and horizontally), the horizontal scroller must always be plotted to compensate. This allows the effects you see in the horizontal scroller for little extra effort. Some of the effects remind us of sprite stretching. Two source images are used to implement half-cycle (one multicolor pixel) scrolling speed for the horizontal scroller.

Two fonts, the whole character set being used for graphics, two buffers for the horizontal scroller data, some tables, and the actual code makes it a tight fit. But there was some space left and I put in another pacman bonus..

Other stuff:


Source Code

The source code is provided for the interested parties to encourage the development of new and innovative software for VIC20, whether it is demos, games, or application software.

The source code is also provided in hope that more complete VIC20 emulators will be developed. When all of the demo parts are perfectly emulated, it will be pretty close.

Download the source: vimm-src.lha


To the homepage of a1bert@iki.fi