Skip to content
Techniques & Technology

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.

commodore-64graphicsspritesrastervic-iidemoscene1989–present

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 $d017 to 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

Not yet fact-checked. This entry was drafted by an AI and nobody has verified it. The dates, figures and technical details may be wrong. Use it to find your bearings, then confirm anything that matters against a primary source.