Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: ZippyDee on March 28, 2011, 08:16:02 pm

Title: nib{} question
Post by: ZippyDee on March 28, 2011, 08:16:02 pm
Hi, I'm trying to use the nib{} command in a sprite display routine, and I'm getting some funky looking graphics out of it...but not the ones I want.

Basically, Pic0V and Pic0S each point to a bunch of 4x4 sprites. Naturally, each sprite is 2 bytes, so to use the Pt-on() (etc...) commands I have to convert it to 8x8. Well, for this program I'll always be displaying one sprite from Pic0V and one from Pic0S side by side, so I thought "why not just make a routine to generate an 8x8 sprite that has both 4x4's next to each other (with the rest filled by 0's of course).

So I tried to write that routine, but it's not working...and I realized that I may be using the nib{} command wrong. So I guess my real question is this:

if {L1} = $8F, would nib{L1*2} = 8 or 15? Basically, which half of the byte is read first? The lower half or the upper half?
Title: Re: nib{} question
Post by: Michael_Lee on March 28, 2011, 09:00:28 pm
It appears to be 15.
Title: Re: nib{} question
Post by: squidgetx on March 28, 2011, 09:35:36 pm
If you downgrade to axe .4.8 or lower, it will read the opposite way. Unfortunately, the nibble writing commands will be flipped. This is something I like to continuously complain about as it prevents me from upgrading from .4.8
Title: Re: nib{} question
Post by: ZippyDee on March 29, 2011, 02:57:07 am
Wait...reading is little-endian but writing is big-endian?
Title: Re: nib{} question
Post by: Runer112 on March 29, 2011, 03:16:00 am
For big-endian nibble reading:

Code: [Select]
Lbl NIB
Return nib{xor 1}
Title: Re: nib{} question
Post by: ZippyDee on March 29, 2011, 03:25:02 am
Wow...Damn.......So...Simple...

Thank you. You're a genius...
Title: Re: nib{} question
Post by: Juju on March 29, 2011, 10:07:08 am
Thank you, I was asking the same question. :D

The solution is so simple.