Sprite stretching
Telling the VIC-II to read the same line twice
Holding the C64's sprite graphics pointer still for a raster line so the same row of sprite data is drawn again, stretching a sprite to any height. The forgiving half of a pair whose other half needs cycle-exact timing.
The VIC-II advances an internal pointer through a sprite’s graphics as it draws down the screen. Sprite stretching stops it advancing, so the same row is drawn again:
Sprite stretching uses the technique of setting the bits of
$d017to 1, and then back to 0 on the next rasterline. This will fool the VIC not to increase the internal sprite-gfx-pointer and display the same line of sprite-graphics again.
Repeat per line and the sprite becomes as tall as you like — “you can decide how many times each line of sprite-graphics will be shown.”
The cost is a write on every line
The register has to be rewritten twice per raster line, driven from a table: set from the table, cleared, set again. That is raster time spent for as long as the stretched sprite is on screen.
Who did it first
Bob/Triad, in Cocktail, on 26 February 1989.
The forgiving half of a pair
Stretching has a much harder sibling, sprite crunching, which can also stretch — but the crunching page tells you not to bother:
Actually it is possible to stretch sprites with the same technique, but that can be done much easier with normal
$d017-stretching. This is nothing you do if you don’t really need it.
See also
- Sprite crunching — the hard one, and it shrinks
- Sprite multiplexing
- Sprites