VideoToolbox Changes
visitors since September 17, 1996.
11 September 2004
This page records the evolution of the VideoToolbox software, specifying changes to the C code and dates of submission for publication at the public info-mac software archive. This document covers 1994-present. For earlier history see Changes 1990-3.
I try to immediately record here all significant
changes to the C sources. However, the Download page
only offers the whole VideoToolbox (as a Stuffit Archive), which I update intermittently.
If you need the latest version of something, let
me know, and I'll update the archive.
It's not likely you'll find a bug, but
if you do, please report it to the Psychtoolbox forum: psychtoolbox@yahoogroups.com
You can peruse and search the forum: http://yahoogroups.com/messages/psychtoolbox/
RECENT CHANGES
PUBLISHED (HERE) ON SEPTEMBER 11, 2004
- Updated all the projects to compile in Metrowerks Codewarrior 6.3. Some VideoToolbox changes are reported on the PsychToolbox Mac changes page.
PUBLISHED (HERE) ON APRIL 25, 2002
- All changes are listed inside the files
themselves. Some VideoToolbox changes are reported on the PsychToolbox Mac
changes page.
PUBLISHED (HERE) ON JULY 10, 2000
- HideMenuBar.c
Based on testing by David Brainard, I fixed HideMenuBarVT() in VideoToolbox to prefer Apple's new HideMenuBar only if running in Mac OS 9 or later, otherwise it does it the old way. Also added a way to control this pref at runtime, via a pair of global Boolean variables. (
Note that the old 6/22/00 version of HideMenuBar.c has a bug, which results in ALWAYS using Apple's new HideMenuBar.)
PUBLISHED (HERE) ON JUNE 22, 2000
- Added EnergySaver.c
1/00 IsEnergySaverScreenDimEnabled(); EnergySaverScreenDimEnable(); EnergySaverScreenDimDisable(); These routines parallel those in ScreenSaver.c, providing the same control over the Energy Saver screen dimming as ScreenSaver provides for screen saving. From the user's point of view, dimming and saving are essentially the same thing, but at the programming level we have to deal with them as entirely separate mechanisms.
- GDOpenWindow.c
12/99 Carbonized, but not tested in Carbon.
1/00 Recognizing that pixelSize might change between the calls to GDOpenWindow and GDDisposeWindow, we now are careful to dispose of the window's color table only if it isn't the device's color table. The old code would have disposed of the device's color table (with bad consequences) if you opened the window with pixelSize of 8 bits (or less), subsequently increased the pixelSize to 16 or 32, and then closed the window.
1/00 Added safety check in GDDisposeWindow to issue an error (instead of crashing) if one attempts to dispose of a window while it's still the current port.
1/00 Enhanced by suppressing screen dimming by Energy Saver.
6/00 GDDisposeWindow now makes sure window and ct are valid before attempting to dispose of them.
6/00 GDDisposeWindow now checks ALL devices before disposing of a window's color table which might belong to one of them. (Before we checked only one device, and this resulted in a crash with mirrored displays when the color table belonged to the other device.)
- GDVideo.c
6/00 Added GDGetClutBehavior(), GDSetClutBehavior(), and Is7500EtcVideoDriver(). They use the new driver calls cscGetClutBehavior and cscSetClutBehavior (mentioned only in Apple's Video.h) to allow control (in drivers that support it) of whether loading the CLUT (i.e. cscSetEntries and cscDirectSetEntries) waits for blanking (VBL). This will be very useful on computers whose video drivers support it.
- Added GetDisplayModes.c, which uses Display Manager 2 to get all the display modes (ie resolutions) of a particular screen device. (This is used by the Psychophysics Toolbox to report available resolutions.)
- HideMenuBar.c
10/99 In the course of updating for compatibility with Universal Headers 3.3 I fixed a longstanding bug. I was using the undefined conditional "GENERATINGPPC" instead of GENERATINGPOWERPC, so we were always using the old code instead of Apple's new ShowMenuBar and HideMenuBar. Now we use the new TARGET_CPU_PPC. Fixing this bug has the consequence that projects using this file will now need to have the stub file MenusLib added to them for the first time.
(
Oops! This 6/22/00 version of HideMenuBar.c has a bug, which results in ALWAYS using Apple's new HideMenuBar.)
- Identify.c
11/99 Enhanced IdentifyDriverVersion(), folding in code formerly in GDInfo.c.
12/99 Enhanced IdentifyProcessor to identify G4 processor.
- Added PixelsFromInts.c
10/99 PixelsFromInts accepts an array of ints and returns a pointer to an array of pixels of any desired size: 1,2,4,8,16,24, or 32 bits. sizeof(int) may be 2 (i.e. short) or 4 (i.e. long).
- PrintfExit.c
12/99 When aborting, call ShowCursor 256 times, to make sure the cursor shows.
- ScreenSaver.c
12/99 Fixed crashing bug in SayScreenSaverAsleep. David Brainard discovered the bug as a conflict between SCREEN OpenWindow and the After Dark 4.03 screen saver. There was a bug in DisposeGestaltValueFunction, now fixed. But it also turned out to be important in SayScreenSaverAsleep to disable the screen saver (if any) before trying to replace its Gestalt selector. After Dark runs poorly under Mac OS 9, e.g. closing the control panel causes a crash, but SCREEN.mex and After Dark seem to be compatible. ScreenSaverTest.m and ScreenTest.m both run fine now with After Dark.
- Seconds.c
This doesn't affect the source file, but you should know that UpTime is present in two different runtime libraries: DriverServicesLib (all versions of Mac OS, but only on PCI PowerMacs) and InterfaceLib (in Mac OS 8.6 and better).
Apple tech note explains why UpTime's clock is slow. Technical Q&A HW31 - UpTime's values are consistently slow?
- SetGestaltValue1.c
12/99 Renamed NewSelectorFunctionUPP to "MySelectorFunctionUPP" to avoid conflict with Universal Headers 3.3. Bug reported and solution suggested by Joe Strout.
12/99 Fixed crashing bug in DisposeGestaltValueFunction. When the "upp" wasn't really a upp our call to memcmp was crashing. We now make sure it's a reasonable upp before using the procDescriptor we get from it. David Brainard discovered the bug as a conflict between SCREEN OpenWindow and the After Dark 4.03 screen saver. SCREENOpenWindow calls GDOpenWindow which calls SayScreenSaverAsleep() which calls DisposeGestaltValueFunction, which crashed spruriously when the installed screen saver was After Dark. I think DisposeGestaltValueFunction is now safe.
PUBLISHED (HERE) ON SEPTEMBER 30, 1999
- 28 September 1999. Enhanced GDOpenWindow. When GDOpenWindow opens an onscreen window, it now pretends be a screen saver that is "asleep" (i.e. sets the "asleep" and "enabled" bits in the 'SAVR' Gestalt selector), so that other processes with system-wide floating windows (e.g. Drop Drawers) will hide their windows and let us have full control of all the screens. As usual, GDDisposeWindow restores the original state when it closes the last onscreen window. (Most of the implemention is in ScreenSaver.c.) The consequence for the user is that your application will happily run with an even wider range of Mac OS extenders, like Drop Drawers.
- 26 September 1999. Renamed AfterDark.c to ScreenSaver.c. All functions in that file have been similary renamed. The old names are still supported.
- 25 September 1999. Enhanced GDOpenWindow. GDOpenWindow now temporarily disables any AfterDark-compatible screen saver, if one is running, while it has onscreen windows. (Most of the implemention is in ScreenSaver.c.) The consequence for the user is that it is no longer necessary to explicitly disable your screen saver before running your experiment.
- 22 September 1999. Added new global setClutSAI to GDVideo.c to select which flavor of the Mac OS call PBControl is used by SetClut: Sync, Async, or Immed. This was added for testing purposes to answer questions from an Apple engineer in Developer Tech Support, but it appears that this control serves no other useful function.
- 9/99 GDVideo.c: Slightly changed the logic in assigning "Built-in video" as a default card name in GDCardName(). This now identifies the old 10-bit Radius card as a card, not "Built-in video". Appended the cardModel to the cardName. Added IsRadiusThunder().
[9/14/99] Enhanced Identify.c to better identify "New World" Macs, i.e. iMac, iBook, blue G3, G4.
PUBLISHED (HERE) ON MAY 6, 1999
- [5/6/99] Lew Harvey added a C wrapper to Luminance.h, to make it compatible with C++.
- [4/13/99] Renamed the VideoToolbox header file MacMemory.h to "MacMemoryVT.h" to avoid conflict with the new Apple header file of that name. ("VT" stands for VideoToolbox.) Thanks to Lew Harvey for identifying the problem and solution.
- [4/12/99] Fixed minor naming error in FPSave.c to resolve conflict with older versions of CodeWarrior Pro C compiler. Thanks to John Christie for reporting the bug.
PUBLISHED (HERE) ON APRIL 1, 1999
- [4/1/99] Updated all projects to CodeWarrior Pro 4.1. Added the suffix "VT" (for VideoToolbox) to the names of HideMenuBar() and ShowMenuBar() to avoid conflict with the new Mac OS 8.5 routines that appear in Universal Headers 3.2. (CodeWarrior Pro 4 includes most of Universal Headers 3.2.) I left the filename "HideMenuBar.c" unchanged, to minimize the effort of updating. Thanks to Lew Harvey for reporting the conflict and suggesting the solution.
PUBLISHED (HERE) ON MARCH 22, 1999
- [3/22/99] SaveFP.c implements code suggested by a new Apple Tech Note 1158 to save and restore certain PowerPC floating point registers in interrupt service routines that do floating point calculations. This new routine is used by InstallVBL.c and Rush.c. In principle, an interrupt service routine on a PowerPC that did floating point without saving and restoring might have caused an interrupted calculation to give an erroneous result, but we never experienced that. Not taking any chances, we've implemented Apple's suggestion anyway.
PUBLISHED (HERE) ON SEPTEMBER 22, 1998
- [7/24/98] SndPlay1.c was complaining of a "bad channel" if more than 44 sounds were played through a channel. Apple explained my mistake (specifying qLength larger than allocated).Works fine now.
- [7/18/98] CommandPeriod.c fixed bug in IsCommandPeriod which caused it to always return false. (It was comparing the "what" field with keyDownMask instead of with keyDown.) In response to bug reported by Robert Sekuler.
- [7/15/98] GDVideo.c Workaround limitation of Radius Thunder driver by having GDSetGamma never issue NULL requests to that driver, ".Display_Marin". In response to bug report from Steve Engel.
PUBLISHED (HERE) ON JULY 10, 1998
- [7/9/98] Enhanced IdentifyModel() in Identify.c to return model name of the newer Macs instead of a garbage string. And, following Apple's lead, we now call the "ppc750" a "G3".
PUBLISHED (HERE) ON JUNE 23, 1998
- [6/23/98] Bob Morris, ram@cs.umb.edu, says, "When I run NoiseVBL, the program fails with the message 'Cannot find DriverServicesLib' on my PowerMac 6100." The DriverServicesLib library is supposed to be weak-linked into the application, and actually incorporated only at run time, if available on that computer (PowerMacs with PCI slots, which excludes the 6100). The problem was that I'd forgotten to set the WEAK-LINK option (via Project Inspector in CWPro) for DriverServicesLib and NameRegistryLib in the demo projects NoiseVBL, TestGDVideo, and TimeCPU. Now fixed.
- [6/21/98] In response to bug report from Bob Morris, I disabled the _ControlStripDispatch fix in GDOpenWindows.c if you have Universal Headers 3.1 or newer, since Apple has fixed their typo in response to my bug report. CodeWarrior Pro 3 includes Universal Headers 3.1.
PUBLISHED (HERE) ON MARCH 26, 1998
- CopyWindows.c enhanced to clip the request by the portRect of source and destination windows, so it will not access any pixels outside the windows.
- GDOpenWindow.c enhanced to set the new window's clipRgn to match its portRect.
- GDOpenWindow.c enhanced to hide the Control Strip when you use the main screen. GDDisposeWindow restores the prior state.
- SndPlay1.c enhanced to add each new snd to the queue in the existing channel, returning immediately. Added SndPlay2(snd,dispose), which allows you to request that the snd handle be disposed of once it's no longer in the channel.
- SndPlay1.c now locks and holds the snd while it's playing, which is required for compatibility with Sound Manager 3.2.1 (in Mac OS 8.0 and 8.1) and Sound Manager 3.3b11 (installed by QuickTime 3.0b11). This eliminates the bug that the sound becomes noise if you move memory while the sound is playing.
- VBLInstall.c. The VBLFrameSubroutine() now uses the UpTime trap (available on all PCI PowerMacs), which works at all priorities instead of the Microseconds trap, which only works at priority 0, to filter out spurious VBL interrupts that occur within 3 ms of the previous. On non-PCI Macs there's no way to do timing if priority goes above zero, so the filter disables itself in that case, so, if your card emits multiple VBL interrupts you'll count them all as frames. This is generally the same on every frame, so it's very obvious from any attempt to measure frame rate since you'll get counts that are double or triple what you expect. The solution is simple: reduce the priority to 0, to allow the spurious interrupts filter to resume its job.
- Minor adjustment of the conditionals using the UNIVERSAL_HEADERS_VERSION macro for compatibility with CodeWarrior Pro 1, which uses Universal Headers 2.14. (We were already compatible with CodeWarrior Pro 2 and Universal Headers 3.01.)
PUBLISHED (HERE) ON JANUARY 13, 1998
- Only cosmetic changes. No need to download again.
PUBLISHED (HERE) ON JANUARY 8, 1998
CHANGES DURING 9/5/97 - 1/8/98
- The VideoToolbox has been updated for compatibility with CodeWarrior Pro 2. (Thanks to Lance Hahn, Tilman Vogel, Lew Harvey, and Josh Gold for their help. And to Michael Marcotty of Metrowerks for fixing SIOUX.c.) The VideoToolbox is still compatible with CodeWarrior 10. (I haven't checked intermediate versions.) The changes were:
- Use the new MSL libraries in place of the old Plum-Hall ANSI library.
- Update the spelling of DisposHandle to DisposeHandle, DisposPtr to DisposePtr, Secs2Date to SecondsToDate, PBStatus(x,0) to PBStatusSync(x), and PBControl(x,0) to PBControlSync(x).
- Cast second argument of Delay() to (void *) for compatibility with old and new Universal Headers.
- Removed redundant typedef's of AbsoluteTime.
- NOTE: the MSL SIOUX in CodeWarrior Pro 2 (and all previous versions) doesn't handle \r properly. This has been fixed in a version of SIOUX.c that I received from Metrowerks today (1/8/98), and which I assume they will soon distribute as an update.
- NOTE: kbhit() appears both in the VideoToolbox kbhit.c and in the Metrowerks CodeWarrior Pro 2 MSL SIOUX console package (see their SIOUX.c file). They are identical. It's ok to include both in your project. The linker will warn you of the duplication, and ignore one, which is fine.
- GDInfo.c: added EraseConsoleLine() for compatibility with MSL SIOUX.
- GetScreenDevice.c: GetDeviceSlotName now reports slot number in hex instead of decimal.
- Identify.c: enhanced IdentifyProcessor() to recognize the newer PowerPC chips. IdentifyMachineAndType() now abbreviates gestaltMachineType to just mach.
- Our prayers have been answered. Nano Urbina has updated his customized driver, and enhanced it. You can download it. Customized 7300/7500/7600/8500/8600 Graphics Driver supports 640x480x120 Hz and Mac OS 7.6 through 8. Customized Monitor Resolution Control Strip Module lets you select any resolution.
PUBLISHED (HERE) ON SEPTEMBER 5, 1997
CHANGES DURING 8/16/97 - 9/5/97
- VideoToolbox.h now omits the obsolete <OSEvents.h> and includes the new-named <Gestalt.h>. <fp.h> is not included if <math.h> has already been included. These changes improve compatibility with CodeWarrior 11 and Pro, which have newer Universal Headers than CodeWarrior 10. Thanks to Tilman Vogel, Lew Harvey, and Peter Bex for suggesting the changes.
PUBLISHED (HERE) ON AUGUST 16, 1997
CHANGES DURING 7/1/97 - 8/16/97
- SetEntriesQuicklyRecommended() now returns true only for the 8*24 cards, since the Apple-provided drivers for the Quadra computers now work ok, and the SetEntriesQuickly drivers don't.
- VideoToolbox.h now declares more fields as "volatile" in the structs used by VBLInstall.c and Timer.c.
- GDOpenWindow.c Fixed crashing bug reported and diagnosed by Tilman Vogel, tilman.vogel@uni-tuebingen.de. He discovered that if the main screen was set to more than 8 bits and the screen being opened and closed was at 8 bits, then the color table wasn't allocated (correct), but when closing the window, the code erroneously attempted to dispose of the color table, which led to a crash. (8/10/97)
- NoiseVBL.µ added Nan.c and Seconds.c, which are required by the latest version of VBLInstall.c.
- Rush.c now saves and restores the 68881 fpu registers (if GENERATING68881) to make it safe to use floating point in the deferred task, as suggested by Apple Technote hw22.
- Recompiled TimeVideo, now version 3.79.
- CopyBitsQuickly.c, Identify.c, Seconds.c, TimeCPU.c, and WaitSeconds.c now follow the advice of Technote1083 and use a simpler faster method to test for availability of weak-linked routines.
- Updated some of the THINK C projects: All.pi, Filter.pi, FlickeringGrating.pi.
PUBLISHED ON July 1, 1997
CHANGES DURING 4/97 - 6/97
- PatchTraps.c temporarily patches any of several traps, making them no-ops.
- Rush.c runs a critical bit of code with minimal interruption.
- SetCrsrState.c provides access to low memory globals that govern cursor visibility.
- SetGestalt1.c tightened up slightly, eliminating A6 stack frame from the 68K machine code since there's no opportunity for the Linker to fix up the address. It is possible that the old version was clobbering memory, though we never detected any problem.
- SetPriority.c enhanced to work in PowerPC code as well as 68K code.
- VBLInstall.c enhanced to work as 68K code resource (A4 globals).
- All demos updated to call ShowWindow after calling GDOpenWindow.
CHANGES DURING 3/97
- Added CommandPeriod.c, which returns true if the user just typed "command-period" (i.e. hit the period key while holding the Apple cloverleaf "Command" key). I've tried to write something like this many times in the past, and this is the first time that I've managed to implement it without any compromises or side effects. Using this function fixs bugs (in GetClicks.c and WaitSeconds.c) that were sureptitiously consuming keyDown events. The bugs are gone.
- CommandPeriod.c wasn't checking for the presence of the command key, so it treated plain period "." in the same way as command-period. Fixed. Reported by David Brainard.
- GDOpenWindow.c, following advice of Inside Mac, now leaves new window invisible. User must call ShowWindow to reveal it.
- MATLABMain.h is obsolete. Please remove it from your programs.
- Eliminated use of Timer.c from nearly all VideoToolbox files, using the new Seconds.c instead. TimeVideo no longer uses Timer.c.
- SetEntriesQuickly.c notes that Michael Zucca says (3/13/97), "I am currently working on color video drivers for the NetBSD/Mac community and I'm nearly done writing the driver for the IIvx/IIvi. I'll be releasing a web page explaining it along with the color kernel release in the next few days." http://www.rit.edu/~mrz5149/
- VBLInstall now saves the time of VBL in a new double "seconds" field in the vbl struct, so you can easily measure time since the beginning of the current video frame. Based on a suggestion of Stefan Treue.
- VBLInstall.c was crashing on 68K machines, because of the computation of the new double "seconds" field in the vbl struct, so that code is now enabled only if not GENERATING68K. (Apple's technotes explain that to do floating arithmetic in an interrupt service routine one would have to save and restore the 68881 registers.) Reported by David Brainard.
- VideoCards: Added link to the Radius Thunder Blunder page.
- VideoToolbox.h, when using THINK_C with Apple's universal headers, was leaving GENERATING68881 incorrectly defined (by Apple's headers) as 0 . VideoToolbox.h now overrides Apple's headers when you're using THINK_C and defines that symbol appropriately. Suggested by David Brainard.
- Added a package (in Utilities folder) contributed by Frans W. Cornelissen, "to read in luminance data from a Minolta LS-110/100 luminance meter into the mac. Several people have already expressed interest in it, and a few are already using it. Perhaps you would want to consider putting it into the VTB. At least one person, Hiro Akutsu has already mananged to plug it into your CalibrateLuminance program."
- WaitSeconds.c. Fixed bug that often resulted in intervals that were several hundred milliseconds too long. (CommandPeriod.c can take that long, because it calls EventAvail(), so we only call it if we have 0.5 s to spare.) Intervals are now accurate.
CHANGES DURING 2/97
- CenterRectInRect.c: added PinRectInRect(), which is useful for keeping a window on the screen.
- GetClicks.c: added WaitNextEventOrQuit, like the preexisting GetNextEventOrQuit, which exits if the user types a command-period while it's waiting.
PUBLISHED ON January 30, 1997
Until 9/96 I included Apple's NameRegistryLib and DriverServicesLib in the VideoToolbox:Libs: folder, but I've now deleted them since Metrowerks now includes them in their "Metrowerks CodeWarrior:MacOS Support:Libraries:MacOS PPC:" folder.
Since March, 1996, CopyBitsQuickly.c, for highest possible speed, uses Apple's BlockMoveDataUncached() on PCI Macs, and BlockMoveData() otherwise. As a consequence, all PowerPC projects that include CopyBitsQuickly.c must add DriverServicesLib (e.g. from your Metrowerks MacOS Support folder), which has the glue needed to call BlockMoveDataUncached(). Similarly, Identify.c uses NameRegistryLib to obtain more detailed information about PCI Macs. If you're using CodeWarrior, after adding DriverServicesLib and NameRegistryLib to your project, press the little arrows next to DriverServicesLib and NameRegistryLib and select import 'weak' from the pop-up menu. When you Make, ignore the Link Warning that BlockMove and BlockMoveData were previously defined in InterfaceLib.
CHANGES DURING 9/96-1/97
- Checked most of the projects for compatibility with CodeWarrior 10. Mostly this was a matter of allowing CodeWarrior to update the project format, in the Project setting "C/C++ Language", setting "Source Model:" to "Apple C", and enabling all C/C++ warnings and "Treat all warnings as errors".
- AfterDark.c enhanced by David Brainard to return the current state, so you can restore it later.
- AtExitToShell.c has additional documentation (no change in source code).
- GDOpenWindow.c made C++ compatible (thanks to Eric Fredericksen).
- GDOpenWindow.c enhanced to support 24-bit color (thanks to David Brainard).
- GDOpenWindow.c Fixed long-standing cosmetic bug in GDDisposeWindow(); it now restores the CLUT to a standard color table, and redraws the desktop, so that everything will look normal.
- Quitter.µ Metrowerks project now has the "High Level Events Aware" bit set, so Quitter works again.
- Seconds.c: new function s=Seconds() returns time, as a double with 20 µs or beter precision (20 ns on PCI PowerMacs), since the Mac booted. Unlike the routines in Timer.c, Seconds() is immune to interrupt suspension (at least on PCI PowerMacs), and has no overhead and no side effects.
- SndPlay1.c comments now include links to good references (no change in source code).
- Timer.c documentation: added Apple's confirmation, forwarded by Sigurdur Asgeirsson, of the formerly undocumented need to keep zeroing the tmReserved field. It's all now documented in Tech Note 1063, which cites the VideoToolbox. (Thanks Eric Simenel.)
- VBLInstall.c: You can now find out the time elapsed (in microseconds) since the beginning of the frame (i.e. last vertical blanking of your monitor). vblData->microTicks is set to Microseconds( ) at that time. Based on a suggestion of Stefan Treue.
- VideoToolboxMATLAB.c was discarded because it's no longer needed.
PUBLISHED ON August 22, 1996 (Info-Mac lost the 7/8 submission and asked me to resubmit.)
CHANGES DURING 8/96
- Removed most of the notes from the VideoToolbox archive, and added them to the web site.
PUBLISHED ON July 8, 1996 (No code changes since June 15; just added a Read me file, which several people had requested.)
CHANGES DURING 7/96
- Added Displays:Video cards page.
- Added Displays:Monitors page.
- Added Video synch:Video speed page.
- Recommend MATLAB on Advice page.
- Added a "Read me" document to the archive that alerts readers to CopyBitsQuickly.c's need for DriverServicesLib.
PUBLISHED ON June 15, 1996
CHANGES DURING 5-6/96
- Compatible with CodeWarrior 9 and Symantec C 8.1.
- Created VideoToolbox web site
- Documentation is now live, here at the web site, and no longer in the VideoToolbox archive.
- Updated ordering information for ISR Video Attenuator.
- AtExitToShell.c enhanced for use in MATLAB MEX resources.
- GDVideo.c and Identify.c use the new version macro UNIVERSAL_INTERFACES_VERSION, defined in Apple's ConditionalMacros.h, for compatibility with the new header files in CodeWarrior 9.
- GDVideo.c, added GDDisposeGamma() to free the memory allocated by GDSaveGamma.
- IsWindow.c checks a suspect WindowPtr.
- SetGestaltValue1.c, new routine, provides approximate equivalent to Apple's SetGestaltValue(), without requiring System 7.5.
PUBLISHED ON March 18, 1996
CHANGES DURING 11/95-3/96
- Compatible with CodeWarrior 8.
- CopyBitsQuickly.c, for highest possible speed, now uses Apple's BlockMoveDataUncached() on PCI Macs, and BlockMoveData() otherwise. As a consequence, all PowerPC projects that include CopyBitsQuickly.c must add DriverServicesLib (from the new VideoToolbox "Libs" folder), which has the glue needed to call BlockMoveDataUncached(). If you're using CodeWarrior, after adding DriverServicesLib to your project, press the little arrow next to DriverServicesLib and select "import 'weak'" from the pop-up menu. When you Make, ignore the Link Warning that BlockMove and BlockMoveData were previously defined in InterfaceLib. E.g. see the demo TimeVideo.
- Filter.c now reduces screen depth to no more than 8 bits, to stay within limitations of ConvolveX.c.
- GDVideo.c, added #def of cscSwitchMode for compatibility with old versions of Video.h, as suggested by David Brainard.
- GDVideo.c: Fixed documentation of GDSetEntries and GDGetEntries in GDVideo.c to reflect fact that cscSetEntries reads from table[0],.... whereas cscGetEntries writes to table[start],.... Also fixed TestCLUT.c.
- Identify.c, minor changes allow compiling it as a code resource, to make MATLAB MEX resources, as suggested by David Brainard. IdentifyModel() now always reports actual clock speed (in MHz) if known.
- IsCmdPeriod.c now uses Apple's IsCmdChar(&event,'.'), as suggested by Dan Sears.
- Lib folder contains Apple's NameRegistryLib and DriverServicesLib.
- MoveMouse.c, rewritten by Dan Sears, is now fully compatible with all Macs.
- Notes: "Pixel independence.doc" explains how to measure spatial interactions on a crt display.
- Quick3: added "fat" version, which runs native on all Macs, as suggested by Gary Rubin.
- Quick3.c now warns if you set delta=0, as suggested by Rhea Eskew.
- TimeCPU.c times BlockMoveDataUncached/BlockMoveData for memory-to-video transfers on PCI/non-PCI Macs.
- WriteLuminanceRecord.c now sets file creator of LuminanceRecord file to CodeWarrior instead of THINK C.
PUBLISHED ON November 8, 1995, in info-mac's new lib directory:
ftp://mirrors.aol.com/pub/info-mac/dev/lib/video-toolbox-95-11-10-c.hqx
CHANGES DURING 9-11/95
- I moved to New York.
- A custom version of the PowerMac 7500/8500 video driver was written for us by Apple Engineer Nano Urbina, nano@apple.com. It supports several extra resolutions, of which the most noteworthy is 640x480x120 Hz, which works well on the Apple 17" and 20" Multiscan. See "7500/8500 driver.doc". This is in response to a letter sent to Apple in spring '95 by 50 vision scientists. A copy of our letter is in the Notes folder: "cscSetModeTiming.doc". (Don't expect custom versions of other drivers; this is the only driver that Nano is the expert on. However, he is drafting a specification for what would become a standard driver call to allow us to set a monitor at any time to an arbitrary spatial and temporal resolution, subject only to hardware constraints, which is what we asked for in our letter.)
- All: Made compatible with CodeWarrior 7 (CW7). Bosco Tjan made it compatible with Symantec C 8. Renamed all files whose names ended in ".note" to end in ".doc". Minor change to GDVideo.c for compatibility with Apple's new universal headers (ETO18) distributed with CW7. Added copies of a few projects in CW7 format ".µ". Renamed all projects in CW6 format to end in ".µ6". Corrected spelling of dRAMBased to dRAMBasedMask.
- Assign.c: found and fixed obscure error due to freeing memory not allocated.
- Demo:ScrollDemo discarded, since it was specific to a now-obsolete NuBus video card.
- GDVideo.c: added GDSetDelay and GDGetDelay to support features unique to the PowerMac 7500/8500 video driver, to load the CLUT more quickly. Waiting for VBL is now optional.
- GDVideo.c: GDCardName() checks for the presence of the Slot Manager before using it.
- GDVideo.c: Added GDSwitchMode() which implements cscSwitchMode as documented in Designing PCI Video Cards and Drivers.
- GDVideo.c: added DriverGestalt(), GDGestalt(), and GDGestaltIsOn() to get full version number from video drivers that support this call.
- GetScreenDevice.c: GetDeviceSlot() now returns -1 if there's no Slot Manager. GetDeviceSlotName() returns a C string containing the "slot" name for any screen device, even built-in video, on Macs with NuBus, PCI bus, and no bus. Returns "" if none. Zero is a legal slot for built-in video devices.
- Identify.c: added support for PCI Macs, using Apple's new NameRegistry. Since System 7.5 fails to adequately name most Macs, IdentifyModel uses a built-in table of names. IdentifyModel, IdentifyVideo, and IdentifyMachine now give complete information on all Macs, provided that when running on PCI Macs they are compiled as PPC code. This limitation is a result of the (easy) way that I implemented the NameRegistry calls in Identify.c.
- Notes: added Apple's "Reset displays.doc".
- Notes: added David Brainard's "Raster graphic bibliography.doc".
- SetMouse.c: now compatible with all compilers.
- TimeVideo, as a result of the enhancement of Identify.c, now accesses the Name Registry on PCI Macs to report the computer name, clock rate, presence of L2 cache, and video card name. Fixed a PCI-related bug (no report if you requested testing of multiple resolutions).
- "Video bugs" has been incorporated into "Video synch".
CHANGES DURING 6-8/95
- All files: Changed nearly all instances of "#if THINK_C" to "#if THINK_C || THINK_CPLUS || SYMANTEC_C" for uniform behavior across the entire line of Symantec C and C++ compilers. The only conditionals still unique to THINK_C are: to include <pascal.h> instead of <Strings.h>, to identify the specific compiler in Identify.c, to use THINK C's csetmode(C_RAW,stdin) in kbhit.c, to use the "asm" directive in SetEntriesQuickly.c, to include MacMemory.h in VideoToolbox.h, and to use the NL kludge when we're compiling for MATLAB.
- All files: added conditionals to eliminate disk accesses for header files that have already been included. Most source files now include only VideoToolbox.h. Some include Traps.h and LowMem.h. These changes noticeably hasten compilation.
- AfterDark.c: AfterDarkEnable() and AfterDarkDisable() allow temporary disabling of the AfterDark screen saver. Written by David Brainard.
- AtExitToShell.c is a new routine, analogous to the ANSI routine atexit(), that attaches your call-back function to the ExitToShell trap (which always occurs) instead of the exit() function, which can be bypassed by abort() or direct escape to shell from a debugger. AtExitToShell() is now called by SndPlay1.c, Timer.c, and VBLInstall.c, so all projects that call those functions will need to add AtExitToShell.c. (AtExitToShell should be used carefully; C services like stdio may not be available at the time the ExitToShell trap is invoked.)
- GDVideo.c and Identify.c: small changes for backward compatibility with version 1 of Apple's universal headers. (Bug reported by Bart Farell.)
- GDVideo.c: GDSaveGamma(NULL) and GDRestoreGamma(NULL) now save and restore ALL devices. After the first request, GDSaveGamma() now ignores subsequent requests to save the same device's gamma table. GDRestoreGamma() no longer discards the saved copy, so multiple calls to GDRestoreGamma() will all be effective. The effect of these changes is that if you have multiple nested pairs of calls to GDSaveGamma and GDRestoreGamma, you will end up with the desired result: every RestoreGamma will restore the screen to the gamma it had at the time of the first call to GDSaveGamma.
- Grating.c: fixed the Grating.eps output file.
- IsFileSharingOn.c checks for running AppleShare server or File Sharing Extension. Returns 1 if either is running, or 0 if neither is running. KillFileSharing() kills the File Sharing Extension process, if running.
- Portable.68k.µ compiles the following files under strict Standard "ANSI" C. These files should work on any computer: VideoToolbox.h, Assign.c, Binomial.c, BreakLines.c, ChiSquare.c, Exponential.c, ffprintf.c, GetTimeDateString.c, HexToBinary.c, IsNan.c, Log2L.c, Mean.c, Nan.c, Normal.c, nrand.c, PrintfExit.c, PupilMTF.c, randU.c, ReadMATLABFile.c, Shuffle.c, Uniform.c, VLambda.c, all of Quick3.
- VideoToolbox.h is now compatible with Symantec C, thanks to Stefan Treue.
- VideoToolbox.h now #includes CodeWarrior's SIOUX.h console header.
- VideoToolbox.h and GDVideo.c made compatible with Symantec C/C++ 8.0 by Bosco Tjan, tjan@cs.umn.edu.
- WindowToEPS.c now makes a standard eps file, with file type 'EPSF' a PICT resource providing a preview. These eps files are perfect for importing into Word, PageMaker, etc.
PUBLISHED ON June 14, 1995
CHANGES DURING 6/95
- CopyBitsQuickly can now copy images of unequal size and pixelDepth. (I.e. it can expand by an integer multiple; shrinking has not been tested.) It expands MUCH faster than CopyBits does. As always, CopyWindows(...,srcCopy,...) uses CopyBits, and CopyWindows(...,srcCopyLiterally,...) uses CopyBitsQuickly. REQUIRED CHANGE TO YOUR PROJECTS: All projects that use CopyBitsQuickly must now add CenterRectInRect.c and SetPixelsQuickly.c, or the linker will complain that it can't find ExpandAndShiftRect(), ReadPixels(), and WritePixels().
- Identify.c: IdentifyGreenwichMeanTime() and IdentifyVM() provide informative strings about how many hours east or west you are of GMT and the state of virtual memory. IdentifyMachine() now should correctly identify all processors, gives speed in MHz if available, and omits the boring stuff (ROM size, cache status, QuickDraw version).
- KillEveryoneButMe.c: new routine (based on code from C.K.Haun at Apple) quits every other application on your machine, including the Finder.
- MATLAB: David Brainard and Geoff Boynton made minor changes to VideoToolbox.h and a few source files for compatibility with creation of MEX files for MATLAB.
- Timer.c: added a note alerting users to Apple's handy Microseconds() routine. It's now used in the demo NoiseVBL.c.
- TranslateLinefeeds.c and TranslateLinefeeds.h: no longer exist.
- VideoToolbox.h: now includes <fp.h> or <math.h>, to speed up compiling. (VideoToolbox.h automatically includes the latest available mathematical header file; it prefers fp.h, which is essentially a superset of math.h, but it knows that fp.h is only available in version 2 and later of Apple's universal headers.) Since VideoToolbox.h is normally pre-compiled, including the mathematical header speeds subsequent compiles. REQUIRED CHANGE TO YOUR PROGRAMS: Since <fp.h> and <math.h> are mutually incompatible, you should no longer include math.h in any source file that also includes VideoToolbox.h. REQUIRED CHANGE TO YOUR THINK C PROJECTS: You must now use different versions of the pre-compiled header, depending on whether 8881 support is enabled. Choose VideoToolbox.pre or VideoToolbox.f.pre.
- VideoToolbox.h now includes <assert.h>, or, if MATLAB is true, defines a MATLAB-compatible version of assert(). So don't #include <assert.h> in your source files.
- VideoToolbox.h: defines GENERATING68K, GENERATINGPOWERPC, and GENERATING68881, if not already defined by Apple's latest universal headers. Also defines GENERATING68020. These macros will always be defined, with the value 1 if true and 0 if false, so you can use them in both #if and if() statements.
- mc68881.h: remains, but is now obsolete. Expect it to disappear soon.
- ATMInterface.h: Made sure that the ATM structs are always 68k aligned so they'll conform to what Adobe Type Manager expects.
- CreateTrialSnds.c, GDVideo.c, GrabSlotDrivers.c, GrabVideoDrivers.c: Made sure that the Mac structs are always 68k aligned so they'll conform to what the Mac Toolbox expects.
- ReadMATLABFile.c,VideoToolbox.h: Made sure that MATLAB structs are always native aligned so they'll conform to what MATLAB expects.
CHANGES DURING 5/95
- All: now compatible with CodeWarrior 6.
- All projects: Eliminated use of Nan.c since fp.h now defines NAN for both 68k and ppc machines.
- All: Apple changed the prototype in the header file from SwapMMUMode(char *) to SwapMMUMode(signed char *). For compatibility with both old and new headers, all calls to this function in the VideoToolbox now cast the argument (void *).
- CenterRectInRect.c: added LocalToGlobalRect(), GlobalToLocalRect(), ExpandRect(), ExpandAndShiftRect(), ShrinkRect().
- IdentifyCompiler now can identify CodeWarrior C 6.
- PupilMTF.c: new file returns the contrast gain at any spatial frequency of a pupil of any diameter at any wavelength.
- SndPlay1.c, Timer.c, VBLInstall.c: disabled profiling of interrupt service routines because this might fail on 68k since A5 may not be set up.
PUBLISHED ON April 18, 1995
CHANGES DURING 3/95
- "Advice" and "Video synch" include much new information contributed by many colleagues.
- cscSetModeTiming.note added to Notes folder. It is a copy of a letter, signed by 55 visual scientists, sent to Apple requesting support for nonstandard video resolutions and frame rates.
- GDVideo.c: Added the DOME MD Max video card to the list of bad video drivers, which crash when asked to read the color lookup table. (The other offenders are the Mac IIci built-in driver and the Relax 19" Model 200.) GDSetEntries returns an error code instead of calling a driver that is known to be bad. This saves TimeVideo, TestGDVideo and your programs from crashing when driving these video cards. Thanks to Greg Jackson for reporting the crashes.
- NoisePdfFill.c: new routine makes binary-, uniform-, and gaussian-noise images quickly.
- TimeVideo 3.7.0 has been enhanced to fully support the yet-to-be released PCI Macs, and more explanation has been added to its "results" file.
CHANGES DURING 2/95
- StringBounds.c: Added StrOutlineLength and StringOutlineLength to measure the outline length of a string, in pixels.
- SetFileInfo.c: Added UpdateFinderNow, from MachTech Magazine.
CHANGES DURING 1/95 (after release)
- Updated all the THINK C projects in the demo folder.
- Note: the VideoToolbox applications now come in four possible flavors, indicated by the extension to the file name, e.g. Sandstorm, Sandstorm.68k, Sandstorm.ppc, or Sandstorm.fat. The plain extension indicates a 68k application produced by THINK C; it should run fine on all Macs, by virtue of the 68k-emlator on the PowerPC. The ".68k" extension indicates a 68k application produced by Metrowerks CodeWarrior C; it too should run on all Macs. The ".ppc" extension indicates a PowerPC application produced by Metrowerks CodeWarrior C; it will only run on PowerPC Macs. The ".fat" extension indicates a "fat binary" 68k/PowerPC application produced by Metrowerks CodeWarrior C; it will run native on all Macs. (As you may infer from the file sizes, a fat binary file is essentially the combination of the resources of both native applications, plus a cfg resource that says what's where. Most of the included "ppc" projects have been configured to produced a fat application.)
PUBLISHED ON January 14, 1995
CHANGES DURING 1/95 (before release)
- Updated everything to CodeWarrior 5. kbhit.c, MaximizeConsoleHeight.c, and several demos take advantage of new THINK-C-like features of the SIOUX console in CodeWarrior 5, and thus are incompatible with prior versions of CodeWarrior.
- Deleted all obsolete projects, i.e. for THINK C 5 & 6, and CodeWarrior 4. Everyone should upgrade to the current version; see the "Advice" document.
- kbhit.c: GetCharUnbuffered(), when compiled by CodeWarrior, hopefully now allows the console to respond to mouse events (dragging, zooming, sizing, etc.) while waiting for character input.
- MaximizeConsoleHeight.c: now works similarly for both THINK and CodeWarrior C.
- TimeVideo now offers to use Apple's new Display Manager, if present, to test multiple resolutions of each screen.
- "Video attenuator" document now explains, in detail, how to upgrade the ISR Video Attenuator to work with all Macintosh-compatible monitors.
CHANGES DURING 12/94
- Display Manager.note added to Notes folder.
- GDVideo.c: added GDGetDisplayMode(), based on cscGetCurMode, documented in Apple's new Display Device Driver Guide Developer Note in the January '94 Developer CD.
- Luminance.c: fixed rare zero-divide error reported by Josh Solomon.
- MoveMouse.c: still untested, but now compiles happily for both 68k and ppc.
CHANGES DURING 11/94 (after release)
- CenterRectInRect.c: renamed "RectInRect" to IsRectInRect().
- GDOpenWindow.c: renamed IsWindow to IsGrafPtr. Renamed IsOffScreen to IsGWorldPtr.
- MakeNoise.c replaced by NoiseFill.c.
- NoiseFill.c, replaces MakeNoise.c. NoiseFill fills the rect in the window with a random checkerboard, i.e. black & white checks, each dx pixels wide by dy pixels high.
PUBLISHED ON November 17, 1994
CHANGES DURING 11/94 (before release)
- Polished all code to compile without any warnings. (CodeWarrior is fussy.)
- Made everything compatible with THINK C 6 and 7, with Universal and pre-Universal headers. Eliminated use of THINK C's LoMem.h. (Thanks to David Brainard & Josh Solomon for reporting the incompatibilities.)
- Notes:"CopyBits slavishly" explains how to faithfully CopyBits numbers from one pixmap to another.
- Notes:"newline & return.note" documents the inconsistent ways that MPW, THINK, and CodeWarrior C handle /n and /r.
- CopyWindows.c provides a convenient high-level interface to CopyBits and CopyBitsQuickly, accepting windows (WindowPtr, CWindowPtr, or GWorldPtr) instead of pixmaps or bitmaps. Highly recommended!
- GDOpenWindow has been significantly revised in light of "CopyBits slavishly", though the calling interface is unchanged. Added new routines: GetBitMapPtr(window) returns a pointer to the window's bitmap or pixmap. IsOffScreen(window) returns true only if the window is a GWorldPtr.
- GDOpenWindow.c: applications that use GDOpenWindow.c now have the lasting side effect of changing the device's color table to gray (mode and depth are left unchanged). This is harmless, though slightly annoying. (You can use Control Panel:Monitors to restore Colors.) There are very good reasons for changing the color table to gray, and unfortunately no simple way to undo it when exiting. I'll fix it when I think of a clean solution.
- PixMapToEPS.c saves an image on disk as a PostScript EPSF file.
- Quick3: fixed minor bug in SortAndMergeContrasts reported by Bart Farell. If there were more than 2 identical contrasts, the 3rd (and 5th, etc.) would not be merged. This had no effect on Weibull fits since they effectively treat each trial independently, but it did allow an extra degree of freedom per unmerged contrast to the monotonic fit.
- SndPlay1.c: patch ExitToShell instead of calling _atexit().
- Timer.c: PeekTimerSecs() works, and has no side effects.
- VBLInstall.c: patch ExitToShell instead of calling _atexit().
- WindowToEPS.c: saves the image in a window or GWorld to disk.
CHANGES DURING 10/94
- As a gesture toward compatibility with Symantec C++, I've changed most instances of "THINK_C" to "(THINK_C || THINK_CPLUS)". However, I have not tried to compile under C++.
- ChooseScreen.c: new routine that asks the user to select a screen.
- fp.c: new file defines NCEG-compliant routines: ldtox80, x80told, and fpclassify, making them available on 68k as well as PowerPC.
- HideMenuBar.c can now run native on PowerPC.
- ImageStatistics.c, a new file, computes the minimum, maximum, mean, and mean square value of the pixels in a specified rect of a window or GWorld.
- Luminance.h and all files: capitalized "luminanceRecord" to "LuminanceRecord". A typedef retains backward compatibility.
- MoveMouse.c, from Apple, documents their new Cursor Device Manager.
- Sane.c has been discarded; replaced by fp.c, described above. Calls to ExtendedToDouble(), DoubleToExtended(), and ClassOfDouble() must be replaced by calls to similar routines defined in fp.c.
- SndCallBack1.c can now run native on PowerPC.
- TimeCPU.c: no longer times the SANE routine RandomX(), which was uselessly slow and doesn't exist on PowerPC.
- Timer.c: added PeekTimer and PeekTimerSecs, based on code from David Brainard.
- Timer.c: patch ExitToShell instead of calling _atexit().
- "CopyBits slavishly" a new document added to Notes folder, containing answers from Apple Developer Services to my questions.
- VBLInstall.c: Added new "frame" field to VBLTaskAndA5 struct, which counts up from zero.
CHANGES DURING 8-9/94
- All files: removed assumption in printf's that OSErr==int and that short==int. All instances of the variable "error" are now declared "int" and may be safely printed with "%d".
- Assign.c can now read Metrowerks CodeWarrior C style of printed NAN, e.g. "NAN(021)", in addition to MPW and THINK C styles.
- ATMInterface.c can now run native on PowerPC.
- Luminance.c: If necessary, IncrementLuminance() now bumps up the upper luminance bound to include the incremented luminance.
- RectToAddress.c was extracting the size (omitting flags) from rowBytes by ANDing with 0x1fff, which I've now changed to 0x3fff, as recommended by the Apple Tech Note "RowBytes Revealed".
CHANGES DURING 7/94
- All files: updated to support the MetroWerks CodeWarrior C compiler and PowerPC, especially VideoToolbox.h, mc68881.h, Identify.c, Require.c, and ReadMATLABFile.c. Changed "thePort" to qd.thePort. Eliminated all use of the printf pascal-string format "%#s" since it's not supported by CodeWarrior. Nan.c, IsNan.c, and the IsFinite macro in VideoToolbox.h now support 8-byte doubles, which is the standard size on the PowerPC. The entire VideoToolbox now compiles without error under CodeWarrior, but has yet to be tested.
- Assign.c: Added CopyDescribedVars. Fixed bug in ReadAssignmentStream and ReadAssignmentLine that garbled the returned error value. Found and fixed a memory leak in ReadAssignmentLine.
- ATMInterface.c: initATM does nothing if driver is already open.
- GDVideo.c: added GDNameStr(), which returns a C string, otherwise like GDName(), which returns a pascal string.
- GetTimeDateString.c: now suppresses leading zero in hours, e.g. "5:03 PM, Monday, September 13, 1993"
- MultipleChoice.c: added a new function Choose() that is more convenient that both MultipleChoice() and YesOrNo(), and renamed the file to Choose.c. Fixed cosmetic bug: MultipleChoice() was backspacing one too many times.
- SetEntriesQuickly.c was made compatible with compilers other than THINK C by making all use of the asm directive conditional on THINK_C. This disables all support for ProColor, Quadra, and Mac IIci and IIsi unless the file is compiled by THINK C.
- SetPriority.c now does nothing if compiled as PowerPC code.
- VideoToolbox.h: slightly adjusted the conditional definitions and inclusions relating to c2pstr and CtoPstr to restore compatibility with THINK C 5 and 6.
CHANGES DURING 6/94
- Fixed bug that crashed ConvolveX.c, CopyBitsQuickly.c, CopyBitsQuicklyOld.c, PixMapToPostScript.c, SetEntriesQuickly.c, SetOnePixel.c, and SetPixelsQuickly.c (and thus TimeVideo 2.5.6) when accessing a 32-bit address on a Mac whose ROMs were not 32-bit clean. For example, this made TimeVideo crash when testing a RasterOps 24L in a Mac IIx. It hadn't occurred to me that gestalt32BitCapable would return false on Macs with dirty ROMs even when the SwapMMUMode trap is available and should be called. The appropriate test is TrapAvailable(_SwapMMUMode). (Thanks to Margaret Bradley <BRADLEY@nervm.nerdc.ufl.edu> and Debbie Moore for the crash reports.)
- AddExplicitPalette() now also calls the new VideoToolbox routine MakeColorTableExplicit(). This will tell CopyBits to faithfully copy your pixels as numbers, without color translation, when you copy from your window. As a result you will now often be able to use CopyBits, with all its power, instead of my dumber substitute called CopyBitsQuickly.
- Assign.c: Fixed bug in ReadAssignmentStream and ReadAssignmentLine that garbled the returned error number. Reduced maximum linelength from 80 to 76, for easier emailing of assignment files (but, alas, I'm still getting 80 character lines). Enhanced error message to reveal any spurious nonprinting characters in offending text.
- CopyBitsQuickly.c: added support for BlockMoveData, but limited testing indicates no speed advantage, even on a Power Mac, so the new code is disabled.
- CopyBitsQuickly.c: added new transfer mode: addOverQuickly adds the source to the destination, four bytes at a time. This gives maximum speed for cases in which you know overflow won't happen. Overflow may carry over into neighboring pixels within the image.
- CopyBitsQuickly.c: Rewrote most of it, replacing all assembly code by portable C of similar speed. (Just in case, the old tried-and-true CopyBitsQuicklyOld.c is supplied as well.)
- GDOpenWindow.c: In response to a query by David Brainard I now document the obscure fact that GDOpenWindow's frame (not content) will overlap onto other screens that are contiguous parts of the desktop.
- Luminance.c: renamed "LtoEOrdered" to "LToEOrdered", fixing erroneous capitalization.
- "demos" folder now has "noFPU" versions of all projects that formerly used the 68881 chip, for compatibility with a wider range of Macs, especially the Power Macs.
- MaximizeConsoleHeight.c's documentation now acknowledges a limitation under 1-bit QuickDraw.
- "Multisync Sense Pins.note" by Philipp Biermann added to Notes folder.
- PrintfGWorld.c now calls SetGDevice(GetMainDevice()) before calling printf, since attempts to write to the console fail unless the main device is the current device.
- "Read me" now gives advice on using CopyBits and BlockMoveData.
- TimeVideo.c: This source file was mysteriously corrupted (several bad bytes) in the published version dated June 23, 1994. I restored it from a backup.
- TimeVideo 3.0.1 adds to the SimpleText "TimeVideo results" document a 'styl' resource specifying Monaco font.
- VideoToolbox.h: in the interest of portability, I've standardized on the names "c2pstr and p2cstr" because they're defined in Apple's Strings.h (rather than Symantec's pascal.h) and they're available in MacTraps (rather than MacTraps2), unlike the variously named alternatives: C2PStr, CtoPstr, P2CStr, and PtoCstr. However, for backwards compatibility, VideoToolbox.h guarantees that both c2pstr and CtoPstr and their mates p2cstr and PtoCstr are defined.
- VideoToolbox.h: so that all users might freely use Apple's new BlockMoveData (see "Read Me"), VideoToolbox.h now declares it, if necessary, which provides compatibility with Apple's old pre-Universal header files.
- Zoom.c now accepts a further argument, a pointer to the event record, which previously was accessed as a global variable. This will necessitate changes in all programs that call Zoom().
CHANGES DURING 5/94
- Art Wixson says the ISR Video Attenuators are once again in stock. See the "Video Attenuator" document.
- TimeCPU now includes timing for BlockMove() and BlockMoveData().
- Made entire VideoToolbox compatible with Apple's Universal Headers. Renamed "DateString" to "DatedString", and "StringToDate" to "StringToDateAndSecs", to avoid conflict with Apple's Universal Headers. Made minor changes to CalibrateLuminance.c, FlushCacheRange.c, GDTime.c, PlotXY.c, SetMouse.c, SndPlay1.c, Timer.c, and VBLInstall.c for compatibility with Apple's Universal Headers. (A bit more work may be required before these routines can be compiled to run native on the PowerPC.) Thanks to Bob Dougherty (wolfgang@cats.ucsc.edu) for reporting the incompatibility.
- To enhance compatibility with PowerPC, eliminated the use of low-memory globals in CopyQuickDrawGlobals.c, Sandstorm.c, and Zoom.c.
- Nan.c defines a pre-computed global double called "Nan" that contains the value 0.0/0.0.
CHANGES DURING 4/94:
- Added THINK C 7 projects.
- GetScreenDevice.c: added GetRectDevice().
- SetPixelsQuickly.c: enhanced to not flush its cache when writing to the main screen. In response to query by David Brainard.
CHANGES DURING 3/94:
- Added ATMInterface.c and ATMInterface.h from Adobe Systems Inc., allowing direct access to Adobe Type Manager for special effects.
- In Normal.c, added BoundedNormalIntegers(distribution,n,mean,sd,min,max), which fills the "distribution" array with n ordered integers so that random samples from the array, i=distribution[nrand(n)], will be samples from a bounded normal distribution.
- In nrand.c, replaced all three routines (nrand, nrandU, and nrandUL) by one universal routine, nrand(), that returns an unsigned long value and uses integer arithmetic (as in the old nrandU) if n is small enough, and otherwise uses double arithmetic (as in the old nrandUL).
- Added LtoE, EToL, and LtoEOrdered to Luminance.c. LtoE returns the index of the table entry in the specified range with luminance closest to L.
- Changed DateString.c to produce shorter strings by omitting the periods: "890625015959" instead of "89.06.25.01.59.59".
- Rewrote Shuffle.c to accept an arbitrary elementSize. (All calling programs will need to be changed, to add the new argument.)
- Deleted MyFgets.c from Quick3.
- Added CVNetConvert by Izumi Ozhawa to the Utilities folder.
- Added IdentifyOwner to Identify.c.
- Added MacMemory.h and MacMemory.c which, if included in your project, redefine the Standard C memory management calls (free,malloc,calloc,realloc) to use the Apple Memory Manager, bypassing Symantec THINK C's inefficient memory manager.
- Enhanced Assign.c slightly. PrintAnAssignment now prints enough digits to maintain the precision specified in float.h. This resolves the somewhat spurious errors reported by UnequalDescribedVars when doing read-after-write checks. Fixed PrintQuotedString to correctly handle strings containing the double-quote character. Cosmetic enhancement of how /* comments */ are printed, for nicer word wrap.
- Added RemovePalette(window) to GDOpenWindow.c, which complements the pre-existing AddExplicitPalette(window).
CHANGES DURING 2/94:
- Enhanced VBLInstall.c in response to query by Mike Tarr; it now runs forever if frames==-1.
- Enhanced StringBounds.c to also count the black pixels. An argument was added.
CHANGES DURING 1/94:
- Enhanced MultipleChoice.c to keep accepting characters until they uniquely specify an answer.
- Added routines to Mean.c to accept arrays of signed or unsigned char, short, or long. All the routines have been optimized for speed.
- Added StringBounds.c, which computes the minimum bounding rectangle for all the pixels that would be set black by calling DrawString with the given pascal string, in the current port, font, size, and style. CharBounds() creates a one-char string and calls StringBounds().
- Added PrintfGWorld.c, for debugging, which uses "printf" to print out the GWorld as a gross bitmap.
Changes 1990-3.