Newsgroups: comp.sys.amiga.tech
Path: utzoo!utgpu!jarvis.csri.toronto.edu!yann
From: yann@ai.toronto.edu (Yann le Cun)
Subject: Re: Where are the fire buttons?
Message-ID: <88Apr4.114018edt.27150@ephemeral.ai.toronto.edu>
Organization: University of Toronto, AI group
Date:	Mon, 4 Apr 88 08:57:41 EDT

In article <2558@usceast.UUCP> baldwin@usceast.UUCP writes:
>Now, I've got another problem.  I'm trying to read the joystick ports
>(...)
>       Trigger-lines are read, for each of the controller ports, by
>       reading PA7 (port 1 firebutton) or PA6 (port 0 firebutton) of
>       the odd-addressed 8520 peripheral ports.  
>
>Okay ... appendices A and B have a list of all the special register
>addresses, such as JOY0DAT and JOY1DAT.  Neither of them list PA6 or
>PA7.  So where is it?  Il est, if I want to read directly the logic
>state of button 1, where do I find it?

First: "it is not a good idea to read directly from the port, it is not 
portable, it does not multitask well etc......"
BUT it is sooooo simple (compared to event handling and devices) 
and so fast. This method is handy for a quick (and dirty) little hack NOT
for a product.

PA7 and PA6 are bits 6 and 7 of I/O port A of the odd-addressed 8520.
I *think* this port is called PPA (Peripheral Port A) and i think it is
the first (lowest address) register of the 8520.
I don't have the hardware manual here, and i don't remember the exact address,
The two high order bits of this byte contain the buttons states.
Don't read a full 16bits word at this address or you will get a GURU for 
unaligned word address.

Yann le Cun                            yann@ai.toronto.edu, yann@ai.toronto.cdn
AI Group, Dept of Computer Science     yann%ai.toronto.edu@relay.cs.net
University of Toronto, Canada M5S 1A4  {uunet,watmath}!ai.toronto.edu!yann


