X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fsball.c;h=c8fed5ba190eadb1c8813eb1e6d9dec0b66054ef;hb=3f16b99d1c797ad5e4ea43f2d1e781b0f229cdfa;hp=2a893dea713ce848527b2840ba7222fcf90522e2;hpb=8d35aa7775627c24b54db6883b4df7ba0cc65c34;p=sball diff --git a/src/sball.c b/src/sball.c index 2a893de..c8fed5b 100644 --- a/src/sball.c +++ b/src/sball.c @@ -1,3 +1,10 @@ +/* Serial spaceball and space-mouse example driver code for UNIX systems. + * Tested with Spaceball 4000FLX and Magellan SpaceMouse on GNU/Linux, FreeBSD, + * SGI/IRIX, and SunOS (Solaris/Illumos). + * + * Author: John Tsiombikas + * No copyright, public domain. + */ #include #include #include @@ -309,13 +316,8 @@ static int mag_parsepkt(struct sball *sb, int id, char *data, int len) return -1; } for(i=0; i<6; i++) { -#ifdef SBALL_BIG_ENDIAN - sb->mot[i] = ((((int)data[3] & 0xf) << 12) | (((int)data[2] & 0xf) << 8) | - (((int)data[1] & 0xf) << 4) | (data[0] & 0xf)) - 0x8000; -#else sb->mot[i] = ((((int)data[0] & 0xf) << 12) | (((int)data[1] & 0xf) << 8) | (((int)data[2] & 0xf) << 4) | (data[3] & 0xf)) - 0x8000; -#endif data += 4; } print_state(sb);