Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: nemo on June 22, 2010, 06:32:55 pm

Title: Hex to Sprite
Post by: nemo on June 22, 2010, 06:32:55 pm
i'm trying to figure out an algorithm in Axe that's quick and efficient for converting a list of numbers to a sprite. assume the hex data (which is stored in base 10) is located in L1. since there are 4 pixels in a byte i figured you could check for each pixel separately to turn it on. the left most pixel can be checked with If X>7 (X being the nibble being drawn) and the right most one can be checked with
!If X^2. but i'm unsure how to check whether the middle pixels should be turned on (other than comparing X to a list of possible values) i get the feeling i'm doing this completely wrong.

edit: i reread and decided that may be a little hard to understand so here's an example:
the hex string 00050A132346D6FF would be stored as Data(0,0,0,5,0,10,1,3,2,3,4,6,13,6,15,15)
Title: Re: Hex to Sprite
Post by: SirCmpwn on June 22, 2010, 06:36:09 pm
There are 8 pixels in a byte.  The hex data is ASCII?  If so, then you can convert it to a real sprite fairly easily.  If it is the actual sprite data, then just use Pt-On(X,Y,L1
Title: Re: Hex to Sprite
Post by: nemo on June 22, 2010, 06:44:35 pm
that doesn't work, but it made me realize that i can just store the data little bit differently and get it to work. thanks.
Title: Re: Hex to Sprite
Post by: SirCmpwn on June 22, 2010, 06:45:59 pm
Sure thing.
Title: Re: Hex to Sprite
Post by: DJ Omnimaga on June 23, 2010, 12:23:26 am
Do you want to just convert sprites to data? If so, SirCmpwn made a program that is included in Omnimaga download section called Tilemap to Hex, I believe. It could maybe do what you want in that case.