home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!noc.near.net!news.cs.brandeis.edu!news!phils
- From: phils@chaos.cs.brandeis.edu (Phil Shapiro)
- Subject: Re: Button() not callable from interrupt ?
- In-Reply-To: robert@wsooti11.info.win.tue.nl's message of 9 Nov 92 09: 36:42 GMT
- Message-ID: <PHILS.92Nov9094020@chaos.cs.brandeis.edu>
- Sender: news@news.cs.brandeis.edu (USENET News System)
- Organization: Symantec Corp.
- References: <ROBERT.92Nov9103642@wsooti11.info.win.tue.nl>
- Distribution: comp
- Date: Mon, 9 Nov 1992 14:40:20 GMT
- Lines: 30
-
- >>>>> On 9 Nov 92 09:36:42 GMT, robert@wsooti11.info.win.tue.nl (Robert Lukassen) said:
-
- > I ran into a bit of trouble the other day when I tried to read the
- > state of the mouse-button from an interrupt-routine. I know that
- > the state of the mouse-button is represented by a single bit in
- > some low-memory variable and this works well, but why does (the old
- > version of) Inside Macintosh claims that Button() can move or purge
- > memory. That is absolutely insane! A simple fetch of a low-memory
- > variable can't trigger a memory move or memory purge. What are they
- > doing that makes calling Button() so dangerous?
-
- I ran into a similar situation with GetMouse(), which IM I also
- documents as moving memory. It turns out that the only time Button()
- and GetMouse() (as well as some others) move memory is when then
- all-but-dead Journaling Mechanism is enabled. (Supposedly it was
- reserved in System 7 for a revised version of MacroMaker, one of the
- few macro tools that actually used journaling. Thankfully, MacroMaker
- rests in peace...)
-
- If you disassemble these routines, you'll find that they check
- JournalFlag at 0x8DE to see if journaling is currently enabled. A
- possible solution is to add a similar check to your own code and use a
- low mem global when necessary; it's probably simpler to always examine
- low memory directly.
-
- -phil
- --
- Phil Shapiro Software Engineer
- Language Products Group Symantec Corporation
- Internet: phils@cs.brandeis.edu
-