Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: Camdenmil on September 02, 2011, 06:17:30 pm
-
I'm making a game that uses 4x4 sprites. Does anyone have a fast way for drawing 4x4 sprites? Right now I'm using nib{ to copy to the buffers.
-
Just treat it like an 8x8 sprite. That's the fastest way because nib{ is basically a combination of 8-bit storing and masking anyway.
-
So I just draw it the same way as an 8x8 tilemap except with twice as many pt- commands.
-
If you are drawing a tilemap, it actually might be better to do something clever by adding values and only storing once to each byte, that way you are using 768 byte store commands instead of twice as many nibble storing commands. You could do something like:
A*256 + B -> {L6+L}
where A is the nibble of the first sprite, B is the nibble of the second sprite, and L is your offset. Does that make kinda sense?
-
If anyone wants to make an Axiom, Xeda, Runer, and I made a couple of ASM routines.
http://ourl.ca/10793
Builderboy's idea is probably the best solution for pure Axe, though.
-
If you are drawing a tilemap, it actually might be better to do something clever by adding values and only storing once to each byte, that way you are using 768 byte store commands instead of twice as many nibble storing commands. You could do something like:
A*256 + B -> {L6+L}
where A is the nibble of the first sprite, B is the nibble of the second sprite, and L is your offset. Does that make kinda sense?
I thought about that way but I couldn't figure out how because I forgot about multiplying to shift. Don't you multiply by 16 to shift it 4 bits though?
-
Oh right, I was thinking bytes, but yeah multiply by 16 would do it :)