Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: Camdenmil on February 14, 2011, 11:29:34 pm
-
I have a tilemap that is in bits. When I use this code, it works except when I have V=60 and W=50, the bit subroutine always returns 256. When I use any other dimensions, it returns 1 or 0.
W=60
H=50
.W=Width of map, H=Height of map, A=Start of appvar (returned from getcalc)
sub(BIT,Y*W+X^8,Y*W+X/8+A,°U
.Bitnum, Address, Where to store the result of the test
.Code
Lbl BIT
{r2}er1->{r3}
Return
It would probably take up less space putting this code inline, but why isn't this working for a 60x50 map while it works for any other dimensions.
EDIT: I got it with some other sizes like 59x49 and other numbers around that area, but what is causing the bit checking to return 256?
-
W=60
H=50
.W=Width of map, H=Height of map, A=Start of appvar (returned from getcalc)
sub(BIT,Y*W+(X^8),Y*W+(X/8)+A,°U
.Bitnum, Address, Where to store the result of the test
.Code
Lbl BIT
{r2}er1->{r3}r
Return
-
W=60
H=50
.W=Width of map, H=Height of map, A=Start of appvar (returned from getcalc)
sub(BIT,Y*W+(X^8),Y*W+(X/8)+A,°U
.Bitnum, Address, Where to store the result of the test
.Code
Lbl BIT
{r2}er1->{r3}r
Return
You edited out your response?
EDIT: Nvm, it's in the [code].
EDIT2: Hmm, wouldn't {r2}er1->{r3}r potentially overwrite the next byte, though?
-
Thanks, that worked, although is there a way to do it without messing with the next byte?
-
Yeah, just take the r off.