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

Re: Apple II's paddle 3 button



Stefano Priore asked:

>To which memory location is paddle 3's button mapped? Some sources seem
>to imply that it's mapped to $c064, but according to others this switch
>reads joystick #1's X axis...

There is no "official" relationship between Paddle 3 ("GC3") and a
particular pushbutton, since there are 4 paddle inputs and only
3 pushbutton inputs.

The third pushbutton input, usually referred to as PB2 but called
"pb3" on p.79 of the Reference Manual, is read at location $C063.

As you noted, $C064 is Paddle 0 ("GC0").

I believe the confusion arises because of the confusion regarding
whether the pushbutton inputs numbers start at PB0 or PB1.
Except for the table showing the I/O Locations (perhaps the most
often used table in the whole Reference Manual!) the pushbuttons
are uniformly labelled: PB0, PB1, and PB2.

They are mapped to ascending I/O locations starting at $C061
(since the cassette input is $C060).  This unfortunate alignment
is probably responsible for the nomenclature mixup.

In retrospect, if the pushbuttons had been mapped as the first
three serial inputs ($C060..C062) and the cassette input to $C063,
then no one would have been tempted to refer to the first button
as PB1 in the first place.  ;-)  This would also have rationalized
the extension made in the IIgs, where the cassette input is
re-purposed as PB3 (at $C060!).

You should note that PB0 and PB1 are also the Open Apple and
Closed Apple keys on Apple //e's and //c's, and are pulled to ground
with about 470 ohms, with the buttons connecting them to +5v.
PB2 is quite different, being pulled up to +5 through a resistor
and grounded by the Shift key if the shift key mod is installed
(by default on Platinum //e's with numeric keypads).

Further, the pushbutton inputs on Platinum //e's and IIgs's are
bypassed to ground with capacitors, which renders them useless
for high speed signalling.  These capacitors are easily removed
for compatibility with earlier Apples.

On a different but similar topic, which state of an annunciator
output is "on" is a bit confused, as well.  The original monitor
left the annunciator outputs in their default state on reset, but
the autostart monitor authors apparently thought of them as
active low outputs, and proceed to "set" the first two (AN0, AN1)
to a low state and "reset" the second two (AN2, AN3) to a 
high state.

The monitor source I/O address mappings of the "set" and
reset" addresses are even and odd, respectively, although
most programmers think of "1", odd, high as "set" and
"0", even, low as "reset".  Except for the INITAN code in the
autostart monitor, the conventional usage is "active high",
an interpretation which is also taken in later Apple II
documentation.

-michael

Check out amazing quality sound for 8-bit Apples on my
Home page:  http://members.aol.com/MJMahon/