[comp.sys.ibm.pc] Joystick/Game Port programming

jkenyon@css.itd.umich.edu (Jim Kenyon) (01/16/91)

I'm looking for a routine to give the joystick position from
the game adapter.  The IBM Tech Ref. description of the interface
suggests busy waiting on the lower 4 bits of port 201h until they
go low (each one can go low at a different time).  The time taken
to go low then can be used to calculate ([t-24.2]/0.11 = r) the 
resistance of the attatched pot.  This is simple enough but these
times are in micro seconds and the real time clock in the system
can only be reprogrammed to micro second resolution (+/- 4uS is
the granularity I get using the software I have).  If you follow me
this far, you can see that at low resistance values, the timer is
only fine enough to give +/- 50% resistance accuracy.
I must be missing something here since joysticks behave quite nicely
as pointing devices and controls for video games on a PC -- please,
enlighten me with a more elegant approach to game adapter programming.
Thanks,
Jim
--
Jim Kenyon -- jkenyon@css.itd.umich.edu
University of Michigan, 401 Washtenaw Ave
Division of Kinsesiology, Motor Behavior Lab
Ann Arbor, MI 48109 -- (313) 763-0498