@Spoofing How did you figure out the math for this?
It's the same as my old one here -->> http://www.hawkee.com/snippet/6515/
I only did it like that because I was having trouble figuring out how to use bit shifting in mSL. I finally sorted it out with bit shifting here -->> http://www.mircscripts.org/showdoc.php?type=code&id=4403