The Atari Tutorial Pa.Rt 4: Display-List Interrupts
Total Page:16
File Type:pdf, Size:1020Kb
The Atari Tutorial Pa.rt 4: Display-List Interrupts Chris Crawford 1272 Borregas Ave Sunnyvale CA 94086 The display-list interrupt is one of while it is being drawn. Of course, business. The interrupt to do this the most powerful features built into the computer must make each change must be precisely timed to occur at the Atari personal computer system. each time the screen is drawn, which exactly the same point during the It is also one of the least accessible happens 60 times per second. Also screen-drawing process. This spe features of the system, ' requiring of (and this is the tricky part), it must cially timed interrupt is provided by the programmer a firm understanding change the parameter in question at the ANTIC integrated circuit within of assembly language as well as all of exactly the same moment each time the Atari 400/ 800; it is called a the other characteristics of the the screen is drawn. That is, the cycle display-list interrupt (DLI). machine. Used alone, display-list in of changing screen parameters must The timing and execution of any in terrupts provide no additional be synchronized to the screen terrupt process can be intricate; there capabilities; they must be used in con drawing cycle. One way to do this fore, r shall first describe the sequence junction with the other features of the might be to lock the 6502 micro- of events in a properly working system, such as player-missile display-list interrupt. The process graphics, character-set indirection, or begins when the ANTIC chip en color-register indirection. With With display-list counters a display-list instruction display-list interrupts, the full power interrupts, many key having its interrupt bit (bit 07) set. of these features can be realized. Atari registers can be ANTIC waits until the last scan line Display-list interrupts take advan of the mode line it is currently tage of the sequential nature of the changed during the displaying. ANTIC then refers to its raster-scan television display. The drawing of a single NMIEN (nonmaskable interrupt television draws the screen image in a screen-display frame. enable) register (hexadecimal location time sequence, from the top of the D40E) to see if display-list interrupts screen to the bottom. This drawing have been enabled. If the enable bit process takes about 13,000 micro processor into a tight timing loop (bit 07) is cleared (to a logic 0), AN seconds and looks instantaneous to with an execution frequency of exact TIC ignores the interrupt and con the human eye. But that is a long time ly 60 hertz. This would make it very tinues its regular tasks. If the enable in comparison to the time scale the difficult for the computer to do bit is set (to a logic 1), ANTIC "pulls computer works in. The computer anything other than the screen down" the NMI (nonmaskable inter has plenty of time to change the display computations. It would also rupt) line on the 6502, signal ing an parameters of the screen display be a tedious job. A much better way interrupt. ANTIC then goes back to is to interrupt the 6502 just before the its normal display activities. The 6502 This article appears in slightly different time has come to change the screen starts executing an interrupt-service form in De Re Atari, a book published by parameters. The 6502 responds to the routine pointed to by the NMI vector Atari Inc, and is reproduced with its ex in terrup t, changes the screen in the operating system. This routine press permission. parameters, and returns to its normal first determines the cause of the inter- 166 December 1981 © BYTE Publications Inc No business is too small fora Our new HORIZON computer lets you make beautiful music. HORIZON® is our multi-user system that business around the world.) supports up to five simultaneous users To find out how you can orchestrate your at a cost per user that is the best own kind of beautiful music, clip and in the industry. mail this coupon, or call TOLL FREE With it, you can use up to 800-447-4700. (Illinois 800-322-4400, five terminals performing Alaska/ Hawaii 800-447-0890.) word processing, accounting North Star Computers, Inc. activities and information man 14440 Catalina St., San Leandro, agement-in perfect harmony. CA 94577 USA (415) 357-8500 Two packaged systems are avail- TWX/ Telex (910) 366-7001 able - the TSS/ 5, a 5Mb version and the y~, Pdlike~-;;r;-i;;ro-;-~tio; ~ N;rth St;':'s- ------ i TSS/ 18, an 18Mb version. Solo HORIZONs ••• multi-user system performance. I can expand to duets, trios, quartets or NAME I quintets with North Star's TSS/ A Application System or : COMPANY : North Star's TSS/ C Multi-user CP/M ~ : ADDRESS I When you purchase the HORIZON multi-user I CITY : svstem , :you receive worldwide service, support and the I ZIP I J I STATE I .most widely used small business computer in the world. I I (There are some 30,000 HORIZONs conducting L =PHc:,0::.:N~E==--==-==c:==c::==c::=-=-=c:=-=-=-____ B1 ~ J T he No rth Slar logo and HORI ZON are trademarks or registered trademarks of No rt h Star Computers. Inc. FOLLOW THE STAR ¥... @J981. NOrlh Slar Computers. Inc. -- - . - ._---- - - - - - --- - --. --- - NorthSlOrT.. Circle 304 on inquiry card. Introducing the Sinclair ZX81 If you're ever going to buy If you already own a ZX80 a personal computer, now is the The BK Extended BASIC time to do it. chip used in the ZX81 is available The new Sinclair ZX81 is the as a plug-in replacement for your most powerful, yet easy-to-use ZXBO for only $39.95, plus shipping computer ever offered for anywhere and handling-complete with new key near the price: only $149.95" completely board overlay and the ZXB1 manual. assembled. So in just a few minutes, with no Don't let the price fool you. The special skills or tools required, you can ZX81 has just about everything you upgrade your ZXBO to have all the could ask for in a personal computer. powerful features of the ZXB1 . (You'll accurate to 8 decimal places A breakthrough have everything except continuous dis in personal computers • Unique one-touch entry of key words play, but you can still use the PAUSE like PRINT, RUN and LIST The ZX81 is a major advance over and SCROLL commands to get moving the original Sinclair ZX80-the world's • Automatic syntax error detection and graphics.) easy editing largest selling personal computer and With the BK BASIC chip, your the first for under $200. • Randomize function useful for both ZXBO will also be equipped to use the games and serious applications In fact, the ZX81's new 8K Extended ZX Printer and Sinclair software. BASIC offers features found only on com • Built-in interface for ZX Printer Warranty and Service Program"" puters costing two or three times as much. • 1K of memory expandable to 16K Just look at what you get: The ZX81 is also very convenient The Sinclair ZXB1 is covered by a 10-day money-back guarantee and a • Continuous display, including moving to use. It hooks up to any television set graphics to produce a clear 32-column by 24-line limited 90-day warranty that includes free • Multi-dimensional string and numerical display. And you can use a regular parts and labor through our national arrays cassette recorder to store and recall service-by-mail facilities. "'Plus shipping and handling. Price in cludes connectors programs by name. " Ooes not apply to ZX81 kits. for TV and cassette. AC adaptor, and FREE manual. NEW SOFTWARE:Sinclair has ZX PRINTER: The Sinclair ZX 16K MEMORY MODULE: ZX81 MANUAL: The ZXS1 published pre-recorded pro P(inter will work with your ZXS1 , Like any powerful, full fledged comes with a comprehensive grams on cassettes for your or ZXSO with SK BASIC. It will computer, the ZXS1 is expand 164-page programming guide ZXS1 , or ZXSO with SK BASIC. be available in the near future abl e. Sinclair's 16K memory and operating manual de We're constantly coming out and will cost less than $100. module plugs right onto the signed for both beginners and with new programs, so we'll back of your ZXS1 (or ZXSO, experienced computer users. send you our latest software with or without SK BASIC). A $10.95 value, it's yours free catalog with your computer. Cost is $99.95, plus shipping with the ZXS1. and handling. Introducing theZX81 kit If you really want to save money, and you enjoy building electronic kits, you can order the ZX81 in kit form for the incredible price of just $99.95~ It's the same, full-featured computer, only you put it together yourself. We 'll send complete, easy to-follow instructions on how you can assemble your ZX81 in just a few hou All you have to supply is the soldering How to order Sinclair Research is the world's larg est manufacturer of personal computers. The ZX81 represents the latest technology in microelectronics, and it picks up right where the ZX80 left off. Thousands are selling every week. We urge you to place your order for the new ZX81 today. The sooner you order, the sooner you· can start enjoying your own computer. To order, simply call our toll free number, and use your MasterCard or VISA. To order by mail, please use the . oupon. And send your check or money QTY.