You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
246 B
9 lines
246 B
|
14 years ago
|
signed short decode(unsigned char t)
|
||
|
|
{
|
||
|
|
int exp = 0x8 - (0x7 & (t >> 4));
|
||
|
|
int base = (0x1 << (exp+ 5)) - 34;
|
||
|
|
int step = 0x1 << exp;
|
||
|
|
signed short ret = base - step * (0xf & t);
|
||
|
|
ret = -ret - 1 + (2 * ret + 1) * (t >> 7);
|
||
|
|
return ret;
|
||
|
|
}
|