XEROXInternal MemoToBCPL ProgrammersFromRichard SauvainCSIAWRC/ISLW128 - 8*222*5298SubjectXM Display Stream PackageDateFebruary 22, 1980Filed on: [ERIE]XMDStream.pressThis memo describes a BCPL-callable XM display stream package for the Alto. The packageallows you to keep display bitmaps in the upper memory banks of an XM Alto, thus makingmore space in bank zero available for programs, virtual memory buffers, and the like. It isdesigned to be as compatible as possible with the standard OS display stream package (seethe Alto Operating System Reference Manual, pp. 57-59). Notable differences are: adifferent stream creation call, use of a strike font instead of a .al font, and a few un-implemented features.Where to get it: BR files for the package and several utilities and accoutrements can befound in dump file form in [ERIE]XMDStream.dm. Load this file with FTP to get thepackage onto your disk. Documentation (this memo) is in[ERIE]XMDStream.press, while source files are collected in[ERIE]XMDStreamSources.dm.Differences from the OS display stream package: most of the procedure names are thesame as those in the OS version. Hence when you load the XMDS package, references tothe OS display package automatically get satisfied by XMDS routines - which work just likethe OS versions except:1. There is no CreateDisplayStream(). Instead, you call: sPtr = XCreateDisplayStream(dsPlace,BitmapPlace,wWidth,BitmapSize,FontPlace,Bank)dsPlace is the address of a 60 word block of memory supplied by the caller in bankzero, to hold the displaystream structure used by this package.BitMapPlace is the word address (must be even) of the first word of the memory area tobe used for the display bitmapwWidth is the display line width, in Alto screen units divided by 16 (wWidth of 38 is fullwidth).BitmapSize is the size in words of the first word of the memory area reserved for thedisplay bitmap.FontPlace is the word address (must be even) of the first word of the area into which astrike font has been read. This must be in the same bank as the display bitmap. Seethe description of XReadFile below for a way to read the font in.Bank is the memory bank in which the bitmap and font reside. Banks are numbered0,1,2 & 3. Not all XM Altos have banks 2 & 3 - hence bank 1 is the usual choice.XCreateDisplayStream returns as value a display stream pointer, which is used just like theresult of CreateDisplayStream. I.e. you can Gets or Puts to it, use Wss, set its margins, etc.2. SetLinePos will work to lines that have not been written on; the only reason that it canfail is if line number requested is greater than number of lines in the window."fpqi _r]sX-r7Bs7B^Br7B]7B[F V]sX-r7Bs TrF) OsO MW Ly O JH Iou&s% GY Fe C9 B NC9G AP @/! >3 =% 9 9!,9& 8tR 6 L 5j 2>us /4vs6@,usF@+W?@(u s0@'z@%"us**@#@!Eu sK@@hus8@%0@^A@us0@Q Uus?  ususus us v s. O F=ghKXM Display Stream Package23. InvertLine ignores the second argument (lpos); inverts entire window.4. CharWidth can't handle a font pointer as the first argument as can the OS version.Results are unpredictable if a font pointer is in fact given.5. EraseBits cannot invert (third argument a -1), will call Swat if you try.6. SetFont and Scroll are dummys which call Swat; you cannot change the font after thestream has been created.7. GetFont and GetHeight are not present in this package. If you reference them, you willget the OS display stream versions!Operating EnvironmentIn order to use this package, you must do some setup work that is not required when usingthe OS display stream package. I suggest you look at the beginning of XMDSDriver.bcpl forexamples while reading the following.1. The IFS microcode must be loaded (in order to get BitBlt microcode available). Thisrequires that you do a LoadRam(IfsRamImage) before calling any of the XMDS routines.2. It's a good idea to call CountBanks() to verify that the Alto you're running on has thebank you anticipate using , and to clean up parity in the XM banks. This procedure returnsthe number of banks available: 1 thru 4 (zero if not an XM alto).3. You have to manually allocate your upper memory bank, i.e. assign non-overlappingareas for a font, all your display bitmaps, and anything else you need to put there.4. A strike font must be read into the memory bank you are using for bitmap storage. Strikefonts may be found by sniffing around your local file server looking for files whose namesend in ".strike". A generally useful one, StSerif.strike, is included in XMDStream.dm. Autility to read such a file into an XM bank is available in XReadFile.br. CallXReadFile(filename,bank,wordaddress) to read in the strike font.5. The bank register for the display word task must be set to indicate the bank you're using.This register is at location 177751b. Set the 'normal' bank , not the alternate (see p. 9 of theAlto Hardware Manual for more details on this). Before finishing, set it back to zero.6. If you expect to use Swat to debug, it's a good idea to attach a Swat context proc thatwill switch the display word task bank register back to bank 0 when you enter Swat andback to whatever you're using when you exit. If you don't, the display looks mighty funnywhenever you Swat. Such a proc is available in XMDSUtilsA, and is called SwatProc. Youset @lvSwatContextProc to the name of your procedure.LoadingYour load command should include the modules XMDStream, and XMDSUtilsA (and if youuse CountBanks, XMUtils). All of these modules are included in XMDStream.dm. You willalso need IFSmc and LoadRam from the directory.Disclaimer:This is an augmentation of a package originally written by Peter Deutsch for DLisp. I'vebeen using it in one fairly complex application for some months with no problems, and amwilling to answer questions. I cannot guarantee that it's well checked out or thatmaintenance support will be available. fsG bv s; ^vs < ]m= ZAvs@ Wvsvs 6 U Rdvsvs3 P# M M\ J N I9! G}% DQU Bus* @tu s- >< =jA ;U 9T 75U 5 N 4+I 2LM4 1!u#s .W -D<% +W )gU '< &]-- $2us #Sus ' 3 2 u s7 6   @ 63% : ,& =Y%ELOGO TIMESROMAN  HELVETICA HELVETICA  HELVETICA HELVETICA  HELVETICA j/xmdstream.bravoSauvainUnknown