Author Topic: Load level  (Read 2572 times)

0 Members and 1 Guest are viewing this topic.

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Load level
« 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?
If you like my work: why not give me an internet?








Ashbad

  • Guest
Re: Load level
« Reply #1 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

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Load level
« Reply #2 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 :)

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: Load level
« Reply #3 on: June 18, 2011, 11:53:06 am »
Okay I'll try this one :)
Edit:Works :)
« Last Edit: June 19, 2011, 04:24:39 am by Keoni29 »
If you like my work: why not give me an internet?