[comp.sys.mac] Mouse Anti-Freeze routine needed.

denbeste@bgsuvax.UUCP (02/05/87)

I have run across an interesting, but apparently not uncommon, problem.  In
a program that I am writing, I have found a way to freeze my mouse pointer.
Unfortunately, this was not what I was trying to do.  Everything else still
functions properly, such as using menu keys and the like.

What I would like is a code segment that I could include as a menu item that
when called (via MenuKey) would unfreeze my mouse.  I am using turbo pascal
macintosh (which I really enjoy, but that is another story), Jut I can deal
with a code segment from any language.  A call that I could make from MacsBug
would also be wonderful.

I suspect that the problem involves the vertical retrace interupt becoming
disabled, but I haven't yet delved into that chapter of Inside Macintosh.

I do realize that using TMON will solve this problem, but I am not ready to
invest in a new debugger just yet.

denbeste@bgsuvax.UUCP (02/05/87)

Sorry, my return address was omitted... 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Wiliam C. DenBesten             |        ... !osu-eddie!bgsuvax!denbeste  UUCP
Dept of Computer Science        | denbeste%research1.bgsu.edu@csnet-relay ARPA
Bowling Green State University  |            denbeste@research1.bgsu.edu  CSNET
Bowling Green, OH 43402-0214    |                   #include <std.disclaimer.h>
--------------------------------+----------------------------------------------
There is no difference between theory and practice in theory, but there is
often a great deal of difference between theory and practice in practice.

dgold@apple.UUCP (02/10/87)

In article <678@bgsuvax.UUCP> denbeste@bgsuvax.UUCP (William C. DenBesten) writes:
>I have run across an interesting, but apparently not uncommon, problem.  In
>a program that I am writing, I have found a way to freeze my mouse pointer.
>...
>I suspect that the problem involves the vertical retrace interupt becoming
>disabled, but I haven't yet delved into that chapter of Inside Macintosh.
>...
Since the mouse is connected through the SCC, mouse freezing is almost always
a result of a wild memory reference.  The Zilog SCC is very sensitive, and
almost any read or write to one of its registers will disable it.  Since
the Macintosh only looks at a few of the address lines for I/O references,
it's quite easy for a wild reference to wind up hitting the SCC.

Check your program for access to NIL handles or pointers, or uninitialized
pointer variables.  If you have access to a Macintosh XL (Lisa), running
your program on it is a good way to find such errors, as wild memory
references tend to cause bus errors or other problems because of the XL's
different hardware (the mouse is handled in a totally different fashion,
so mouse freezing shouldn't be a danger).


-- 
David Goldsmith
Apple Computer, Inc.
MacApp Group

AppleLink: GOLDSMITH1
UUCP:  {nsc,dual,sun,voder,ucbvax!mtxinu}!apple!dgold
CSNET: dgold@apple.CSNET, dgold%apple@CSNET-RELAY

herbw@midas.UUCP (02/11/87)

--------


Several prime FKEY slots available *immediately* to the first person who
writes a Mouse Antifreeze FKEY for the Mac.  To my knowledge, TMON is the
only tool that provides Mouse Antifreeze.  An FKEY would be better than
a Menu Item in that it could be called from within almost any application
(with the possible exception of some game programs) as well as from the
Finder.  One doesn't need to be developing a new application to lock up
the mouse (i.e. not everyone needs TMON) -- I've seen HFS Folders that would
freeze the mouse whenever I attempted to open them!
 
By the way, I've heard there is a new FKEY manager (with an interface
similar to that provided by the Font/DA Mover) that allows FKEYS to be
copied between Systems and Files, deleted, renumbered, etc.  If anyone
has a copy, I'm sure many folks on the net would appreciate it if you
would post it.  Thanks.

                        -- Herb Weiner (...!tektronix!midas!herbw)

roman@sigma.UUCP (02/14/87)

In article <678@bgsuvax.UUCP> denbeste@bgsuvax.UUCP (William C. DenBesten)
writes:
> [...] I have found a way to freeze my mouse pointer....
>I suspect that the problem involves the vertical retrace interupt becoming
>disabled, but I haven't yet delved into that chapter of Inside Macintosh.

I did a little delving in volume III.  The mouse interrupt is (kludge!)
coming in on the SCC.  The "DCD" signals of channels A and B are used.
What is probably happening is that stray writes are wiping out the control
registers of the SCC.  Another possibility is that the processor priority
is being set to mask out this interrupt.  This seems less likely because
this would involve a stack frame mixup and would probably send execution
off to never-never land.

So what some wizard needs to do is find out how to get the SCC's state
restored to something which will re-enable this interrupt.