Path: utzoo!mnetor!uunet!portal!atari!apratt From: apratt@atari.UUCP (Allan Pratt) Newsgroups: comp.sys.atari.st Subject: Re: Mouse Addresses... Message-ID: <1013@atari.UUCP> Date: 11 Mar 88 18:21:54 GMT References: <4484@garfield.UUCP> Distribution: na Organization: Atari Corp., Sunnyvale CA Lines: 56 From article <4484@garfield.UUCP>, by avp@garfield.UUCP (Anthony Paul): > Back in October, the addresses went by for the mouse, > [deleted] - x pos > [deleted] - y pos > [deleted] - buttons. > > My problem, the article said these don't work on the mega. > Anyone know what they are on the Mega? These variables are in fixed locations relative to the Line-A base you get in A0 when you use Line-A init ($A000). MOUSE_BT equ -596 M_HID_CT equ -598 GCURY equ -600 GCURX equ -602 dc.w $a000 move.w MOUSE_BT(a0),d0 ; mouse bits (bit 0 is left button) move.w M_HID_CT(a0),d1 ; mouse hide depth (0=visible) move.w GCURY(a0),d2 ; mouse pointer Y move.w GCURX(a0),d3 ; mouse pointer X These variables are read-only -- unpredictable things will happen if you write to them. The exception is the hide depth of the mouse. If you want to show the mouse, do stuff, then restore it to the previous depth, do this: dc.w $a000 ; get line-A base to a0 move.l a0,save_base ; save this for later move.w M_HID_CT(a0),d7 ; get old depth beq.s already_shown ; already visible move.w #1,M_HID_CT(a0) ; set new depth of 1 dc.w $a009 ; show mouse already_shown: ... do stuff ... tst.w d7 ; was it shown before? beq.s all_done ; yes - no need to do anything dc.w $a00a ; hide it move.l save_base,a0 ; get line-A base again move.w d7,M_HID_CT(a0) ; set depth to old value all_done: rts .bss save_base: ds.l 1 The point here is that you can change the depth from one nonzero value to another nonzero value safely, especially if you restore it later. But remember if you don't restore it that AES will get out of sync. ============================================ Opinions expressed above do not necessarily -- Allan Pratt, Atari Corp. reflect those of Atari Corp. or anyone else. ...ames!atari!apratt