Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #52 > unrolled thread

Simultaneous Paddle Readings

Started bydog_cow@macgui.com (D Finnigan)
First post2011-07-27 00:56 +0000
Last post2011-07-27 15:05 +0200
Articles 3 — 3 participants

Back to article view | Back to comp.sys.apple2.programmer


Contents

  Simultaneous Paddle Readings dog_cow@macgui.com (D Finnigan) - 2011-07-27 00:56 +0000
    Re: Simultaneous Paddle Readings Michael J. Mahon <mjmahon@aol.com> - 2011-07-27 02:27 -0500
    Re: Simultaneous Paddle Readings Patrick Schaefer <pa.schaefer@web.de> - 2011-07-27 15:05 +0200

#52 — Simultaneous Paddle Readings

Fromdog_cow@macgui.com (D Finnigan)
Date2011-07-27 00:56 +0000
SubjectSimultaneous Paddle Readings
Message-ID<dog_cow-1311728175@macgui.com>
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/

[toc] | [next] | [standalone]


#53

FromMichael J. Mahon <mjmahon@aol.com>
Date2011-07-27 02:27 -0500
Message-ID<1695541697333443715.202078mjmahon-aol.com@news.giganews.com>
In reply to#52
D Finnigan <dog_cow@macgui.com> wrote:
> 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

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

[toc] | [prev] | [next] | [standalone]


#54

FromPatrick Schaefer <pa.schaefer@web.de>
Date2011-07-27 15:05 +0200
Message-ID<99agphFrksU1@mid.individual.net>
In reply to#52
Am 27.07.2011 02:56 schrieb dog_cow@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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.sys.apple2.programmer


csiph-web