[Coco] Let's figure out the best method to compile sprites for the CoCo - Please add your input

William Astle lost at l-w.ca
Fri May 12 23:51:39 EDT 2017


On 2017-05-12 06:22 PM, Glen Hewlett wrote:
> Another thing to think about could be the order of colours in the colour palette.  The Power Pill sprite above uses $4 for black and $A for almost white in the palette table.  If the black was changed to the value $B in the palette, then it might be possible to use INCA or INCB or DECA or DECB to save a byte and cycle if the accumulators can be changed in that way.  It doesn’t seem to work with this sprite but it might for others.  Just a thought...

Actually, if you're referring to replacing a LDA or LDB with INCA/DECA 
or INCB/DECB, you do save a byte but you don't save a cycle. The 8 bit 
immediate load instructions are 2 cycles, the same as accumulator 
INC/DEC. It does save a byte, though, and that can be worth it.

It will always be faster to do a 16 bit immediate load compared to a 
pair of INC/DEC instructions. (16 bit immediate load of D is 3 cycles. 
Two INC/DEC instructions in a row is 4 cycles.)



More information about the Coco mailing list