Path: utzoo!attcan!uunet!ncrlnk!ncr-sd!hp-sdd!hplabs!ucbvax!UIAMVS.BITNET!AWCTTYPA
From: AWCTTYPA@UIAMVS.BITNET ("David A. Lyons")
Newsgroups: comp.sys.apple
Subject: reading GS joystick btn from TML Pascal
Message-ID: <8812020145.aa14773@SMOKE.BRL.MIL>
Date: 2 Dec 88 18:58:43 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: The Internet
Lines: 41
X-Unparsable-Date: Tuesday 29 Nov 88 5:41 PM CT

>Date:         Sun, 27 Nov 88 16:03:00 PST
>From:         "Scott,
>              part time fuzzy" 
>Subject:      Help!!!

>A friend using TML's standalone Pascal wants very desperately to peek
>a certain memory location.
>
>He needs to read the joystick buttons.  How does one doe this?  The
>old ref manuals tell us that if we find the high bit set of memory
>location 49249, then the button has been pressed.  How do we get this
>value.  Alternatively, what do we call to determine whether a
>joystick button has been pressed.

----------
function ReadButton0: boolean;
var
  Cheat:  record case boolean of
            true: (addr: longint);
            false: (p:   ^integer);
          end;
begin
  Cheat.addr := $E1C061;   { address of button input }
  ReadInput := bitand(Cheat.p^,$0080) <> 0;
end;
----------
This is not the only way to do it, but it's extracted right out of
some working code.  The $E1 bank isn't important...in all reasonable
cirsumstances, $00 will work just as well.  Note that this routine
peeks TWO consecutive bytes and ignores the second one.  In cases
where it's important not to read any extra bytes, use ^char instead
of ^integer, and add appropriate type conversions where necessary.

>Related question:  has TML updated TML rev 1.5A yet?

Nope, I don't think so.

--David A. Lyons              bitnet: awcttypa@uiamvs
  DAL Systems                 CompuServe:  72177,3233
  P.O. Box 287                GEnie mail:    D.LYONS2
  North Liberty, IA 52317     AppleLinkPE: Dave Lyons