Spring 91 - MACINTOSH Q & A
MACINTOSH Q & A
MACINTOSH DEVELOPER TECHNICAL SUPPORT
Q The TrapAvailable function listed in the "Compatibility Guidelines" chapter of Inside Macintosh Volume VI contains code that checks the size of the trap table. Do I have to do
this if my application doesn't support the old 64K ROMs?
A Yes, you do. With the introduction of the Macintosh Plus and 128K ROMs, the trap table was divided into the OS trap table and Toolbox trap table. The number of trap
table entries was increased and the format of those entries was expanded. For
additional information on this expansion see the "Using Assembly Language" chapter of
Inside Macintosh Volume IV. However, the 64K to 128K ROM trap table expansion is
not what the code in the TrapAvailable function is checking for. The Toolbox trap table
was expanded yet again when the Macintosh II was introduced. The Macintosh Plus and
SE use the smaller Toolbox trap table on pre-7.0 systems. To be sure your application
is compatible with these machines on pre- 7.0 systems, check the size of the Toolbox
trap table.
Q What are the guidelines for determining how much of an image CopyBits can copy to a Macintosh pixel map at one time, given a particular set of characteristics for the
source map and the destination map and given how much stack space is available? For
example, say that we have an 8-bit-deep pixMap to be copied to a 32-bit-deep pixMap
using the ditherCopy mode and expanded by a factor of 4, and we have 45K of stack
space.
A CopyBits' stack requirement depends on the width of each scan line (rowBytes). The rule of thumb is that you need at least as much stack as the rowBytes value in your
image (which can be huge with 32-Bit QuickDraw), with the following additional
modifiers: add an additional rowBytes for dithering; add an additional rowBytes for any