Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: parserp on January 07, 2012, 02:50:41 pm
-
So, If I have a 176 byte tilemap in L1, (a number from 0-15) and I want to have it stored in an appvar, but in 88 bytes using the nib{ command, how would I do that?
...And then to get the information from the appvar and copy it to L1 again?
-
Alternatively you could just do something like:
GetCalc(Str01)→V
For(A,0,87)
{A*2+L1→B}*16+{B+1}→{A+V}
End
-
Alternatively you could just do something like:
GetCalc(Str01)→V
For(A,0,87)
{A*2+L1→B}*16+{B+1}→{A+V}
End
ah, that makes sense. but how would I decode that?
-
To convert it from nibbles to bytes just do the opposite:
GetCalc(Str01)→V
For(A,0,87)
{A+V}→C/16→{A*2+L1→B}
C^16→{B+1}
End
(Someone correct me if I'm wrong)
-
yay it worked! thanks leafy! :D
-
If you want to use the nib{} command to avoid the unoptimized division and multiplications, you could do it like:
GetCalc(Str01)→V
For(A,0,175)
{L1+A}→nib{V*2+A}
End
And to decode, its as simple as reversing the store:
GetCalc(Str01)→V
For(A,0,175)
nib{V*2+A}→{L1+A}
End