Apple IIgs System Software Release Notes Version 6.0.1 May 21, 1993 These release notes detail changes made from version 6.0 to 6.0.1 of the Apple IIgs System Software. Much of the material here is intended for programmers. For information affecting users, read the Whats.New and Shortcuts files on the SystemTools2 disk. This document does not describe new 6.0.1 toolbox and GS/OS features in detail. See the 6.0.1 addendum to Programmer's Reference For System 6.0. Sys.Resources Changes: Changed the rVersion resource ID=1 string to read "System Software" instead of "System" (this is important for the Finder's reorganized About box). Updated rErrorString resources to say "disk" instead of "volume." Fixed the standard window color table resource to have a white info bar fill color (the byte at offset 8 is now $F0 instead of $00). The Icon Button control now supports "sticky" icon controls. If bit 4 of the ctlFlag field is set and the mouse button is released when the cursor is inside the control, the control stays highlighted to show that it is "selected." The ctlValue field contains $0001 when the icon is in the selected state, and $0000 when it is not. An extra parameter, #12, has been added to the control template to allow for an initial value word for this type of control. Setting a thermometer control's value no longer draws anything if the control is invisible. The Launcher now zeros the BUSY flag (this makes Option-Open work in the Control Panels NDA). The Launcher sets the noResourceMgr bit in StartUpTools (to avoid a duplicate startup, which StartUpTools now checks for). ToolBox Changes: Window Manager v3.4 Tool014 Added a new call, UpdateWindow, to help redraw other people's windows safely. AlertWindow now uses UpdateWindow. DoModalWindow now uses UpdateWindow. If the mwUpdateAll bit is clear, it passes flags of $0000 for the dialog window, but $8000 (background update) for other windows--so the other windows update only if it's safe for them to background- update. If the mwUpdateAll bit is set, it always passes flags of $0000. It returns an error ($0E05, cantUpdateErr) for a background update of a System window, since System windows should always get updated from inside SystemEvent. Changed DoModalWindow so it doesn't invalidate controls on an activate if the window's fCtlTie bit is set, saying that the control states are independent of the window state. After DoModalWindow does an LECut, LEPaste, TECut, or TEPaste, it returns the ID of the control that was just edited. HandleDiskInsert duplicate-disk dialog now uses the Note alert icon instead of the 3.5" disk icon, since the dialog also appears for disks that look nothing like 3.5" floppies. HandleDiskInsert now treats error $51 (directory damaged) like error $5A (damaged bitmap); it puts up "This disk is damaged and can't be used. Eject/Initialize". Bits 31-24 of the updateProc to HandleDiskInsert are now honored even if the rest of the pointer is NIL. This way you can flag your window as not needing GS/OS for its update. HandleDiskInsert never replaces a window's existing wContDraw procedure, if it has one (we give it a wContDraw on the first call if it doesn't have one). Menu Manager v3.4 Tool015 In AllocateCache, we now clip the menu height to 200 for computing the size handle needed to save the screen. We were overflowing the computation for tall pop-up menus. See also TS3. When the pop-up control defproc handles a do_event message, now it only sends keyDown and autoKey events to MenuKey, not any old event. It also preserves the menu bar around the MenuKey call, so we don't accidentally leave the menu bar set to the pop-up menu control. DeleteMItem now properly shrinks the menu handle by twelve bytes (was ten). Not worth patching for ROM 3 (you get the bytes back when the menu goes away anyway). Pop-up proc uses DrawStringWidth to draw non-popped-up pop-up controls (it truncates long items in the middle). Control Manager v3.4 Tool016 Added four new calls: SetCtlValueByID, GetCtlValueByID, InvalOneCtlByID, and HiliteCtlByID. CtlStartUp removes the RefreshDesktop run queue routine, so the desktop doesn't refresh an extra time when starting an application in a different resolution from the one you used last (the scroll bars thought they had to redraw in 6.0, even though they really didn't). The Static Text control now supports a new ctlFlag bit. If bit $10, fSquishText, is set as well as fBlastText, the control will draw the text with DrawStringWidth to compress and truncate on the right. Replaced one GetSysPrefs call and two SetSysPrefs calls with two DoSysPrefs calls, which should significantly speed up every CMLoadResource call. (DoSysPrefs has lower overhead; it does not call GS/OS internally.) QuickDraw II Auxiliary v3.5 Tool018 Added three new calls: DrawStringWidth, UseColorTable, and RestoreColorTable. DrawStringWidth draws a string to fit in a specified horizontal width, compressing and/or truncating the string as necessary. The string can be Pascal, C, or GS/OS, and you can reference it by pointer, handle, or resource. The truncation is an ellipsis on the left, on the right, in the center, or no truncation. Compression is optional. UseColorTable preserves SCBs and sets them to use a color table you specify. It also preserves the old contents of that color table and sets the color table to the data you specify, or to a standard color table. UseColorTable returns a handle that you later pass to RestoreColorTable to put things back how they were. Generally, you will call UseColorTable on an activate event and RestoreColorTable on a deactivate event. Added several new icons to GetSysIcon: text ($04), source file ($B0), Applesoft BASIC program ($FC), archive ($E0), and binary file ($06). GetSysIcon now calls SendRequest with a new request code, systemSaysGetSysIcon, to allow utilities and applications to provide a replacement icon. Print Manager v3.2 Tool019 Fixed bad-parameter error code from PMLoadDriver & PMUnloadDriver to be $1309, as documented (was returning $1308 before). Line Edit v3.4 Tool020 Added a new call, LEClassifyKey, which classifies a keystroke as some combination of digit, letter, hex digit, editing key, and non-control-character. Added a new field to the Edit Line control template. Parameter number 9 is a word called keyMask. The control accepts keys only if the LEClassifyKey result has some bits set in common with the keyMask parameter. Changed interpretation of the Edit Line template pwChar field: A value of $FFFF now means the control is not for password entry. (Previously, the legal values were $0000 [default password character] and $0001 through $00FF [specific password character]. The parameter's presence implied that the control was for password entry, which is no good with the new optional ninth parameter.) Made LESetText erase the gap between the destination and view rectangles at the left edge of a scrolled field. Dialog Manager v3.5 Tool021 Fixed a bug that caused a crash if you made a SetDAFont to the FastFont handle (returned by GetSysFont), and then caused the Dialog Manager to beep. (This affected ROM 1 systems only.) Scrap Manager v3.2 Tool022 Added one new call, ShowClipboard, which creates a System window that takes care of the clipboard display for you (it's used in Finder and Teach, for example). It displays Text, Picture, and Sound scraps. If you copy a Sound to the clipboard (using the Sound control panel, for example), you can click on the Speaker icon on the clipboard to hear the sound. It also calls SendRequest with a new request code, systemSaysDoClipboard, to allow utilities and applications to customize or extend the clipboard display. PutScrap now changes the scrap count, as returned by GetScrapCount (for polling to see if the clipboard contents changed). Standard File v3.4 Tool023 Uses DrawStringWidth to draw standard items (allows compression and truncates on the right with an ellipsis). Added three new key equivalents. Command-Shift-UpArrow is the same as a Command-D or a clicking the Disks button. Command-RightArrow is the same as Command-Tab; it moves forward to the next drive in the list. Command-LeftArrow moves backward to the previous drive in the list. SFReScan now makes a DInfo and Volume call on the volume in prefix 8 and updates all of the controls accordingly. SFReScan now works in the volumes list as well as the files list. Fixed a hanging problem on SFGetFile (not SFGetFile2) when prefix zero was empty. Fixed a bug when closing the dialog where if the prompt string was a resource, it was being treated like a handle. Standard File windows now update behind modal windows and try to update back windows using UpdateWindow. Changed the way Standard File handles multiple edit line items in PutFile dialogs, so that there can be more than just the single edit line item. Fixed a bug in the check that was trying to restrict the promptRefDesc to values 0-2 but wasn't returning an error if it was out of range. It now returns badPromptDesc ($1701) as documented. Now passes a real auxiliary type to GetSysIcon (was always passing zero in 6.0). Volume name comparison in NextDrive routine is now insensitive to case, so if your prefix doesn't match the actual case of your disk, Command-Tab now takes you to the next disk instead of staying at the same one (but fixing the prefix). Simplified no-volumes message to read "No disks are available. Please insert a disk." Changed "volume" to "disk" in several messages. Now shows "zero K" instead of "0K" in space-on-disk messages (the guts of this change are in Long2Dec in Integer Math). Font Manager v3.4 Tool027 Expanded the size list in ChooseFont to 96 members. Added code to strip out duplicate sizes from the size list in ChooseFont. Duplicates of the same size would show up if two or more real fonts in the same family had the same size (but different styles). List Manager v3.4 Tool028 CompareStrings flag bit 15 now makes it compare GS/OS strings instead of Pascal strings. ListKey takes Clear and Delete to mean "zap the prefix" (just like waiting 2/3 of a second before typing). Fixed a bug affecting ListKey, CompareStrings, and SortList/SortList2 with compareProc of 1. Characters $20 to $3F (including digits), and $60 were being accidentally "uppercased." For example, in 6.0 "5" would map into right- arrow, which moved down one item. The standard item-draw procedure uses DrawStringWidth, with flags allowing horizontal compression and truncation on the right with an ellipsis. Text Edit v1.4 Tool034 TEPaintText now properly fully-justifies text. Fixed a problem with non-targetable Text Edit controls. They could start out active (with a usable scroll bar for example), and then become inactive when the window became inactive, but the control would not get reactivated when the window came back to the front. FMStatus call now pushes pre-zeroed result space, in case Font Manager is not loaded (the result is that you get an error reliably now, instead of just sometimes, if the Font Manager isn't available). Resource Manager v1.3 Resource.Mgr Added two new calls: OpenResourceFileByID and CompactResourceFile. OpenResourceFileByID starts the Resource Manager for you if it isn't already started under your ID (and it makes you the current resource application if it was already started for your ID). Then it uses LGetPathname2 to find pathname for the specified ID and calls OpenResourceFile for you on that file. Returns errors from LGetPathname2 and OpenResourceFile. oldResApp is valid even if you get an error. CompactResourceFile removes all free blocks (except the last special EOF free block) from a given file by moving chunks around in the file. Added some error checking code to OpenResourceFile that absolutely makes sure that the map was entirely read; if what is read doesn't equal what we asked for, it returns a GS/OS eofEncountered error. Added a new bit to mapFlag. Bit 0 is now defined as fileReadWrite. When a file is opened, it gets set to 1 if the file is opened read/write. If it's opened with read-only access, then the bit is set to 0. This bit is for examination only. AddResource, RemoveResource, WriteResource, and MarkResourceChange now verify that the target file can be written to before actually doing anything. They all return a GS/OS invalidAccess error if the file cannot be written to. The exception to this is MarkResourceChange when the resource in question is being marked unchanged; it is allowed as it won't eventually cause a write. Fixed WriteResource to write the size of the resource as it appears on disk, rather than the size of the resource's handle in memory. This properly allows for converters to write resources that are smaller than their in-memory size without destroying the file. CloseResourceFile returns error resFileNotFound ($1E07) instead of no error, on a nonzero argument that doesn't match an open file ID. Fixed string-comparison bug in RMFindNamedResource (and RMLoadNamedResource, which calls RMFindNamedResource). Sometimes in 6.0 you could wind up loading a resource whose name began with the name you asked for but was longer. TOOL.SETUP Tool.Setup contains patches that are needed for both ROM 1 and ROM 3. Tool Locator Optimized SendRequest (25% speed improvement in some cases). Optimized AcceptRequests and GetMsgHandle, too. StartUpTools now returns any error from ResourceStartUp. When we would have returned garbage for the result, we return NIL. StartUpTools and LoadTools now skip the message "This application needs ToolXXX" for tools that are present but too old (like ROM-based tools!). They still return an error code to the caller. ShutDownTools checks for a NIL input and behaves sanely. ResourceShutDown is now in the error-exit path, so it shuts down the Resource Manager even if you get some other error. ShutDownTools tolerates errors from SFShutDown (for compatibility with errant NDAs that shut down Standard File during Desk Shutdown even if they did not start it). ShutDownTools no longer calls HideCursor if QuickDraw is not active (in 6.0, it can crash if an application calls ShutDownTools with QD inactive). If the new-for-6.0 "no resource manager" flag bit is set, there is no problem (it was already skipping the HideCursor then). Misc Tools Added two new calls: DoSysPrefs and AlertMessage. DoSysPrefs clears and sets the specified bits in the GS/OS system preferences word, and then returns the previous value (error $0301 if GS/OS is not the current OS). AlertMessage provides access to code inside GS/OS that is smart enough to put an alert on either the text screen or the Super Hi-Res screen, depending on the environment. SysBeep2 now sends a new SendRequest code, systemSaysForceUndim, for all codes except $006x (screen blanking, screen unblanking). ShowBootInfo now "wraps up" to a new row if you have more than one row of icons. If you wrap off the top of the screen, it starts over at the bottom left, without erasing the screen. (It used to keep recycling the bottom row, wiping it to periwinkle blue every time it filled up.) Desk Manager Setting bit 31 of an action procedure pointer (for NDA or system window) does stack-based dispatch. function MyActionProc(code: integer; data: longint): integer; CDA menu checks ROM version before using ReadKeyMicroMemory to check for the control-panel-disable jumper. Was misbehaving on upgraded IIe ROM 1 machines. ROM 01 Patch TS2 If Battery RAM byte $59 bit 7 is set, TS2 installs Memory Peeker and Visit Monitor (just like ROM 3 does). Event Manager EMStartUp uses (26,17) (or (13,17) in 320 mode) for the initial mouse position if there is no message #6 specifying a position. This prevents top-left screen dimmers from dimming right away. Integer Math Int2Dec and Long2Dec return "zero " if the number being converted is zero, bit 31 of stringPtr is set, and the buffer length is at least 5. ROM 03 Patch TS3 Desk Manager DeskShutDown zaps $07FC if slot 4 is internal. This stops the mouse from freezing in desktop applications after visiting the CDA menu, when you have previously run an application that left a nonzero value in $07FC. This was a problem on ROM 3 systems only. OpenNDA sends reOpenAction to action routine of an already- open NDA, to give the NDA a chance to do something other than just have the window come to the front. Integer Math Int2Dec and Long2Dec return "zero " if bit 31 of stringPtr is set and the buffer length is at least 5. Patched Multiply to fix Menu Manager bug: AllocateCache was multiplying the bytes-per-line by the menu height, without clipping the height to 200 (screen height), as it does when it really uses the memory it allocates. Misc Tools SysFailMgr now provides useful default messages for common errors: $27: "Could not read or write disk. The disk may be damaged." $201: "Out of memory (or required memory area was already in use)." $308, $681, $682: "Detected trashed memory. Software bug or (less likely) bad RAM." SANE Fixed a problem in the ElemNum call FXPWRI where the source integer exponent was never being classified (whether it was zero, normalized, etc.), but we were still checking Src_Class to see if we should proceed. This could make really strange things happen in some applications. (For example, the AppleWorks GS spreadsheet could get stuck in an infinite loop if certain values were left over in bank zero.) Scrap Manager So that we can use the disk-based scrap later, undo what the ROM-based ScrapBootInit did before GS/OS was available (dispose all $4201 memory and set the Scrap Manager's WAP to NIL). Window Manager Fixed TaskMaster to handle the tmNoGetNextEvent bit correctly (it was treating the bit as reserved). This bit has existed since 5.0.3, but until now it worked only on ROM 1. Fixed a HandToHand call in WindStartUp which was copying data from a small handle to a big handle, using the size of the big handle (this was not harmful, but it was unclean). AppleTalk Port Driver v3.2 Reworked significant pieces of the driver to try much harder to establish a connection without error, and to write data to the PAP connection successfully. Also made PAPStatus try harder to get a response. Changed PrDevOpen to wait forever for the PAPOpen to complete, or until the user hits Command-Period. It always retries on $0808 error (server too busy to respond). Retries ten times on $0805 error (name not found). Changed PrDevWrite to wait forever for the PAPWrite to complete, or until the user hits Command-Period. Removed some completely unused code (driver is now 6 blocks on disk instead of 8). Changed the algorithm used to determine if AppleTalk is running. It used to check to see if a slot was set to "AppleTalk". It now checks for the presence of the AppleTalk main driver (which is the supported way anyway). LaserWriter Printer Driver v3.3 The driver appears to work with the LaserWriter Pro 600 and 630, but this combination has not been fully tested. Changed PostScript definition of /spf (the spotting function) to get it defined correctly on level 2 printers, using a hard-coded default spot function for when the dictionary isn't of HalfToneType 1. When we bypass the code that sets up the name tables and sends queries to the printer (because we're creating a PS file), we now explicitly set the LWType variable to 1, indicating a LaserWriter Plus or II. Now the code can find all the standard 35N fonts in the built-in name tables, instead of just the four faces used in LaserWriters plus Sonata, Carta and Shaston. This means you can now dump PostScript files that work correctly with the 35N fonts. (The "35N" fonts are included in the LaserWriter II and later.) Changed drawing of job dialog to include a call to PrGetNetworkName so we can draw the chosen printer's name in the job dialog. If there is no network printer (PrGetNetworkName returns NIL), it draws "No network - not supported". Added 3 lines in CkPrinterStatus to avoid a possible infinite loop. If our session timed out we start getting error $0806 from ReadLaser, but we didn't care. When printing to a PostScript file, there may be no user name. If PMGetUserName returns NIL, we now cleanly don't put a user name into the file. It used to insert garbage from $00/0000 in the file. IWEm 1.6 The test for the Personal LaserWriter NT (in order to fix the smaller imaging area) now checks that the product name contains the string "Personal", so it will also match the Personal LaserWriter NTR. GS/OS Changes: ProDOS (The Boot Stub, not ProDOS 8) If the user hits the "8" key before we run, then we load and run System/P8 instead of System/Start.GS.OS. Added code to compensate for a ROM 3 bug where the RAM5 RAM disk does not get created if you have 8 Megs of RAM. The ProDOS file now creates it for you and restarts the system (even if you hit "8" to boot into ProDOS 8). This means you get an extra beep on boot IF you have an 8 Meg ROM 3 and a nonzero RAM5 size. GS/OS (composed of the files GS.OS, GS.OS.Dev, and Start.GS.OS): SCM Added code to put a $4C at $BF00 at the beginning of every GS/OS call, so the Vulcan without a loaded driver will be happy. Two changes in the interrupt dispatcher: * Returns CLC if and only if at least one interrupt handler claimed the interrupt (was previously clearing carry when the LAST handler claimed it). * Restores MSLOT after dispatching to an IRQ.OTHER handler. OSShutDown was accidentally skipping the DeskShutDown call if flag bit 2 was clear. Changed SysBeep2 call in s_mount_msg to clean up stack on error (in case Tool.Setup isn't loaded yet). Was causing incoherent "yes/no/cancel" text dialogs during boot, if it tries to ask for the boot disk before Tool.Setup time. Restart no longer changes memory at $0300. GS/OS sends systemSaysForceUndim before deciding whether to put a message on the text screen or the Super Hi-Res screen. GLoader/GQuit After you press a key to continue (from "pause mode"), it erases the message so you know something happened. On a switch to ProDOS 8, instead of zeroing UNIT ($43), we store a $50 there. Zero was doing horrible things when left in DEVNUM and later fed to ON_LINE (returns much more data than expected). This was only left at zero in the somewhat strange case that you network-booted into GS/OS, and then switched to P8 but have so many devices online that your boot volume wasn't in DEVLST. Device Dispatcher Implemented a new driver characteristics bit to let us add new subcalls to DStatus and DControl. Drivers have always been required to validate all call requests that are sent to them, and return an error if they do not support the call. This includes the main driver commands as well as all subcalls. Unfortunately, some driver authors didn't feel that the guidelines needed to be followed, and they do random things if given a call they don't know about (some also crash). If this bit ($0010) is set in a device's characteristics word, the driver indicates that it properly follows the driver guidelines in the GS/OS reference and Device Driver reference. If this bit is not set, drivers will never receive a call that is not documented in the GS/OS reference (except device-specific calls, which are always passed on to the drivers). Initialization Manager Fixed a problem where supplying a non-editable volume name for the Format or EraseDisk calls, and the name was not syntactically acceptable to the chosen FST, the system went to the GS/OS version of system death. Limited the supplied volume name to 32 characters to ensure that the 36-byte buffers used internally are not overflowed. Changed the default disk name from Untitled to untitled. System Loader Filetypes $0030 to $003F (all auxiliary types) are now allowed for load files. Filetype/auxiliary type combinations must be assigned by Developer Technical Support, as usual. System Error Messages Added error message #66: "The selected AppleTalk connection could not be found. Be sure it is installed and the slot settings in the Control Panel are correct."