FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

SYSTEM

Call SETCCURSOR in VBL task


I put together a color cursor animation and tried to run it within a VBL task. Boy, did it cause problems! Corrupted heap! I come to find out that SetCCursor moves memory around in trying to accomodate the color depth of the screen and moving memory around during an interrupt is a very bad thing to do.

All I did was to call SetCCursor from within a FN from within the VBL task and apparently this is not enough. Has anyone had success with this type of thing? It's not enough to just run a simple test and say "See, it works!" because the heap won't be in jeopardy unless you are doing something that uses it like allocating and deallocating regions, GWorlds, etc.

Charlie Dickman


Don't know if this will help, but it just came across my desk from Apple just now. It might offer some clues as to your color cursor problem.
[6] Technote 1020 Revised: Color Cursor Quirks

If you're building an application that uses color cursors, you may encounter some quirks present in Color QuickDraw. This technote provides solutions to a few of the most common cursor problems.

<http://devworld.apple.com/dev/technotes/tn/tn1020.html>

L. Frank Turovich


This technote confirms what I thought... from the technote...

Don't Call SetCCursor at Interrupt Time

SetCCursor is documented as moving memory. In 7.5.2 and later, SetCCursor makes calls to CopyBits and other QuickDraw routines. Never, ever call SetCCursor at interrupt time! Calling SetCursor at interrupt time is still allowed, however.

I might go to the trouble of animating a color cursor in event processing but maybe not... the vbl task is soooo clean

Charlie Dickman