[A83] Re: smc


[Prev][Next][Index][Thread]

[A83] Re: smc



Jens Björnhager writes:
> Care to give a few examples on how and why smc can improve
> performance?

Sprite routines are a good example.  While doing clipping in a sprite
routine is not the fastest method, it can be sped up by modifying the
drawing part after clipping is calculated.  Shifting in the inner loop can
be done quickly using a series of 16-bit adds with a jump to the proper
instruction number.

Code space and time can be saved by modifying a constant load's value
directly instead of loading from an external address.

As with everything else, it is important to remember that a better algorithm
or method is much more important than saving a few cycles with tricks.  You
can make a very fast clipped sprite routine, but it will almost always be
faster to simply use a larger buffer and clip when copying the buffer.  A
fast scrolling routine will be beat by a routine that redraws everything
using lookup tables.

You want to start looking at tricks like self modifying code when you have
the fastest algorithm.

-- 
David Phillips <david@acz.org>
http://david.acz.org/




Follow-Ups: References: