[comp.sys.amiga.tech] Where are the fire buttons?

baldwin@usceast.UUCP (04/02/88)

I'd like to thank everybody who responded to my posting about multiple
viewports ... the trick about calling MakeVPort () for each viewport
worked.

Now, I've got another problem.  I'm trying to read the joystick ports
(yes both of them) directly, and the hardware manual is very clear about
how to do this.

On page 8-5, the Hardware manual says, in reference to the fire buttons,

       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?

                                           Mitch

[hiding out here under an assumed identity]

BITNET: {SXA00051, SXA00052} @ BAGAMCOK
UUCP:   seismo!ncr-sd!ncrcae!usceast!baldwin
        nosc!crash!pro-carolina!mitch

yann@ai.toronto.edu (Yann le Cun) (04/04/88)

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