Atari coding BBS
|Compiled sprites madness!|
Posted by: ggn
So I was talking to a couple of distinguished gentlemen the other day (who shall rename nameless) and we came upon the topic of fast sprite routines. I suppose I'll spare you the details but I will outline a few simple steps to show you the evolution of some of the ideas tossed around.
1. First iteration was to preshift the sprite 16 times, then convert each frame to a soup of move.w x(a0),(a1)+ / and.w #y,x(a0) / or.w #z,x(a0) for saving background, masking and blitting the sprite.
2. An Obvious optimisation there would be to skip blank words and not mask at all when the word is full, i.e. replace the and/or above with a plain move.w.
3. Another obvious one is to extend to move.l.
4. Yet another one is to use movem.w/l for cases where it makes sense.
5. Then things started spiralling out of control when someone (all right, it was me) suggested that maybe it would be a huge win to keep the most frequently used masks in registers so they can be applied a bit faster. This implies to make a pass of the frame, keep statistics and then deciding which ones to keep.
6. Further down the rabbit hole, why not catering for .l as well as .w masks?
At the moment that's where we're at. I was just curious if anyone had any other ideas they could share. Or even a completely different approach. I suppose we could even set up a couple of test images so we could measure different algorithms if there's any interest.
So, any takers?
[All messages in this thread]