[comp.sys.apple] reading GS joystick btn from TML Pascal

AWCTTYPA@UIAMVS.BITNET ("David A. Lyons") (12/03/88)

>Date:         Sun, 27 Nov 88 16:03:00 PST
>From:         "Scott,
>              part time fuzzy" <SELLSWORTH%HMCVAX.BITNET@CUNYVM.CUNY.EDU>
>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