Apple II Technical Notes Developer Technical Support Apple IIGS #65: Control-^ is Harder Than It Looks Written by: Dave Lyons September 1989 This Technical Note describes a problem using Control-^ to change the text cursor with programs that use GETLN. On the Apple IIGS, typing Control-^ changes the cursor to the next character typed. This feature works properly from the keyboard, but there is a problem when programs print the control sequence.
Apple II Technical Notes Further Reference • Apple IIGS Firmware Reference, p.
Apple II Technical Notes ® Developer Technical Support Apple IIGS #66: ExpressLoad Philosophy Revised by: Written by: Matt Deatherage Matt Deatherage May 1992 September 1989 This Technical Note discusses the ExpressLoad feature and how it relates to the standard Loader and your application. Changes since September 1990: Clarified some changes now that ExpressLoad and the System Loader are combined to be “Loader 4.0” in System Software 6.0.
Apple II Technical Notes Since ExpressLoad focuses on the common things performed by the majority of applications, it may not support those applications which rely upon certain features of OMF or the System Loader. In these cases, the System Loader loads the file as is expected. ExpressLoad always gets first crack at loading a file, and if it is an Expressed file that ExpressLoad can handle, it loads it. If the file is not an Expressed file, the regular System Loader loads it instead.
Apple II Technical Notes ® Developer Technical Support Apple IIGS #67: LaserWriter Font Mapping Revised by: Written by: Matt Deatherage Suki Lee & Jim Luther May 1992 September 1989 This Technical Note discusses the methods used by the Apple IIGS Print Manager to map IIGS fonts to the PostScript® fonts available with an Apple LaserWriter printer.
Apple II Technical Notes PostScript font families include plain, bold, italic and bold italic fonts. Some fonts families may also have serif and sans serif fonts or fonts of different weights (line thickness). These fonts are generally named by adding a style suffix to the base family name. Unfortunately, there is no uniform method for naming fonts, since most fonts were named by their designers and many of the names have historical significance.
Developer Technical Support May 1992 The three examples shown in Table 1 show three variations of the plain font, two variations of the bold style, three variations of the italic style, and three variations of the bold italic style. There are others such as ZapfChancery-MediumItalic, Korinna-KursivRegular, and LetterGothic-Slanted which all denote the italic style of the respective font family.
Apple II Technical Notes Further Reference • Apple IIGS Toolbox Reference, Volumes 1 & 2 • Apple LaserWriter Reference Carta is a trademark of Adobe Systems Incorporated. PostScript and Sonata are registered trademarks of Adobe Systems Incorporated. Helvetica®, Palatino®, and Times® are registered trademarks of Linotype Co. ITC Avant Garde®, ITC Bookman®, ITC Zapf Chancery®, and ITC Zapf Dingbats® are registered trademarks of International Typeface Corporation.
Apple II Technical Notes Developer Technical Support Apple IIGS #68: Tips for I/O Expansion Slot Card Design Written by: Rob Moore & Jim Luther September 1989 This Technical Note points out several potential problem areas developers should know about when designing I/O expansion slot cards for the Apple IIGS. This Note is written for experienced design engineers.
Apple II Technical Notes accesses to internal I/O or expansion card slots, and accesses to banks $E0 and $E1. Accesses to any expansion card ROM areas that are set to Internal ROM with the Slot register do not assert the /M2SEL signal and run at the 2.8 MHz speed rather than the normal 1 MHz expansion card speed.
Developer Technical Support September 1989 Using the Ready Signal The Ready (RDY) input to the 65C816 is used to prevent a CPU cycle from completing until the expansion card has accepted the data output or has its input data available. When the RDY input to a 65C02 or 6502 is held low, the processor continues to output the same address until RDY is released and the CPU completes the current cycle.
Apple II Technical Notes 35ns min PH2 25ns max PH0 /M2SEL /NMI, /IRQ, /RST, RDY Safe to assert or deassert 60ns min Figure 2–Control Signal Setup Time Interrupt Request, Non-Maskable Interrupt, and Reset The Interrupt Request (/IRQ), the Non-Maskable Interrupt (/NMI) and the Reset (/RST) signals are all interrupt lines that are sampled by the CPU when the PH2 clock falls. If they are valid 30 nanoseconds before the PH2 clock falls, they are recognized on the following cycle.
Developer Technical Support September 1989 The /DMA signal should be asserted and deasserted within the 100 nanosecond period after PH0 falls, and the DMA address should be emitted by the expansion card about 30 nanoseconds later. In any case, the address should be stable on the address bus no later than 120 nanoseconds after PH0 falls.
Apple II Technical Notes solid technique is using the first rising edge of the 7M clock, after PH0 rises. This method may require an additional flip-flop, but it guarantees the desired delay. On the other hand, expansion card read data buffers should be turned off as soon as possible when PH0 falls to avoid a fight when the data buffers turn back out again. Figure 3 shows the recommended data transfer timing for the data bus.
Developer Technical Support September 1989 Since the Apple IIGS was released, several “super” expansion cards have become available. These cards typically provide a lot of performance and functionality, but in most cases, the power consumed by one card is more than the specified power available to all the expansion slots. Generally these cards work without problems. However, when several “super” cards are installed in a IIGS system, the total power drawn can exceed the available power supply capacity.
Apple II Technical Notes ® Developer Technical Support Apple IIGS #69: The Ins and Outs of Slot Arbitration Revised by: Written by: Matt Deatherage Matt Deatherage May 1990 September 1989 This Technical Note discusses the concept of a 14-slot Apple IIGS system through dynamic software slot arbitration. It presents concepts of which all IIGS programmers should be aware for full compatibility.
Apple II Technical Notes Although the Slot Arbiter does not function in System Software 5.0 or earlier, it may function in the future. A skeleton is present in version 5.0 and later that accepts Slot Arbiter calls, but the skeleton does not actually switch any slots. This Note details the Slot Arbiter functionality and shows how to search a 14-slot system for peripherals and their identification bytes. Note: The Slot Arbiter must not be used unless GS/OS is the current operating system.
Developer Technical Support May 1990 Slot Number F E D C B A 9 8 7 6 5 4 3 2 1 0 Slot 0 = Internal; 1 = External Zero Call Type Identifier 00 = Slot Request 11 = Select by Bit Encoded Slot Configurati Zero Slot Dependent or Slot Independent Figure 1–Slot Number and Bit Definitions Bit Encoded Slot Configurations Every call to the Slot Arbiter returns (on exit) a miniature picture of the slot configuration in the X register (as it was on entry).
Apple II Technical Notes Bit Encoded Slot Configuration F E D C B A 9 8 7 6 5 4 3 2 1 0 0 1 = slot 1 active 1 = slot 2 active 1 = slot 3 active 1 = slot 4 active 1 = slot 5 active 1 = slot 6 active 1 = slot 7 active 0 1 = slot 9 active 1 = slot 10 active 1 = slot 11 active 1 = slot 12 active 1 = slot 13 active 1 = slot 14 active 1 = slot 15 active Figure 2–Bit Encoded Slot Configuration By fully using the slot number parameter, the Slot Arbiter returns any aspect of the current slot configuration
Developer Technical Support May 1990 device before it gets control. However, there are some applications (such as peripheral card configuration programs) which go directly to firmware or hardware, not using GS/OS. Perhaps the card has no ROM, so there is no generated driver, or perhaps there is no loaded driver and the generated driver does not control certain aspects of the hardware. In any case, such applications are directly impacted by slot arbitration.
Apple II Technical Notes become accustomed, everyone has a better chance of working by sticking to the general Apple IIGS rule of “put back what you use when you’re done with it.” Ask for the slot, use it, then restore the previous Bit Encoded Slot Configuration. (If you use multiple slots, you might wish to get the Bit Encoded Slot Configuration, save a copy, modify it to reflect the slots you want, and restore from the modified version.
Developer Technical Support May 1990 There are certain applications with more specialized needs, such as high-speed, single character input or output. In such cases, the Slot Arbiter may be a bottleneck. When a slot is not switched, the Slot Arbiter returns quickly, but when a slot must be switched, it takes a significant amount of time. Doubling that significant time for switching in and restoring gives a substantial overhead for each hardware access, which may be too much for some applications.
Apple II Technical Notes Apple strongly recommends that the Text Tools not be used. GS/OS character-based drivers are preferable for standard character input and output. The Text Tools may be used for specialized purposes; however, you cannot access some internal ports and other components of the system that are not well-behaved. Doing so could cause your application to trash memory or media. You must assume these risks when using the Text Tools.
Developer Technical Support May 1990 FWEntry The Miscellaneous Tools call FWEntry should not be used to access entry points on a peripheral card (entry points in the $Cxxx range). As discussed, a poorly-behaved routine could switch the slot from one you’ve identified to something else between the time you identify the slot and issue the FWEntry call.
Apple II Technical Notes Developer Technical Support Apple IIGS #70: Fast Graphics Hints Written by: Don Marsh & Jim Luther September 1989 This Technical Note discusses techniques for fast animation on the Apple IIGS. QuickDraw II gives programmers a very generalized way to draw something to the Super Hi-Res screen or to other parts of Apple IIGS memory. Unfortunately, the overhead in QuickDraw II makes it an unacceptable tool for all but simple animations.
Apple II Technical Notes Another source of overhead is branching instructions in loops. By “straight-lining” the code to move up a scan-line’s worth of memory at one time, branch instructions are avoided. Following is an example of this technique.
Developer Technical Support lda pha lda pha lda pha |164,y September 1989 ; accumulator is 16 bits for ; best efficiency |162,y |160,y In this example, the Y register is used to point to data to be moved to the graphics memory, and hard-coded offsets from the Y register are used to avoid register operations between writes. Hard-Code Instructions and Data In desperate circumstances, it is necessary to remove overhead from the previous code example.
Apple II Technical Notes data to the graphics memory may run at the same speed as a second loop with a higher cycle count. A careful analysis of the synchronization problem leads to the following tables, which are useful as a rough estimate of the speed attained by different pieces of code. Each entry is based on the number of cycles consumed during consecutive write instructions. For example, a series of PEA instructions requires five cycles for each 16-bit write.
Developer Technical Support September 1989 By using only the VertCnt register and ignoring the low bit of the 9-bit vertical counter stored in HorizCnt, you can determine within 2 scan lines which scan line is currently being drawn. The VertCnt video counter contains the number of the current scan line divided by two, offset by $80. For example, if the scan-line beam was currently refreshing either scan line four or five, VertCnt would contain $82 (4/2 + $80 or 5/2 + $80).
Apple II Technical Notes Clever updates can modify twice as many pixels on the screen by sacrificing some smoothness, running at 30 frames per second instead of 60. The technique is as follows: 1. Wait for the scan line beam to reach the first scan line. 2. Start updates from the top of the screen, being careful not to pass the scan line beam. 3. Continue updates while the scan line beam progresses toward the bottom of the screen, then goes into vertical blanking, then restarts at the top of the screen. 4.
Apple II Technical Notes ® Developer Technical Support Apple IIGS #71: DA Tips and Techniques Revised by: Written by: Dave “Mr. Tangent” Lyons Dave Lyons May 1992 November 1989 This Technical Note presents tips and techniques for writing Desk Accessories. Changes since December 1991: Reworked discussion of NDAs and Command- keystrokes. Marked obsolete steps in “NDAs Can Have Resource Forks.
Apple II Technical Notes 2 of 6 Apple IIGS #71: DA Tips and Techniques
Developer Technical Support HowMuchStack start ; NoStackSpace keepStack restoreStack noDispose Exit pRegister theOldStack stackImage gequ May 1992 $1000 phd phb phk plb pha pha PushLong #HowMuchStack pha _MMStartUp pla ora #$0f00 pha PushWord #$C001 PushLong #0 _NewHandle tsc sta theOldStack bcs NoStackSpace tcd lda [1] tcd clc adc #HowMuchStack-1 pha ldx #$fe lda >$000100,x sta stackImage,x dex dex bpl keepStack pla tcs jsl RealCDAentry php php pla sta pRegister sei ldx #$fe lda stackImage,x sta >$00
Apple II Technical Notes When this routine calls RealCDAentry, the carry flag is set if no extra stack space is available. If the carry is clear, the additional stack space was available and the direct-page register points to the bottom of that space. RealCDAentry available bcs ...
Developer Technical Support May 1992 The Memory Manager knows an interrupt is in progress, so CompactMem takes no action and memory allocation requests do not cause unlocked memory blocks to move and do not attempt to purge purgeable blocks to make room. Memory allocation requests will still normally succeed, but you will not be able to allocate a block larger than the value returned by MaxBlock.
Apple II Technical Notes New Desk Accessory Tips and Techniques An NDA Can Find its Menu Item ID After the application has called FixAppleMenu, an NDA can look at its menu item template (after the “\H” in the NDA header) to determine the menu ID corresponding to the NDA’s name in the Apple menu. This is sometimes useful to pass to OpenNDA (if the NDA has some way to open itself), or to pass to a Menu Manager call. Finding the menu item ID in the NDA’s header is easy if the NDA is written in assembly.
Developer Technical Support May 1992 position, which may overlap the window’s content. In addition, when the user chooses a menu item, the front NDA receives the mouseUp before the menu’s image is removed, and the image may overlap the NDA’s window. In either case, drawing in the window makes a mess. The solution is to avoid drawing in direct response to a mouseUp. Instead, invalidate part of the window to force an update event to happen later.
Apple II Technical Notes NDAs Can Have Resource Forks Following is the recommended way for a New Desk Accessory to use its file’s resource fork. In the NDA’s Open routine, do the following. Steps that are obsolete (and safely omitted) with System Software 6.0 and later are marked with an asterisk (*): 1. Call GetCurResourceApp and keep the result. 2. If the NDA does not already know its Memory Manager user ID, call MMStartUp to get it. 3. Call ResourceStartUp using the NDA’s user ID. 4.
Developer Technical Support May 1992 NDAs Must Be Careful Handling Modal Windows If your NDA uses its resource fork and calls TaskMaster with a restricted wmTaskMask to produce a modal window, you must be careful not to allow TaskMaster to update the contents of any application windows that happen to need updating.
Apple II Technical Notes • • • • 10 of 6 Apple IIGS Hardware Reference Apple IIGS Technical Note #53, Desk Accessories and Tools Apple IIGS Technical Note #57, The Memory Manager and Interrupts Apple IIGS Technical Note #69, The Ins and Outs of Slot Arbitration Apple IIGS #71: DA Tips and Techniques
Apple II Technical Notes ® Developer Technical Support Apple IIGS #72: QuickDraw II Quirks Revised by: Written by: Dave Lyons Dave Lyons & C. K. Haun
May 1992 November 1989 This Technical Note points out some things things you need to watch out for when using QuickDraw II, especially with FastPort-aware and Shadowing modes. Changes since November 1990: Removed some obsolete information on ScrollRect and on shadowing. Noted that DrawPicture in 6.0 is now compatible with FastPort mode.Apple II Technical Notes You May Need SetBufDims! The call description for SetBufDims on page 16-215 of Volume 2 of theToolbox Reference is misleading. The note in the description states, “You only need to make this call if your application is going to use, or allow the user to choose, fonts that have unusually large values of chExtra and spExtra.
Apple II Technical Notes ® Developer Technical Support Apple IIGS #73: Using User Tool Sets Revised by: Written by: Dave “flag bits” Lyons Dave Lyons July 1991 November 1989 This Technical Note explains how to write a user tool set and why writing a user tool set is better than stealing a system tool set number. Changes since January 1991: Expanded recommendation on where to keep user tool set files on disk and clarified SetTSPtr information.
Apple II Technical Notes If you do use the WAP in a conventional way, your xxxStatus function should return TRUE if the WAP is nonzero; your xxxStartUp function should set the WAP to a non-zero value pointing to some memory space you own (provided by the caller, or allocated with NewHandle using a memory ID provided by the caller); and your xxxShutDown function should set the WAP back to zero.
Developer Technical Support July 1991 down and allow it to remain in memory in a purgeable state; if you do this, you should try to revive your tool set with Restart before you try InitialLoad or InitialLoad2.) To allow several applications to share one copy of a user tool set file, you may want to keep your user tool set in the user’s *:System:Tools folder. To avoid duplicate file names, leave the ToolXXX names for System tool sets, and give your user tool set a descriptive name.
Apple II Technical Notes When your application quits and calls TLShutDown, the system disconnects your tool set from the user tool set TPT. If the U s e r S h u t D o w n is not followed immediately by the TLShutDown, you may wish to use SetTSPtr to cleanly remove your tool set from the system (set the tool set pointer so that it points at a zero word).
Apple II Technical Notes ® Developer Technical Support Apple IIGS #74: Top Ten List Manager Things Revised by: Written by: Dave Lyons Jim Mensch May 1992 November 1989 This Technical Note presents a method for speeding up custom List Draw routines, with sample source code for the APW assembler. Changes since November 1989: Added information on memFlag and on shared rListRef resources, and noted that System 6.0 already checks the clip region and calls your listDraw routine only when needed.
Apple II Technical Notes Eight—Custom listDraw Routines and the Clip Region The custom listDraw routine below speeds up your list when running System Software earlier than 6.0. The System 6.0 List Manager already calls your listDraw routine only for members that will not be completely clipped (but this is still a good starting point if you’re writing a custom listDraw routine for some other reason). To scroll text, the List Manager calls ScrollRect to scroll the list—then 6.
Developer Technical Support Skip2 NoTest blt skip2 brl NoDraw ldy #bottom inc a lda [therect],y ldy #rgnBounds+top cmp [listhand],y blt NoDraw ANOP PushLong theRect _EraseRect May 1992 ; if not don't draw..
Apple II Technical Notes DimMask NorMask dc i1'$55,$AA,$55,$AA,$55,$AA,$55,$AA' dc i1'$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF' end Seven through One—Reserved For Future Expansion Further Reference • Apple IIGS Toolbox Reference, Volumes 1 and 3 4 of 4 #74: Top Ten List Manager Things
Apple II Technical Notes ® Developer Technical Support Apple IIGS #75: BeginUpdate Anomaly Revised by: Written by: Dave Lyons Eric Soldan May 1992 January 1990 This Technical Note discusses a Window Manager anomaly with the handling of the visRgn and the updateRgn between BeginUpdate and EndUpdate calls. Changes since January 1990: Updated for System 6.0.
Apple II Technical Notes So What’s the Problem? The problem is that the updateRgn is not a very good place to save the visRgn. Since InvalRect and InvalRgn modify the updateRgn, if either of these two calls is made between a BeginUpdate and EndUpdate, they modify the saved visRgn. When the update is finished, EndUpdate restores the modified visRgn instead of the original. The solution to this problem seems simple enough: don’t call InvalRect or InvalRgn between BeginUpdate and EndUpdate.
Developer Technical Support May 1992 But I Have to Do… If you absolutely must do some of the things previously discussed, there is a way to accomplish it. It is not simple, but it can be done. Assuming that BeginUpdate has been called, and an application is in its update procedure: 1. Create a new region and copy the visRgn into it. Doing this allows the application to restore the visRgn to just the area to be updated that BeginUpdate calculated.
Apple II Technical Notes Some consideration was given to posting an application event via the PostEvent call. Unfortunately, there is a possibility that this application event will drop out of the queue not handled. When the queue is full, the oldest event is dropped, and this could occur to application events, which would be very bad in this case. Due to this possibility, posting an application event refers to setting a global variable that is checked before the TaskMaster call in the main event loop.
Apple II Technical Notes ® Developer Technical Support Apple IIGS #76: Miscellaneous Resource Formats Revised by: Written by: Matt Deatherage Matt Deatherage, C.K. Haun, Llew Roberts & Dave Lyons May 1992 January 1990 This Technical Note describes resource structure formats for previously-unpublished types. Changes since December 1991: Added information on rFont resources.
Apple II Technical Notes The resource compiler template follows: #define rSoundSample $8024 /*---------------------- rSoundSample --------------------*/ type rSoundSample { integer; /* format */ integer; /* wave size */ hex integer; /* rel pitch */ integer; /* stereo channel */ unsigned integer; /* sample rate */ hex string; /* raw 8 bit sound data */ }; Cursor Resource (Type: $8027, rCursor) The following describes the Cursor resource format: height width image (+000) Word (+002) Word (+004) Bytes The
Developer Technical Support May 1992 Following is a simple cursor example: resource rCursor(1,fixed) { 5, /* height */ 2, /* width */ $"ffff0000" $"f00f0000" $"f00f0000" $"f00f0000" $"ffff0000", $"ffff0000" $"ffff0000" $"ffff0000" $"ffff0000" $"ffff0000", 2, 2, $80 /* hotspot Y */ /* hotspot X */ /* 640 mode */ }; Note that the resource is marked fixed so that its handle can be dereferenced and passed to SetCursor.
Apple II Technical Notes name (+006) String moreInfo (+xxx) String verMalta 22 verCyprus 23 verTurkey 24 verYugoslavia 25 verIreland 50 verKorea 51 verChina 52 verTaiwan 53 verThailand 54 Pascal string containing the desired name. May be the null string. Additional information to be displayed, such as a copyright notice. May be the null string. Recommended maximum length is about two lines of 35 characters each. May contain a carriage return (character $0D).
Developer Technical Support May 1992 Note: For compatibility with the Finder, keep the name field identical across different versions of the same application, and make sure the version field increases on each later version released to your customers. The moreInfo field is not critical; if it changes between versions, it’s no big deal. Comment Resource (Type: $802A, rComment) Files may include a comment resource with ID=1 for display by programs such as the Finder.
Apple II Technical Notes Following is a simple rTaggedStrings example: resource rTaggedStrings(1) {{ $0050, "red", $0033, "green", $0100, "blue" }}; Pattern List Resource (Type: $802F, rPatternList) A pattern list resource contains zero of more 32-byte QuickDraw II patterns. (This resource type exists for your convenience. The System Software contains no direct support for resources of this type.) firstPattern secondPattern ... (+000) 32 Bytes (+032) 32 Bytes First QuickDraw II pattern structure.
Developer Technical Support May 1992 The resource compiler template follows: #define rRectList $C001 type rRectList { integer = $$Countof(RectArray); array RectArray { Rect; }; }; Print Record Resource (Type: $C002, rPrintRecord) As a convenience for applications, a print record may be included as a resource of type $C002 (rPrintRecord). If more than one of these resources is present, the one to use as the document’s primary print record is the first one.
Apple II Technical Notes Nevertheless, in some cases keeping fonts inside an application file is necessary or desirable. In such cases, the rFont resource is a convenient way to keep a font around. The resource is a QuickDraw II Font, as defined in Apple IIGS Toolbox Reference, Volume 2. The font family name is the resource’s name—the same Pascal string that normally precedes the QuickDraw II font record in the font file. font (+000) Bytes The font record, without the font family name.
Apple II Technical Notes ® Developer Technical Support Apple IIGS #77: Print Manager & AppleTalk Configuration Files Written by: Jim Luther January 1990 This Technical Note describes the Print Manager user configuration file Printer.Setup and the AppleTalk user configuration file ATInit. This Note also describes a limitation of the Print Manager call PrGetUserName, which is a result of the way configuration information is stored in the Printer.Setup file. Printer.
Apple II Technical Notes What Writes to the Printer.Setup and ATInit Files? Before Apple IIGS System Software 5.0, Printer.Setup and ATInit were handled as completely separate configuration files. The Print Manager call PrChoosePrinter allowed you to select the printer and port drivers the Print Manager would use and wrote the printer and port driver selections to the Printer.Setup file. The AppleTalk application Chooser.
Developer Technical Support Apple IIGS #77: Print Manager & AppleTalk Configuration Files January 1990 3 of 4
Apple II Technical Notes Network Booting and Printer.Setup When Apple IIGS computers are booted over an AppleShare network, they all share a single copy of the Printer.Setup file. That means all machines must use the same printer and port driver selections that are stored in the Printer.Setup file. If all machines are expected to be able to print using the Print Manager tool set, then the printer and port selection stored in Printer.Setup must be something that all can use.
Developer Technical Support January 1990 If your application needs the complete default AppleTalk User Name, it can be read from the ATInit file. When an Apple IIGS is booted from a local disk volume that has AppleShare or at least one of the AppleTalk network printers installed, ATInit will be found in the System:System.Setup directory of the local boot volume.
Apple II Technical Notes The ATInit File Format The AppleShare Programmer’s Guide for the Apple IIGS shows the file format of the ATInit file as it is stored on an AppleShare boot volume. However, the file format of ATInit is not always as shown in that manual. In all cases, ATInit will contain the three required data fields UserName, PrinterFlags, and PrinterTuple at the end of the file. Before those data fields, ATInit may also contain executable code or additional data fields.
Developer Technical Support January 1990 Further Reference • Apple IIGS Toolbox Reference • Inside AppleTalk • AppleShare Programmer’s Guide for the Apple IIGS\ Apple IIGS #77: Print Manager & AppleTalk Configuration Files 7 of 4
Apple II Technical Notes ® Developer Technical Support Apple IIGS #78: Bank Alignment and Memory Management Revised by: Written by: Matt Deatherage Matt Deatherage May 1992 March 1990 This Technical Note discusses the way the Memory Manager deals with requests for memory that is already in use, and why this can be really annoying. Changes since March 1990: Included new information about some smarter algorithms in System Software 6.0 and later which can avoid problems some of the time.
Apple II Technical Notes cannot know themselves, since they are only told how much memory is needed, not where it has to be. Therefore, whenever the Memory Manager returns error $0201, all purgeable handles have been purged. This is particularly annoying to loaders. OMF supports a “bank-aligned” attribute for load segments, and the loaders ensure that such segments are loaded at the beginning of some bank or another.
Apple II Technical Notes ® Developer Technical Support Apple IIGS #79: Integer Math Data Types Revised by: Written by: Jim Luther Dan Strnad May 1990 March 1990 This Technical Note describes the format of Fixed and Frac data types used by the Integer Math tool set and operations performed on the Integer Math numerical data types. Revised since March 1990: Fixed original date, bit numbering of diagrams, and a multiplication sign in the equation.
Apple II Technical Notes 31 30 29 -32768 16384 8192 18 17 16 4 2 1 2 1 16384 1 1 32768 0 1 65536 ... high-order word 15 1 2 14 1 4 13 1 8 ... low-order word Figure 1–Fixed Data Type The format for the Frac data type is stated in the manual as being a 32-bit signed value with 30 bits of fraction. This means that the low-order 30 bits of the Frac format data value are considered as a fraction of 2^30, which is the binary number represented by a one followed by 30 zeroes ($40000000).
Developer Technical Support May 1990 Similarly, two Fixed or two Frac values may be compared, as Longints are compared, with one another. In general, the comparison, addition, and subtraction operations used for long integers may also be performed on any two Fixed or any two Frac values.