formerly Open-Apple

• March 1989 Vol. 5. 1'10. 2

ISSN 0885·40 I 7 newstand price: $2.50 A journal and exchange of Apple H discoveries photocopy charge per page: $0.15

people to help us run with the Apple 11 and see just how far it can Apple, Apple, Apple ... go. If you want to be a part of our unique and exciting team, send us your resume. You'll influence our next computers, and our next "Apple's official position is that we will not support develop· generation. ment of copy-protection schemes; according to an article pub· Iished in both Apple Direct (January 1989, page 19) and the new On January 27 Apple announced that it. string of 12 consec­ APDAlog (Winter 1989, page 25), which are Apple publications for utive quarters of surging profits has ended. Apple's profits for the developers. current quarter. which will end March 30, are expected to be about 40 per cent less than the same quarter last year. Apple blames the losses Simply put, copy protection is not a worthwhile endeavor. We on falling RAM chip prices. According to an article in the Wall Street can't help or support you in developing copy protection mecha­ Journal (January 30,1989, page BIOI, Apple still has millions of 1 nisms. Obviously there's no way to stop you from implementing megabyte chips in inventory for which it paid $38 apiece last summer. copy protection, but we won't help with schemes or problems that Street prices on RAM chips are below that now; in quantities as you get into when things break. large as Apple buys, the chips are thought to be available for about The article says that developers who insist on copy protecting their $23 apiece. Apple attempted to cover its costs on the expensive products will have to invest their own time and money in engineering chips by raising prices last September. however, that resulted in cus­ a scheme; in maintaining it when new Apple hardware is released; in tomers and dealers buying low·end machines and adding their own testing it on all machines and products, including third'party hard· chips. 'We thought we were ordering chips to be used in the next ware; and in interacting with angry customers about bad key disks, month or two, not the next year,' John Sculley, Apple's president, told hard disk installations, and backup disks. 'Anything that runs can be the Wall Street Journal. "We also thought that one·megabit chip sup· debugged and patched ... It may also be worth considering the bad plies would get even tighter wward the end of the year.' press currently given to all products with copy protection: the article Since Apple doesn't sell any Apple II products that use I meg says. chips, it would be fair to place the entire blame for the profit drop on The Apple II Technical 1'I0te suite has been completely updat· the Macintosh product line. ed and converted from MacWrite liIes to ProDOS text liIes. On January 19. Apple announced major changes in the way it Apple's Developer Technical Support team invested hundreds of man· provides support to third.party hardware and software develop­ and woman·hours in this project during 1988. The results of all that ers. The changes were driven by needs in the Macintosh marketplace, effort have recently been made available to the public. Since the but with some concern for Apple II developers as well. notes may be freely copied, though not resold, we have included Apple's heretofore no·cost Certified Developers Program will be them, in total. in the extra space on our monthly disk this month. replaced by two new fee·based programs: Apple Partners and Apple They're also available in the A2Pro library on GEnie and on other Associates. A third level of support will be provided to developers online services. world·wide by a reorganized APDA, which Apple bought back from This was quite a trick, since in their natural form the tech notes fill A.P.P.L.E. Co·op (now called TechAliiance) late last year, as mentioned up one-and·a-half 3,5 disks, We had to dehydrate them to get them to here in December (page 4,85), fit on the disk. This means we also had to include a program that can The Apple Partners program is intended specifically for u.s. devel· rehydrate them back to normal size once you have them at your house. Complete details about how to do this are on the disk. On the next page you'll find a chart that lists each tech note currently avail· able by number and name and that tells whether a note is new or revised (and, if revised, whether the changes were major). Those of you who are doing full-text searches of our back issues can now do the same with Apple'S tech notes. too. Apple is mntinuing to look for knowledgeable Apple D peo­ ple to work in Cupertino. This enlightened policy beats the pants off Apple's old way of hiring minicomputer people to guide the per· sonal computer revolution. Apple is looking for programmers, devel­ oper technical support engineers, and several kinds of marketing managers for its Apple II areas. Write Apple's Human Resources department at mail stop 27 AS, 10500 N De Anza Blvd, Cupertino, CA 95014. According to an ad Apple recently placed in Call ·A.P.P.L.E.: Personal computing began with the Apple 11. Thousands of appli· cations and millions of computers later, it is the clear choice in homes and schools. The Apple 11 family of computers has had an incredible effect on our past and wilJ have an 'even greater impact on our future. We're committed. to the continued success of the Apple /I family, and that presents a rare opportunity for your future. We need more '\00 CAN NOT EE fY,W~mJ J1{fIL KGB ~S A!l'g{)Jl£' 6UlTCffi.' S.10 A2·Central Vol. 5, No.2 opers who publish and sell their products in the open market. Apple The Apple Associates program is intended for those who influence Partners must qualify for the program by substantiating that they have or support the development of Apple products, but who don't bring products for sale and they must pay an annual fee of $600. their own products to market. This would include computer profe5-

Released Apple II Technical Notes November H88 t** New *R* Revised no major changes ..

Apple IIe ~le II Miscellaneous ,., Mouse Differences On lIe and lIe ,., .SO-Colwan Screen Dump 'R' 40-Colllilll and Double High-Resolution Graphics 'R' Apple II F·amily Identification Routines 2.1 'R' Foreiqn Language Keyboard Layouts 'R' Super Serial Card Firmware Buq 'R' Dvorak Keyboard Layout 'R' Appleworks Keys Memory Ezpansion on the Apple IIe 'R' AppleWorks File Formats 'R'"" Buffering Blues 'R' nlM Port Description 'R' E:l:isting Versions 'R' 7 Apple II Family Identification Apple lIe 'R' a Pascal 1.1 Firmware Protocol ID Bytes 'R' OVerview of the Apple lIe 'R' 9 AppleSoft Real Variable Storage Bardware Protocol for Doing DM1I. 'R' 10 80-Column GetChar Routine 'R' 11 2xamining the $C800 Space frOm AppleSoft 'R' Double Hiqh-~solution Graphics 'R' 'R' RDYline 'R' 12 Apple II Firmware WT Routine 'R' lINE line AppleTalk The Apple II' Paddle Circuits .. , Identifying AppleTalk ""'R' Interfaces--Serial, Parallel, and mE-488 .. , ProDOS 8 Coqlat.i:cility on the lIe and IIGS 'R' lnown Anomalies of Enhanced lIe ROMs GS/OS Switch Input Change. h* 1 Contents of the System and system Tools Disks Apple"" IIGS *** 2 GS/OS and the 80-Colum. Firmware 'R' Row to Install Custom BRK and INMI Handlers t** 3 Pointers on Csching Transforming I/O Subroutines for Use in .~Native" Mode Mouse ""'R' Window Information Bar Ose Interrupt Environment with the Mouse Changing Graphics Modes in Mid-Application 'R' 'R' 'R' Varying VBL Interrupt Bate 'R' Window and Menu Titles 'R' Mode Byte of the SetMouse Routine 'R' Pen Pattern Data Structure 'R' Mouse Firmware Bug Affecting ServeHouse 'R' Halt Mechanism in IIGS SANE 'R' Check on Mouse Firmware Card Elems Functions in IIGS SANE MouseTert Characters IIGS Sound Expansion Connector: Analoq I/O Impedances * 'R' "" 9 Mouse "Claqling *R* 10 InvalJUpl Twist 'R' *R* 11 Ensoniq DOC Swap-Mode Anomaly Pascal *R* 12 Tool Set Interdependencies *R* 4 Pascal Declarations &- Directory Structure *R* 13 RCII 1. a Modem Firmware Bug *R* 10 Configuration and Ose of Pascal Run--Time Systems *R* 14 Standard File calls and GrafPort Records ·*Rt 12 Disk Formatter Routine *R* 15 InstallFont and Biq Fonts *R* 14 Apple PascalI. 3 TREESEARCH and IDSEARCH *R* 16 Hotes on Backgronnd Printing *R* 15 Apple II Pascal SHORTGRAPHICS Module Driver to Have Two Volumes on One 3.5" Disk *R* 17 Application Memory Management &- the NMStartUp Oser 10 * *R* 16 *R* 18 Do-It-Yourself SCC Interrupts ProDOS 8 *R* 19 Multichannel Output with Apple IIGS Hote Synthesizer *R* 1 The GETLN Buffer and a ProDOS Clock Card *R* 20 Catalog of APW Language Numbers *R* 2 Porting DOS 3.3 Programs to ProDOS and BASIC.SYSTEM *R* 21 DMA Corapati:cility for Expansion RAM *R* 3 Device Search, Identification, and Driver Conventions *R* 22 Proper Unloading of Dynamic SegJWlts 'R' I/O Redirection in DOS and ProDOS *R* 23 Toolhoz Ose of DOC BAH 'R' ProDOS Block Device Formatting *R* 24 Apple IIGS Toolboz Reference Updates 'R' Attaching- External Ccmnands to BASIC.SYSTEM *R* 25 Apple IIGS Firmware Reference Opdates 'R' Starting and Quitting Interpreter CODventions *R* 26 ROM 2. a Revision SUDIIDary *R* 8 Dealing with IRAM *R* 27 Graphics Image File Formats *R* 9 Buffer Management Using BASIC. SYSTEM *R* 2B Interfac@ Card Design Guidelines *R* 10 Installing Clock Driver Routines *R* 29 Monochrome High-Resolution Mode *R* 11 The ProDOS 8 HACHID Byte *R* 30 Apple IIGS Hardware Reference Updates *R* 12 Interrupt Handling *R* 31 Redirecting Output in APW C *R* 13 Double Righ-ReS

disk. Bad news. Lyons also points out that the the lUXUry. Small companies can't support one inactivate box works by setting bit 15 of a file's or more programmers while they learn the IIgs aux type and that inactivation is a feature inside and out. based on filetype, not on the folder containing There is a place for simple and there is a Ask the file. Lyons determined (by trying all the place for sophisticated. The Apple H can satisfy possible combinations) that the following file both needs. Unfortunately. Apple is trying to kill (ortell) types'show up with inactivate boxes in finder the former and force feed Apple users with the 1.2: $86 (Permanent lnit file), $87 (Temporary latter. lnit file), $88 (NDA), $B9 (CDA), $BB (Driver), Hannelore S. Maddox Uncle $Be (Oeneric Load file), and $BD (05/05 fST). Sunnyvale, Calif. Back to basics Apple is the only company in the world with DOS two families of successful personal computers. The Apple II is heading in a direction that dis· One family, the Macintosh, became successful turbs me ,greatly. That is toward increasingly because it was easy on users. The other family, complex technology, toward more and" more the Apple It became successful because if was complicated operating systems, toward a learn­ easy on programmers. ing curve that is beginning to look like a graph I don't think Apple has ever understood the Let's begin with a few corrections to last of the national debt. differen-ce, however. Instead of continuing' to month's issue. Gentlepeople, start your pen­ The doctor who wired the Apple ,II to a para­ hui/c: easy programming into the Apple II fami­ cils. plegic's legs so that she could walk couldn't do ly, the plan at Apple for five long yealS has On all inside pages the issue date and num­ it with 05/05. While I believe Apple is on the been to squeeze the user interface of the Mac­ bers are wrong. They should say, obviously; right track in developing more powerful operat­ intosh into the Apple ll. Programmers who Vol 5, No I .. february 1989. At least I got the ing systems, the learning curve has become so insist on using that interface lose all ease and front page right. steep that it takes someone wholly dedicated to saddle themselves with more overhead than a -In the item about Dealer 5ervice Notices, the system to do anything useful with it. computer the price of an Apple II can absorb. page 5.6-5.7, J said the latest version of the The historical importance of the Apple II is Interestingly, Apple itself is nearing the Apple SCSI card ROM is ca/Jed 'part .34 I ·04.37, that it made it easier for an expert in a field to same conclusion. Jean-Louis Gassee, head of Rev A". That would be better expressed as "part learn enough programming to solve, his own everything important at Apple, wrote an article 341·0437·A. popularly known as Revision C'. specialized problem than for a programmer to for the february 6 edition of Apple's Apple In the item called 05/05 tips, page 5,7, the learn enough of the specialty to write the same Viewpoint. ca/Jed 'Algorithms Always Break advice is bad. Subscriber David Lyons reminds program. On the IJgs this is no longer true. It Down." us that while you can deactivate the UniDisk has become too sophisticated and too compli­ "The implementation of any algorithm always 3.5 driver by selecting the "inactivate" box, cated. breaks down when driven beyond its range," Apple recommends against it. Without that Furthermore, hiring a programmer to learn Gassee writes. '50mewhere there is a counter driver active, UniDisk 3.5 disks can be dam­ enough about either today's 'operating systems with a finite number of bits that the algorithm aged _if you switch them while blocks are or about the specialist's problem to do a credi­ cached. Blocks will be read from the cache, ble job of either is a very expensive proposi­ modified, and written back to the switched tion. Most research installations cannot afford l'Iarch 1989 A2·Central 5.13 will underflow or overflow ... _Once you imple­ T1J11x> PaKal had been written under ProDOS works best if you leave the disk you boo! from ment the algorithm in a machine with finite instead of MS-DOS. Instead we've had a string "online', which means "in the drive ' jf you don't resources, it is easy to design an experiment of language products that have generally come have a hard disk or RAMdisk to boot from, that will create demands that exceed the ability up short in some critical area. Apple Pascal We've traced some problems to system of the resources .... ln real life, algorithms 1.3 doesn't run under ProDOS. Kyan Pascal disks thaI are missing critical files. We suggest always have a limited range .... C,xtending the and PROMAL lack dynamic string handling. using lIJstaller to create new system disks. If range makes the implementation fatter, slower, lnstant Pascal and Logo weren't designed to you have a SCSI hard drive, a UnlDlsk J ,5, or and ultimately more fragile. · be used as development tools. Manx C screen 5.25 drives connected to your system, you Now, we could meditate a little bit in output looks like the computer is running in must take the extra step of telling ImtaJler t 0 front of the claims made that a single hard­ sldw-motion. Fortb makes you relearn algebra. pul those drivers on your system dIsk. The sys­ ware architecture and/or a single operating Applesoft and the Beagle . Mlcol tem disk concept and Installation (or 'creation') system program will address all of mankind's Basic. and ZBasic (see 'Basic cho;ces,' procedures were thoroughly covered here in woes-from user-centric personal computer December 1987, page J.88) are all still avai/­ -Breaking the incompatibility banier: An intro­ uses to technically oriented workstations, able, ZBa8ic has laid off its Apple /I program­ duction to Apple's GS/OS' in November 1988, process-control, or transaction processing mer, however (he now works for Apple), pages 4. 75-4.78, so refer to that article. for applications. Th e classic Apple ' II community critically more infonnation, But somewhere there are breakdowns in needs a good, ProDOS-based Pascal, Apple has GS/OS uses more memory than ProDOS 16 the algorithm, or the quality, or the perfor­ taken the initiative of hiring Gary Little, the for­ did. You may simply need to add more memo­ mance, or the cost, or all of the above, as mer editor of A + and prolific author of Apple /I­ ry to your machine. the algorithm becomes longer. slower, and related books, to persuade language develop­ If the addiUona/ memory requirements of more delicate while it grows to extend its ers to write for the Apple II. If he succeeds, OS/ OS make your application creep Into range. we'Jj have an answer to your question. If he marginal memory chips you had installed previ­ This is my point: Sometimes, just some­ doesn't, your only choice will be to buyanoth­ ously but never actually used before, your times, beauty--and ultimately cost-effective­ er kind of compuler for your classroom. Apple computer may cras h under 05/05 but not Pro ness-can come- from restraint. hopes it will be a IIgs, DOS 16, All bad chip problems we've encoun· tered are related to chips that aren't CAS Could it be that Oassee is talking about the A straighter straightener l)efore RAS. We've been covering this problem event..cfriven desktop-interface algorithm as Your suggestion to the teachers who need to for months--see May 1987, second paragraph implemented on the Apple II? GS/ OS is not the recover from vandalized control panels only on page 3,30: August 1988, 'Apple has also problem. The idea of a built·in programmers works if the default values are acceptable. I've discovered .. ,', page 4.49: and February 1989, toolbox is not the problem. The problem is written a very simple 516 program that saves -Apple's December Dealer Service Note .. : , putting a graphics-based, event-driven interface 'snapshots' of the Control Panel's settings to page 5.6. Diagnostic programs that test for at the heart of a computer that has to be disk and that can restore those settings when C4.S-before-RAS haven't been widely available cheap enough for homes and schools. Neither needed. 'In fact, the various users in a lab could unW recently, which is why these bad · RAM the perfonn~nce nor the programming ease of each have a control panel file of their own Or chips are so widespread, Even the new diag­ the interface match our expectations. speCial files for specific uses. Readers may con­ nostic program that Apple dealers were recent· The problem isn't as so many people say, tact me for more information if interested. (On Iy issu~d only tests the' first megabyte of memo that application software isn't good enough; GEnie I'm L.WALTON,) ory on a card. the problem is that programming the machine Lorne Walton Some desk accessories aren 't GS/ OS­ I've found a problem with AppleWorkS 2.t I'm UP, my program that moves DOS 3.3 10 Ihe bon will be shifted up and down to spread out hoping you can help solve. When a program 'language card', To do it. you have to figure out tile wear. E.G. Wood's printer probably has tIlis such as Quicken creales a spreadsheet and you a way (or Applesoft's machjne language instruc­ feature disabled. Ne can fi x it by selting swilch look al it with 2.1. there's no way to recalculate lions and D05 J .J's to share the same address B-2 to ·open' or by sending the following control il. Since AppleWorks thi nks nothing ' has range (Applesoft in ROH, DOS 3.3 in RAH). You code 10 the printer 'ESC Z CTRL-@CTRL-B '. changed , open-apple.J\(a1culate) does nothing, end up wilh a little piece of code in the memo­ I have had my LQ, which I use with a lie, for even though most calculated data is incorrect. ry area at $BfOO·Bfff Ihat nips between the over a year but j uSi recently discovered the Let· USing AppleWorks 2.0 to recalculate gives Ihe two, depending on who's turn is next. Since ter Qual ity aspect of it. I had been setting the correct resuits, Is there a way to force 2.1 to DOS wants to look at every character you enter controls to Letter Quality and printing; however recalcul ate everything? on the heyboard, the code gets a lot of use and th is Is actually Near Letter Quality. To get true Lawrence J. Merow Ihe conlents of the address range sometimes Letter Quality you also have to print in propor· Sayville, N.Y, flutter like a hummingbird's wing. tional mode, which is easy by means of the "PI ' Hummm ... interesling oversight. It appears The truth Is that I couldn 't have done it with· and 'P2' commands In AppleWorks. The quality that AppleWorl I ) THEN GOTO 100. 1 can't imagine why you'd want to encourage It demands a semkolon b etwe~n items in print But something such as this is equally invalid: the distribution of such an inferior package by offering it for sale at a reduced price. Perhaps statements (optional In Applesoft). One can't Value = 5 t (:OY) .effectively alter th e counter variable in you have family in Canada (grin)? FOR/NEXT loops. which is a pretty stan.dard way ' This sort of Boolean structure, it seems to Elliot Urson to prematu.rely exit such loops . It insists each me. is one of Applesoft·s greatest strengths and Yonkers. N. Y. program have a header line, the operational worth its weight in WHILE/WENDS , I'll have a hard time giving up this one. It looks like only I think some of your criticisms of Micol necessity of which escapes me. Advanced Bask are vaJid. Areas in which J Now J'II grant you. for almost every limitation the most uncomplicated and elementruy Apple­ soft programs will port into Mlcol Advanced also have trouble with the package are where it the program contains there is an alternate way doesn't match Apple II standards-such as the to accomplish the task at ,hand. MicoJ Basic without Some exte nsive reworking. There are many other odd programming deci· backward operation of the Delete key (which Advanced Basic, as the documentation says, is you didn't mention) and the linefeed problem. I hardly a complied version of Applesoft. and I think the package would be much Improved if really don't expect it to follow each of Applesoft· A2·Central Developer COnference we could get Steve Brunier, the program's 's id iosyncrasi es; yet the word 'advanced' See the inside pages of Ihis month's cata· author. to sit down with AppleWorks, ProSEL, makes me think that Ih e package should oFFer log for complete details. In summary. you can and Apple's /taman Interface Guidelines fa r more possibilities. not just different possibili· spend July 21 and 22 in Kansas City lis1ening to a week and con vince him to make Hieol's inter­ ties, and certainly not fewer. faces match those. This is also a valid criticism I really don't want to get into the structured Bill Mensch and other Apple II expens, talking to Apple . leaming how to program TimeOut of many other programs, including Fastdata vs unstructured programming debate, but Dne Pro, which we carry even though user inter· applications, making contacts for your future. its of the reasons Basic is such ;i friendly language face needs lot of worl<. If programs of equiva· having a good time for just (early reg· a is that you can have as much structure in your and $300 lent quality that conformed to the standard programming as you want without having it is1ration). If you've 1051 your catalog. catl or write Apple 1/ interface existed. we would cany forced down your throat. If I'd needed or wan t­ and we'lI send you anolher one. them. but. unfortunately. there aren't any. ed that sort of imposed rigidity. I'd have taken I also find the manuaJ's aNitude that ~Ucol up Pascal long ago. sions (bugs? limitations?) in this package. The ,,'as written to save us from AppJeson trou· Micol's biggest shortcoming, as far as my own printer output routine, for example. gives you bling. Like you. I like Applesofl (especially with programming style is concerned, is its Boolean two configuration options; each carriage return the Ileagle Compiler). But the Appiesofti lleagle variable type. which apparently precludes issued either has no IInefeed appended. or is combination has a few weak spots. In myopin­ reducing a Boolean expression to a Si mple bina­ surround ed. by them Fore and a~ . This gives my ion, those are line numbers (rather than ry I or 0 (one of Appleso~ ' s handiest Features). hnage Writer II. configured as Apple suggests. named subroutines), two-c.haracter variable A statement such as the option of a single line continuously overwrit­ names, lack of good support for add-on assem· O!I 1X(1) GOIO 100 ten or dou ble-spaced text. Granted. I could bly-Ianguage enhancements. and lack of sup· change the DIP switch setting or the control port for the advanced memory. graphic. and panel to compensate, but it seems unreason· sound features of the Apple 1Ig>. ~Iicol has able to have the make the printer incompatible non e of those weak spots and is otherwise with the rest of my entire set up just to get a remarkably similar to Applesofl. printed listing, How come this isn't a problem in Micol is weaker than Appleson in handling any of my other programs? Boolean and string array variables, as you men­ © Copyright 1989 by Micol Advanced Ilaslc apparently has major tion. This is a valid criticism. My understanding limitations in dealing with strings, You cannc;>t is that Brunier wrote ~licol this way for speed. A2·Central do anything with an elert)ent of a string array (What speed, you say? ~Iicors speed suffers MosI rVO re$efVed. AI ~ ~ 111 .42.f;t,,&roll ate ~IC (other than printing It) without first copyi ng it to mostly because It uses the 1Ig> SANE toolbox tt:maJl ard IlB'f bI! ~ an:! cisubted ~ dwlrge. Apple lISeI' ~ a normal string varjable and th en copying it y fis- rently aval/able for non·professional program· The Mlcol program file Is over twice as long mers. It's not perfect. but Steve 8runier is a """"'WARRANTY. AHO LJlTATION OF UABIUTY.I warrat'il1h.a!. most of Ill!! as the text file that holds·th e program. which is reasonable person who has limited his devel­ inkJl1TI