Jump to: navigation, search

Programming:Fast Sprites

692 bytes added, 01:41, 13 July 2006
jr rowloop
'''Further Optimisation'''
This code could be further improved by unrolling the loop, but that would involve using some self modifying code to patch the '''rowloop''' jumps. If you have a number of predetermined widths for your sprites, you could rewrite the routine unrolled for each available size. Note that this could make it difficult later if you want to clip the sprites.
If you don't need to either paint the sprite in a solid colour, or flip the sprite left to right (or you've got enough memory to store a flipped version), then you can optimise the routine to plot a single byte even further:
<tt>ld a,(bc):inc c<br>
ld l,a:ld a,(de)<br>
and (hl):or l<br>
ld (de),a:inc e</tt>
[[User:Executioner|Executioner]] 19:55, 12 July 2006 (CDT)