Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Simultaneous Paddle Readings

16 views
Skip to first unread message

D Finnigan

unread,
Jul 26, 2011, 8:56:17 PM7/26/11
to
Earlier, a few months ago, there was a thread in csa2 on how to calibrate
the paddle or joystick. A BASIC program was given which showed the readings
of both paddles 0 and 1. I was reminded about what I had read in an
Applesoft Reference manual: Reading of paddle 0 will affect reading of
paddle 1 if they're done close together.

I wrote a BASIC program to demonstrate this. I then, with the help of the
Mini Assembler and the Apple II Reference Manual, wrote an assembly program
to also show paddle readings.

It is true. Set paddle 1 to 255 ($FF) and then move paddle 0. You will see
both values on screen change. Moving paddle 1 never seems to affect paddle
0. It is always 0 that affects 1. I have only tried these programs on an
Apple II Plus. I suspect that emulators do not emulate this behavior, and
that other Apples may behave slightly differently.

BASIC:

0 X = PDL(0) : Y = PDL(1) : PRINT X;" ";Y : GOTO 0

Assembly:

START LDX #$00 ; SWITCH TO PDL 0
JSR $FB1E ; READ PDL 0
STY $06 ; STORE PDL 0
INX ; SWITCH TO PDL 1
JSR $FB1E ; READ PDL 1
STY $07 ; STORE PDL 1
LDA $06 ; GET PDL 0
JSR $FDDA ; PRBYTE
LDA #$A0 ; SPACE
JSR $FDED ; COUT
LDA $07 ; GET PDL 1
JSR $FDDA ; PRBYTE
JSR $FD8E ; CROUT
JMP START ; COMPLETE LOOP

--
]DF$
Mac GUI Vault - A source for retro Apple II and
Macintosh computing.
http://macgui.com/vault/

Michael J. Mahon

unread,
Jul 27, 2011, 3:27:30 AM7/27/11
to

It's not a question of paddle 0 or paddle 1 (or 2, for that matter. It's
that a paddle read earlier can affect the reading of a paddle read later,
regardless of paddle number.

And the later paddle reading will only be affected by the earlier paddle is
set to a significantly lower value than the later.

This is because a paddle read finishes shortly after its timer times out,
while the later paddle's timer is still running. Under this condition, if
the later paddle is read soon enough, the timers will not be retriggered,
and the later paddle's timer end, having been running since the earlier
paddle read started, will occur much earlier than normal, resulting in an
erroneous low reading for the later paddle.

-michael - NadaNet 3.1 and AppleCrate II: http://home.comcast.net/~mjmahon

Patrick Schaefer

unread,
Jul 27, 2011, 9:05:52 AM7/27/11
to
Am 27.07.2011 02:56 schrieb dog...@macgui.com (D Finnigan):

> It is true. Set paddle 1 to 255 ($FF) and then move paddle 0. You will see
> both values on screen change.

What you do is the following:

* start all four paddle timers
* wait until the first expires
* start all four timers again, even if one or more did not expire yet
* get wrong readings

What you have to do is:

* start all four paddle timers
* check all four timers at the same time and record expiration time or
each one

So your reading loop will last until the last timer expired, and
resolution may be worse because checking four lines takes more time than
just one..


Patrick

0 new messages