[comp.sys.mac.programmer] ResEdit 2.1 ZoomRect Speedup patch

speck@gorm.ruc.dk (Peter Speck) (06/10/91)

-------->>>>>>>> It's at your own risk! <<<<<<<<--------

You need ResEdit 2.1 *FINAL* (created Thu, Dec 6, 1990, 12:00),

Make a copy of ResEdit.
From this copy, open the original ResEdit 
by using open... in the file menu.

Open 'CODE' resource no 1: "Main" (size 24596), and...

Speeding up the zoomrects is quite simple: just eliminate
the calls to _Delay!
  At 4DB0, it *MUST* be like this: 
      (If it doesn't: *DON'T* patch anything)
    4245 78FF 3E06 7001
    2F00 486E FFBA 4EAD
    04CA 3007 5940 6F12
  Change this to:
    4245 78FF 3E06 7001 (no change)
    4E71 4E71 4E71 4E71 
    4E71 3007 5940 6F12

In fact, eliminating the zoomrect is even more simpel:
  (You don't need the above patch)
  At 4DB0, it *MUST* be like this:
    4245 78FF 3E06 7001
    2F00 486E FFBA 4EAD
    04CA 3007 5940 6F12
  Change this to:
    4245 78FF 3E06 7001 (no change)
    603C 486E FFBA 4EAD
    04CA 3007 5940 6F12 (no change)

BTW what's pig-mode (cmd-alt-shift about...) - a test mode?

Comments to:

{{{{{{{{{{ speck@dat.ruc.dk }}}}}}}}}}}
{{{{{{{{{{{{ Peter  Speck }}}}}}}}}}}}}
{{{{{ Roskilde UniversitetsCenter }}}}}
{{{{{{{{{{{{{{{ Denmark }}}}}}}}}}}}}}}

jmunkki@hila.hut.fi (Juri Munkki) (06/11/91)

I would have thought that _Delay is mostly obsolete now that MultiFinder
exists. Calling delay is like intentionally making the computer slower.
Instead, you should always try to use _WaitNextEvent. Of course, in some
cases WaitNextEvent might not return quite as soon as you wanted, but at
least some work got done instead of an idle loop.

   ____________________________________________________________________________
  / Juri Munkki	    /  Helsinki University of Technology   /  Wind  / Project /
 / jmunkki@hut.fi  /  Computing Center Macintosh Support  /  Surf  /  STORM  /
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ajr3@quads.uchicago.edu (ajr3@midway.uchicago.edu (Al Roy)) (06/11/91)

In article <1991Jun10.153307.11549@gorm.ruc.dk> speck@gorm.ruc.dk (Peter Speck) writes:
>
>BTW what's pig-mode (cmd-alt-shift about...) - a test mode?
>

I think I remember someone from Apple posting and saying that pig mode does
something like a heap scramble when accessing resources.  something like that
anyway.  Correct me if i'm wrong.

alain roy
ajr3@midway.uchicago.edu

jcav@quads.uchicago.edu (john cavallino) (06/13/91)

In article <1991Jun10.180210.24253@nntp.hut.fi> jmunkki@hila.hut.fi (Juri Munkki) writes:
>I would have thought that _Delay is mostly obsolete now that MultiFinder
>exists. Calling delay is like intentionally making the computer slower.
>Instead, you should always try to use _WaitNextEvent. Of course, in some
>cases WaitNextEvent might not return quite as soon as you wanted, but at
>least some work got done instead of an idle loop.

Yes, but once the Mac OS goes preemptive (which it eventually will) _Delay
will very likely become the way to sleep your task.  Perhaps we shouldn't
be too hasty.

-- 
John Cavallino                      |     EMail: jcav@midway.uchicago.edu
University of Chicago Hospitals     |    USMail: 5841 S. Maryland Ave, Box 145
Office of Facilities Management     |            Chicago, IL  60637
B0 f++ c+ g+ k s+(+) e+ h- pv (qv)  | Telephone: 312-702-6900

glenn@gla-aux.uucp (Glenn Austin) (06/13/91)

In article <1991Jun10.180210.24253@nntp.hut.fi>, jmunkki@hila.hut.fi (Juri Munkki) writes:
> I would have thought that _Delay is mostly obsolete now that MultiFinder
> exists. Calling delay is like intentionally making the computer slower.
> Instead, you should always try to use _WaitNextEvent. Of course, in some
> cases WaitNextEvent might not return quite as soon as you wanted, but at
> least some work got done instead of an idle loop.

One of the things I've written for my library is a BGDelay which simply
gets the current TickCount(), and then goes into a loop, checking the
number of ticks since the first TickCount() call, and calling EventAvail
with 0 as the eventMask.

Not QUITE as accurate as Delay -- but I didn't want to mess with the Time
Manager at the time.

===============================================================================
| Glenn L. Austin                | "Turn too soon, run out of room.           |
| Macintosh Wizard and           |    Turn too late, much better fate."       |
| Auto Racing Driver             |   -- Jim Russell Racing School Instructors |
|-----------------------------------------------------------------------------|
| Don't take me too seriously -- I never do!  :-)                             |
|-----------------------------------------------------------------------------|
| Usenet:  glenn@gla-aux.uucp or glenn%gla-aux.uucp@skinner.cs.uoregon.edu    |
===============================================================================

urlichs@smurf.sub.org (Matthias Urlichs) (06/19/91)

In comp.sys.mac.programmer, article <1991Jun10.180210.24253@nntp.hut.fi>,
  jmunkki@hila.hut.fi (Juri Munkki) writes:
< I would have thought that _Delay is mostly obsolete now that MultiFinder
< exists. Calling delay is like intentionally making the computer slower.
< Instead, you should always try to use _WaitNextEvent. Of course, in some
< cases WaitNextEvent might not return quite as soon as you wanted, but at
< least some work got done instead of an idle loop.
< 
You must not give background time to anybody while drawing into the WMrgPort.
The background application may draw something, and when you undraw the zoom
rectangle (typically by XORing), things tend to look interesting.

Users tend to get confused when that happens.

-- 
Matthias Urlichs -- urlichs@smurf.sub.org -- urlichs@smurf.ira.uka.de     /(o\
Humboldtstrasse 7 - 7500 Karlsruhe 1 - FRG -- +49-721-621127(0700-2330)   \o)/

peterc@sugar.hackercorp.com (Peter Creath) (06/20/91)

Once again, due to my brain-dead newsreader, I am unable to post with the
appropriate subject (nor can I edit the header).  In any case, I wrote a
custom MDEF for use with some popup menus.  However, whenever I try to
access the same MENU resource more than once (ie: more than one popup), I
get tossed into MacsBug with an error at _HClrRBit.
 
What is Apple's MDEF 0 doing that mine doesn't?  I've tried HandToHand to
duplicate the data to no avail.  What is that little trick that allows me
to access the same MENU multiple times?
 
HELP!!!
---
PLEASE respond in E-mail, my news system doesn't allow threading...
 
peterc@sugar.neosoft.com           "Listen, there's a hell of a good
peterc@sugar.hackercorp.com         universe next door.  Let's go!"
(take your pick)                                      -e e cummings


--