Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Keoni29 on June 18, 2011, 06:20:24 am

Title: Load level
Post by: Keoni29 on June 18, 2011, 06:20:24 am
This code is supposed to load the level into L1,but it doesn't  work. It messed up the entire level.
Code: [Select]
[333333333333]->Gbd1
[300000000003]
[300000000003]
[300000000003]
[300000000003]
[300000000003]
[300000000003]
[333333333333]
Code: [Select]
For(V,0,7
For(H,0,5
{V*6+H+Gbd1}->A
A/16->{V*16+(H*2)+L1}
A^16->{V*16+(H*2)+1+L1}
End
End
Whats wrong with it?
Title: Re: Load level
Post by: Ashbad on June 18, 2011, 07:47:04 am
It's because you put 3 instead of 03 ;) since you're working with bytes with that form of data insertion, you should use 2 digit hex pairs, one for the high nib and one for the low.  Here is a working piece of data that is your version, but fixed:

Code: [Select]
[030303030303030303030303
030000000000000000000003
030000000000000000000003
030000000000000000000003
030000000000000000000003
030000000000000000000003
030000000000000000000003
030303030303030303030303] -> GDB1
Title: Re: Load level
Post by: Munchor on June 18, 2011, 07:50:49 am
It's because you put 3 instead of 03 ;) since you're working with bytes with that form of data insertion, you should use 2 digit hex pairs, one for the high nib and one for the low.  Here is a working piece of data that is your version, but fixed:

Code: [Select]
[030303030303030303030303
030000000000000000000003
030000000000000000000003
030000000000000000000003
030000000000000000000003
030000000000000000000003
030000000000000000000003
030303030303030303030303] -> GDB1

Thanks Ashbad. I had told him that in IRC but he didn't seem to even give it a try. Now that you posted, I think he will listen to your explanation :)
Title: Re: Load level
Post by: Keoni29 on June 18, 2011, 11:53:06 am
Okay I'll try this one :)
Edit:Works :)