Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!necntc!ames!sdcsvax!sdcc6!sdcc18!cs162ffl From: cs162ffl@sdcc18.ucsd.EDU (John Schultz) Newsgroups: comp.sys.amiga Subject: Re: Grabbing the mouse port. Message-ID: <802@sdcc18.ucsd.EDU> Date: Wed, 11-Nov-87 19:47:09 EST Article-I.D.: sdcc18.802 Posted: Wed Nov 11 19:47:09 1987 Date-Received: Sat, 14-Nov-87 05:19:35 EST References: <1041@sugar.UUCP> Reply-To: cs162ffl@sdcc18.ucsd.edu.UUCP (John Schultz) Organization: University of California, San Diego Lines: 22 I've written a very fast a simple routine that reads $DFF00A (port 0), $DFF00C (port 1), $BFE001 (read bit 6 for port 0 and bit 7 for port 1) for the button presses. All you have to do is read the appropriate bits (and xor a few). Just read the Hardware manual Appendix_A Page 13. Takes only a couple of lines of C code to implement, more for Modula-2. I used the RKM example and it was quite a bit slower, incurred more overhead, and took over three pages of C code. It also would not work with port 0 while intuition was hooked up. I have used this routine in all of my games, which all run perfectly on the 500, 1000, and 2000. I realize that future machines may have a different absolute memory locations, but since it works with all three of the current models, I am content with the inherent drawbacks of accessing a peripheral device directly. Of course, if one is just hacking around, then there is no problem. John