From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Joystick Polling Woes. Date: Fri, 6 Feb 1998 18:42:58 +0000 Organization: None Distribution: world Message-ID: <2A3OUCAym120EwPB@talula.demon.co.uk> References: <34DA37DC DOT 54205A4F AT student DOT umass DOT edu> NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 17 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Paolo Piselli writes: >Anyways, the function reads most of the axes (sp?) correctly for my >Gravis Pad, except when I press down (directly down, not diagonally) >the y-axis drops below the neutral axis value. I think the problem is that you are only using 16 bit registers to count the elapsed time, and on a fast PC these are likely to wrap when the joystick is in an extreme position. I think you should rewrite this to use a 32 bit counter. For some working djgpp code, see the joystick.c and misc.s files from Allegro. -- Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/ "Pigs use it for a tambourine" - Frank Zappa