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

Re: Joystick Devices



Hi all!

dempson@actrix.gen.nz (David Empson) wrote:

>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.

actually, you should be able to... I can't think of a good reason to
from Applesoft when there is the shorter and easier to remember PDL()
statement... but if you wanted to, here's how....

peek(-16272)		reset timing circuits
peek($c064...$c067)	inputs 0-3... sorry, I don't have a hex>dec
			calculator handy....

it'll take about 3 milliseconds for the inputs to stabilize, if you're
using assembly or REALLY fast Applesoft...

>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.

I might agree, except for those that want to use it on pre-GS models.

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

e-mail: saw@camalott.com
 voice: +915.672.2881
   fax: +915.692.8355