This is an old revision of the document!
Sprite vectors
Basically one can also draw edges by displaying sprites and manipulating there x position per line. If done so from left to right and with rising priority, several edges can be stacked and thus a vector being build. The rightmost edge then needs to be drawn in background color. But faces might not get bigger than 24 pixels and higher than 21 pixels, a bit small. Also other restrictions hit in, like badlines which makes it impossible to manipulate all sprites each rasterline.
As a first step, we can expand all sprites in X and Y to achieve more effect area, but this is still not satisfactory. As we inspect the shape of a cube, we notice, that it maximum has 3 edges on the left side and a final edge at the right to separate it from the background. So if we manage to display those 4 edges with 4 sprites, we are already on a good way and only need to change 4 x-positions per rasterline, do we? As for the height, we can make use of the sprite stretching trick to make the sprites up to 200 pixels high or even beyond. Happily, this trick also gives us other advantages, as we can switch sprites on/off by omitting a stretch for a single sprite at any given line. Means, our timing over the whole screen will stay the same for each rasterline and thus we can easily use unrolled display code.
First gap sprite with static x position being underlayed
Second gap sprite with static x position being underlayed
Still a small gap left, need to underlay another sprite
The display code looks like this:
ldy #$ff ldx #$ff lda #$00 ;corresponding bit for each sprite is set here if we want to ;advance one line in sprite -> on/off sta $d017 eor #$ff sta $d017 sty $d006 lda #$3b ;value is advanced each line to supress badlines and repeat last screen line stx $d004 ldy #$ff ldx #$ff sta $d011 sty $d002 stx $d000 nop
to be continued soon…