Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Camdenmil on February 14, 2011, 11:29:34 pm

Title: Bit issues
Post 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.
Code: [Select]
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?
Title: Re: Bit issues
Post by: squidgetx on February 15, 2011, 07:23:37 am
Code: [Select]
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
Title: Re: Bit issues
Post by: Deep Toaster on February 15, 2011, 06:23:55 pm
Code: [Select]
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?
Title: Re: Bit issues
Post by: Camdenmil on February 15, 2011, 07:34:16 pm
Thanks, that worked, although is there a way to do it without messing with the next byte?
Title: Re: Bit issues
Post by: Deep Toaster on February 15, 2011, 07:35:29 pm
Yeah, just take the r off.