Commodore 64 Demos and Utilities
I did a lot of machine-language programming on the Commodore 64. A lot of my work was Demoscene back before there was a name for it.
Here is an example:
24 Self-Moving Sprites
I wrote a program that provides the BASIC user with up to 24 sprites that move on their own, at any desired X and Y velocity to a precision of 0.00586 pixel per frame. The sprites can each have their own shape, color(s), position and velocity. The BASIC programmer controls the sprites by modifying parameters in memory, the same as for the 8 hardware sprites, except that there are 24 sprites and they have an extra 4 bytes (two 16-bit values) for the velocity. My program runs as an interrupt handler, running 16 times per frame (nearly 1000 times per second). In addition to "cycling" the 24 virtual sprites through the 8 physical registers, and updating the positions of the sprites according to the current velocity register values, it also has to keep its list sorted by vertical position.
The BASIC program shown here uses 14 sprites moving horizontally. There are 7 pairs of sprites, each moving at a constant speed to the right, and each pair moving 4 times as fast as the pair above it. As the text indicates, it was used to generate a timing signal useful for video editing.
The exposure time of this image was 1/30 second, so there are double-images of the faster-moving sprites. The white text labels e.g. +-------8 frames--------+ show how long it takes the sprites in each row to move the length of the horizontal line.
This page was written in the "embarrassingly readable" markup language RHTF, and was last updated on 2011 Aug 28. s.27