Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ucbvax!DMZRZU71.BITNET!KAPFFER From: KAPFFER@DMZRZU71.BITNET (Matthias Kapffer) Newsgroups: comp.sys.apple Subject: Re: Reading the Button with PDL() command Message-ID: <8801110713.aa06732@SMOKE.BRL.ARPA> Date: 11 Jan 88 13:03:55 GMT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 18 X-Unparsable-Date: Monday, 11. January 1987 13:02 MEZ I/O addresses from $C060 thru $C067 (cassette in/button 0-2/paddle 0-3) are repeated immediatly after them. Therefore a PDL(n), n= 4..7, will access the four one-bit inputs mentioned above. Taking a look at the paddle read routine at $FB1E will reveal that PDL(5) for example yields 0 if button 0 (the open apple key) is open and 255 if it is pressed (values in between can be obtained if the button is released during the loop). I.e. the following A/S program line 10 DEF FN BT(N)= INT(PDL(5+N)/255) or 10 DEF FN BT(N)= PDL(5+N)>0 defines a function similar to Apple Pascal's BUTTON boolean function in UNIT AppleStuff. (Note that both defs are *not* fully equivalent !) Matthias Kapffer Please note that my former account (MAT6013) is no longer valid.