[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Joystick Devices



In article <Pine.A32.3.93.960801074240.45609A-100000@freenet4.afn.org>,
Donald 'X-caiver' Pattee Jr <afn45687@afn.org> wrote:

>Yes, I tested the buttons and such using my little BASIC program. That is
>where I dcided that I could not get any valid position data.
>I was using the print peek(29250) [and the other numbers in that area) to
>detect button presses and joystick position.

You cannot read joystick positions by peeking memory locations.  The
joystick works on a time delay mechanism: a trigger pulse causes a
countdown to start, and the joystick position sets how long the countdown
will take.

To read the joystick position requires accessing the location which causes
the trigger, then counting how long it takes for the timeout to occur.

This is exactly what is done by the PDL() function in BASIC, and the
corresponding monitor routine, PREAD.


The TouchWindow operates in the same way as a joystick - it presents a
variable resistance to the computer which indicates where it is being
pressed (one signal for each axis).  If you are not touching it, it
returns a very large or small timeout (I forget which).


I wrote a rudimentary GS/OS driver for the TouchWindow which lets you move
the mouse cursor around the screen and click on objects.  It would need
quite a bit more work to be reliable, because the TouchWindow appeared to
produce a very "bouncy" signal.  In addition, the joystick method is not
ideal, because it takes up too much CPU time.

It would be better to use the Macintosh version of the TouchWindow, which
is an ADB peripheral.

-- 
David Empson
dempson@actrix.gen.nz
Snail Mail: P.O. Box 27-103, Wellington, New Zealand