Xref: cantaloupe.srv.cs.cmu.edu comp.sys.ibm.pc.hardware:60282 comp.os.msdos.programmer:23082
Newsgroups: comp.sys.ibm.pc.hardware,comp.os.msdos.programmer
Path: cantaloupe.srv.cs.cmu.edu!crabapple.srv.cs.cmu.edu!bb3.andrew.cmu.edu!news.sei.cmu.edu!cis.ohio-state.edu!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!uxa.cso.uiuc.edu!jas37876
From: jas37876@uxa.cso.uiuc.edu (John A. Slagel)
Subject: Re: int15h for joysticks is slow....
Date: Fri, 16 Apr 1993 18:50:22 GMT
Message-ID: <C5LAzz.58q@news.cso.uiuc.edu>
References: <1ql6i3INN8uh@no-names.nerdc.ufl.edu>
Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
Organization: University of Illinois at Urbana
Lines: 25

lioness@oak.circa.ufl.edu writes:


>I'm using int15h to read my joystick, and it is hideously slow.  Something
>like 90% of my CPU time is being spent reading the joystick, and this
>is in a program that does nothing but printf() and JoyRead().

>The problem is that a lot of programs trap int15h ( like SMARTDRV ) and
>so it is a slow as hell interface.  Can I read the joystick port in
>a reasonably safe fashion via polling?  And that isn't platform or
>clockspeed specific?

    The joystick reads in anolog values through a digital port. How?
    You send a command to the port to read it, then you time how long
    it takes for the joystick port to set a certain bit.  This time
    is proportional to the joystick position.  Obviously, since time
    is used as a position, you cannot get rid of this ridiculus waste 
    of time.  If you wrote your own routine instead of the BIOS, it
    would speed it up some, but the time would still be there.

-- 
-----------------------------------------------------------------------------
 John A. Slagel              "My old man used to tell me, before he left this
 j-slagel1@uiuc.edu           shitty world, never chase buses or women- you
 (217) 337-7930               always get left behind." -The Marlboro Man
