[comp.binaries.apple2] tn.iigs.072

mjohnson@APPLE.COM (Mark B. Johnson) (12/02/89)

This message  was originally  submitted by  mjohnson@APPLE.COM to  the APPLE2-L
list  at BROWNVM.  If  you simply  forward  it back  to the  list,  it will  be
distributed with the paragraph you are now reading being automatically removed.
If you  edit the  contributions you  receive into  a digest,  you will  need to
remove this  paragraph before mailing the  result to the list.  Finally, if you
need more information from the author of this message, you should be able to do
so by simply replying to this note.

----------------- Message requiring your approval (91 lines) ------------------
Apple II
Technical Notes
_____________________________________________________________________________
                                                  Developer Technical Support


Apple IIGS
#72:    QuickDraw II Quirks

Written by:    Dave Lyons                                       November 1989

This Technical Note points out some things things you need to watch out for
when using ScrollRect and when using QuickDraw II's FastPort-aware and
Shadowing modes under System Software 5.0.2.
_____________________________________________________________________________


Shadowing

Bit 15 of the MasterSCB parameter to QDStartUp requests that QuickDraw II use
the memory at $012000 to shadow onto the real screen memory at $E12000.  (This
speeds up QuickDraw II, since memory in bank $01 can be read at full speed.)

QDShutDown on ROM 01 machines does not dispose of the $012000 memory block if
it was allocated.  If your application is about to quit anyway, it doesn't
make any difference.

But if your application restarts QuickDraw II (for example, because it's
switching between 320 mode and 640 mode), QDStartUp is unable to reallocate
the shadow memory, since it's already allocated.  At this point, QuickDraw II
is no longer shadowing, and the lost speed advantage is not your biggest
problem:  if you had any windows open, their ports' pixel map pointers are
still pointing into bank $01, where any drawing done is now invisible.

A solution to this problem is to manually dispose of the $012000 memory after
QDShutDown if your application is affected.

           pha
           _GetMasterSCB
           _QDShutDown
           pla
           bpl    WasNotShadow      ;bit 15 was off--not shadowing
           pha
           pha
           pea    $0001
           pea    $2000
           _FindHandle
           plx
           pla
           bcs    WasNotShadow
           pha
           phx
           _DisposeHandle

WasNotShadow                        ;now it's okay to restart QuickDraw


FastPort-Aware Anomaly

When the FastPort-aware bit is turned on in the MasterSCB parameter to
QDStartUp, DrawPicture does not notice changes in the pen pattern.  If your
application uses pictures, either directly or indirectly (i.e., by printing to
the ImageWriter driver), you may need to leave FastPort-aware mode turned off
to get the expected behavior.


FastFont and Large Pixel Maps

FastFont does not work correctly when drawing past the first 64K of a pixel
map.  If you are drawing text that uses FastFont (i.e., Shaston 8), you can
avoid this problem by using a non-rectangular clipRgn.


ScrollRect Can Hang

Under certain conditions, ScrollRect hangs.  For the hang to occur, the port's
visRgn must be non-rectangular and the scroll must be with a positive dY value
small enough that some pixels are actually moved on the screen.

Since SetContentOrigin calls ScrollRect, this problem can affect you even if
you don't call ScrollRect directly.  For example, the hang can occur when a
word processor's Find dialog obscures part of a document window and the search
wraps back to the beginning of the document .

One way to avoid the problem is to call SetContentOrigin2 with
ScrollFlag = False and then redraw the window contents as appropriate.


Further Reference
_____________________________________________________________________________
    o    Apple IIGS Toolbox Reference, Volumes 1 and 3