Mail Archives: djgpp/1998/02/06/15:31:12
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
- Raw text -