P·R·Q·D·U·C·T P·R·E·tag">V·I·E·W

...J W <: I U ~ 10 o w I Cl. <: '"<.) § I Cl. BY GREGG WILLIAMS, JON EDWARDS, AND PHILLIP ROBINSON

BY T E 83 THE IN BRIEF

Name Amiga

Manufacturer not coinC identally, people want Apple 1200 Wilson Dr. to increase the Mac's speed, add West Chester, PA 19380 color. and lower its price. (215) 431-9100 Commodore has just introduced a Price computer that promises these im­ $1295 provements, and it does so by doing many things in hardware At S1295 . Microprocessor 68000, a 32-/16-bit microprocessor (32-bit internal data path and the Amiga Personal Computer (see registers, 16-bit external data bus) running at 7.15909 MHz photo I) promises lightning-fast desktop-metaphor graphics in color Main Memory and twice as much memory and disk 256K dynamic RAM , user-expandable to 512K bytes; machine's design allows for maximum of 8.5 megabytes storage as the for several hundred dollars less than the Macin­ ROM tosh (about S900, but you'll have to 192K bytes of ROM containing multitasking, graphics, sound, buy a monitor or television set for the and animation support routines Amiga). It also has an expansion bus Graphics and a whopping 192 K bytes of so­ Five modes (320 by 200 pixels, 32 colors; 320 by 400, 32 colors; 640 phisticated 68000 code in ROM (read­ by 200, 16 colors; 640 by 400, 16 colors; sample-and-hold mode); only memory) that extends the multi­ independent horizontal and vertical scrolling of dual playfields; eight hardware sprites; colors chosen from a palette of 4096 colors tasking, graphics, sound, and anima­ tion capabilities of the Amiga Sound hardware. Four independent audio channels; sound produced without supervision of 68000 SYSTEM DESCRIPTION The Amiga is summarized in the In Built-in 3V2-inch double-sided disk drive. Disks hold 880K bytes Brief section on this page. It has no in 160 tracks, each with eleven 512 - sectors; drive hardware can read slots for expansion cards, but Com­ an entire track at a time modore later intends to offer a box Keyboard that connects to the expansion con­ Detached 89-key keyboard with calculator pad, function and cursor keys; nector to add several expansion slots. keyboard returns row/column keycodes for each key, sends both key-up and (It is theoretically possible to add key-down signals; can sense up to two keys simultaneously; 8 8-key type-ahead buHer megabytes of memory in this way.) The Amiga's disk Expansion Ports will also be able to look at the expan­ Disk port onto which three additional disk drives can connect via daisy chain; sion box, determine what peripherals serial port with maximum transfer rate of 500,000 bps; programmable parallel port normally configured as Centronics-compatible; are present. and configure itself ac­ expansion bus includes full set of signals for optional peripherals and cordingly. regardless of the box 's memory expansion contents. () Supports multitasking through the use of virtual terminals; allows simultaneous SYSTEM ARCHITECTURE display of diHerent resolutions and graphics modes The Amiga has a unique architecture that is only partially described by a Bundled functional block diagram (see figure AmigaDOS Voice Synthesis Library I) Three custom chips relieve the ABasiC 68000 processor of many tasks that Tutorial (Mindscape) tie it down in other computers. How­ Kaleidoscope (Electronic Arts) ever, the diagram does not show the Audio and Video Ports finely tuned sharing of the system's Two stereo audio jacks; RGB analog, RGB digital, and NTSC composite data and address buses, the 25 DMA output Miscellaneous Gregg Williams is a senior technical editor at Three custom chips to control graphics, audio, and peripheral I/O; chips BYTE, and Jon Edwards is a technical editor. connected by 19-bit register-address bus; two-button mechanical mouse They can be reached at BYTE, POB 372. Han cock. NH 03449. Phillip Robinson is Optional Peripherals 3'l2-inch 880K-byte disk drive; RGB analog color monitor; 256K-byte memory a West Coast sen ior technica l editor at BYTE. expansion module; 300/1200-bps modem; MIDI interface; frame grabber He can be reached at BYTE M~gazine . 425 Battery St .. San Francisco. CA 94111.

84 B Y T E • AUGUST 1985 THE AMIGA

(direct memory access) channels that • The graphics custom chip. which data buses with 25 channels of DMA. do many data-movement-intensive manipulates the visible display. per­ the registers and logic of which reside operations without tying up the mits up to two independent bit­ in the custom chips. Amiga's DMA is 68000. or the multiprocessing mapped images and eight sprites fast for two reasons: first. the fact that routines in ROM that allow the Amiga (which are images that can be moved each device has its own DMA chan­ to orchestrate a variety of tasks. In the easily around the screen. "under" or nel decreases the overhead asso­ following sections we will look at the "on top of" the bit-mapped images). ciated with a DMA operation; second. key elements of the Amiga's system • The peripherals/sound custom chip many DMA operations are interleaved architecture. contains four channels of sound. the with 68000 bus access in a way that disk controller. an controller. makes the DMA transparent to the and the interfaces for the serial port THE CUSTOM CHIPS 68000 (see below for details). and the mouse/joystick port. When DMA occurs between mem­ The three custom chips that control ory- and custom-chip registers. the DMA. graphics. sound. and I/O (input/ AND DMA use of the 19-bit register-address bu s output) (see photo 2) were designed In the Amiga. all the peripherals are (see figure I) makes the transfer twice by . who is best known for interrupt-driven-that is. the 68000 is as fast. By putting the memory ad­ his design of the custom chips in the not tied up constantly polling them to dress on the address bus and the 800 series computers. Although see if they have new data; instead. the register address on the register­ we will discuss them in depth by func­ 68000 gets data from the peripheral address bus. the DMA circuitry causes tion. here is a simple breakdown: only when the peripheral sends an in­ the data value to move directly from • The "animation custom chip" actual­ terrupt signal. The peripherals/sound the memory address to the register. ly contains several miscellaneous chip receives interrupt-request signals This occurs twice as fast as DMA functions. It is the "traffic cop" that from one of 15 sources (e.g .. the disk would via the 68000. which would controls DMA. It contains the Copper. drive or a sound channel). translates first read the data into itself and then a coprocessor that can directly con­ the request to one of six interrupt write the result to the register. trol the other chips in relation to the levels supported by the 68000 (the video beam. and the Blitter. a device seventh is reserved for future use). LIBRARIES AND DEVICES that quickly draws lines. fills areas with and sends the interrupt signal to the System software (much of it in the a given color. and manipulates rec­ 68000. 192 K bytes of ROM) contains libraries. tangular blocks of pixels. The 68000 shares the address and (continued )

--TV----RG8-COMPOSITE--- VIDEO

GAME 1/0 1/0 AUDIO

PRINTER PORT

CHIP MEMORY 256K BYTES STANDARO 256K BYTES ADD-ON

Figure I: A block diagram of the Amiga Personal Computer.

AUGUST 1985 • BY T E 85 Composite Audio out video out Connector to RF modulator RGB Serial External Parallel Keyboard video out n interface disk interface interface connector

processor

256K Locations dynamic RAM Display for ROMs Animation bu s arbitration, 8520s custom chip RAM support, and bus drivers Graphics custom chip Photo 2: Tlie Amiga motlierboa rd. Tlie internal disk drive. wliicli lias been removed. would normall y obscure tlie lower riglit corner of tlie motlierboard Tlie power supply (not sliown) is to tlie left of tlie motlierboard.

86 BY T E • AUGUST 1985 THE AMIGA

a predefined way of organizing useful DMA (enough to show a 16-color low­ routines so that they can be accessed The Exec routines re solution image). The DMA ci rcuits with maximum flexibility. Libraries perform many on each ch ip "know" when th eir slots can be resident or transient and can occur on each hori zo ntal line and be used at any memory address functions vital automaticall y initiate the DMA trans­ (when they're in RAM [random-access fer without involving the 68000. readlwrite memoryf). Both routines to the operation In many cases, the Copper and the and data can always be ca lled via a Blitter aren't active, leav ing the 68000 68000 indirect reference with offset; of the Amiga. running at fu ll speed (Actually. some this all ows you to write code using a in structions need the bus at odd library routine without knowing that tasks will execute. Tasks with identical times: if the bus isn't avai lable. th e library's address at compile time. (In numbers share the Amiga in time 68000 will in sert wa it states until the fact. all the code in the system can be sli ces of preselected duration. A tas k bus-arbitration PAL [programmed­ refe renced knowing only one fixed wi th higher priority preempts the cur­ array logic chip[ signals th at th e bus address in the machine, and even that rent task and begins executing. is free by asserting th e 68000's DTACK address is suppli ed to any machine Because th e system saves a task's line. This happens more frequently as that needs it) A device is an extension states, reg isters. and sta ck area , a ta sk the custom ch ips demand more of the of the library concept that allows soft­ ca n resume at any time. More impor­ bus's cycles) ware to access i/O devices (both pres­ tant. programmers do not have to Several things modify this bus shar­ ent and future) in a uniform way. make allowances for other tasks that ing. If . you use more than fou r bit may be running concurrentl y- whi le a planes of low-resolution display, or THE EXEC ROUTINES task is active, it "thinks" that it has full more than two high-resolution bit The Exec system is a collecti on of unrestricted access to the 68000. planes, the bit-plane DMA will ste al reentrant optimized 68000 ROM some memory cycles from th e 68000. routines that perform many functions SHARING THE SYSTEM Bus Both the Copper and the Blitter have vital to the operation of the Amiga. Co nsider th at the Amiga ca n simulta­ higher priority than the 68000 and It includes routines that create and neously read the disk, play four chan­ will get the cycles they need first If man ipulate li sts and queues, schedule nels of audio, and show 16-color low­ the Blitter senses a memory-bus re­ tasks by priority, handle interrupts, resoluti on bit-plane graphi cs and quest by th e 68000, it wi ll halt within orga nize device 1/0. control memory eigh t sprites wi th vi rtuall y no slow­ a few cyc les to let th e 68000 use th e use, and perform other functions. down of the 68000 processor Thi s is bus: then it will again take over th e An important data structure in the possible largely because of the way bus and continue. This gives th e Amiga is the li st node. The li st node is various subsystems share the bus. 68000 some cycles even when the a block of data with pointers to the The Amiga's 68000 runs at 7.15909 Blitter is running. If you set an inter­ predecessor and successor nodes in MHz , wh il e its memory run s at twice nal "Blitter priority" bit. however, th e the li st it's in, two 8-bit type and priori­ that speed Most of the in structions Blitter steals all the cyc les it needs ty fie lds, and an associated block of in the 68000 alternate between using from the 68000. Even this is not as data. A list is a doubly linked chain of the bus and doing internal ca lculation. bad as it sounds: whenever any of the list nodes and items, started by a In this situati on, th e memory can run above items steals cyc les, it still per­ header that points to the first and last at its top speed and still leave every forms its function faster and more ef­ nodes. Exec contains several routines other bus cycle free. ficiently than the 68000 could have that let you do things like create a new The bus sha ring takes place in sub­ li st. in se rt a li st item into its proper divisions of the time the electron gun MULTITASKING place in a queue, and remove a node takes to draw one line of pixels and The Amiga is multitasking- that is, it from a list do a horizontal retrace, approximately can work on more than one thing at Another important set of routines 63 microseconds (Il S). Thi s divides a time. At a low level. for example this allows you to manipulate tasks. A tas k into approximately 226 memorY­ means that the Amiga ca n move is a unit of work that shares the Amiga access cycles of 280 nanoseconds (ns) sprites, read from th e disk, and play with other tasks in a way that va ri es each. The Copper, Bl itter. an d 68000 music at th e sa me time. At higher wi th both the type and priority of the access memory on the even cyc les (0. levels, several programs ca n run si­ task. (All the current ta sks are held in 2.4 .... J: the odd cyc les (I. 3, 5, .. . ) multaneously in overlapping windows. a queue and are executed by decreas­ are reserved for four cycles of mem­ The Amiga's multitasking ability ing priority) Most programs and oper­ ory-refres h DMA. three cyc les of disk comes from several features we've ations reside in the Am iga as tasks. DMA. four cycles of audio DMA already discussed th e interrupt struc­ Th e task priority field, wh ich con­ (enough for four cha nn els), 16 cycles ture and th e Exec multitasking rou­ tains a number between -128 and of sprite DMA (enough for eight tines in ROM. Interrupts. wh ich are 127 , determines the order in which sprites). and 80 cyc les of bit-plane (continued)

AUGUST 1985 • BY T E 87 THE AMIGA

routed through and prioritized by the appropriate task has the chance to its instructions from memory and uses peripherals/sound chip. initiate task use the system. DMA to write from its program (in sw itching. For example. when a pe­ memory) to the registers in itself and ripheral signals its need to do I/O. the THE COPPER the other two custom chips. (Accord­ interrupt goes through the periph­ The Copper is a coprocessor inside ing to Jay Miner. this is not so strange erals/sound chip and causes the pe­ the animation chip that runs its own if you look at the three chips as "one ripheral's interrupt routine to execute program. The execution of this pro­ big custom chip:') (a ssuming that no interrupt of higher gram is tied to the progress of the The Copper's instruction set has priority is running) . The interrupt electron beam as it draws the video only three instruction types: move im­ routine either handles the peripheral's display. Because of this capability. the mediate data to a register. wait until need immediately or notifies a task to Copper is most often used to control the electron beam passes a given do so. then the routine ends. In both the graphics and sound parts of the position. and skip past the next in­ cases. the Amiga then calls the task custom chips. thus relieving the 68000 st ruction if the electron beam is past rescheduler. which ensures that the of the same task. The Copper reads a given location. The beam-position values are accurate to the exact line vertically and to 4 low-resolution ADDRESS pixels (or 8 high-resolution pixels) (HEXADECIMAL) horizontally. 000000 -256K OF CHIP RAM The Copper's versatility can be ex­ 040000 ~(RAM FOR STANDARD MACHINE) tended by clever use of its registers. 080000 256K OF CHIP RAM (OPTIONAL PLUG -IN MEMORY) For example. you can get the Copper 1.5 MEGABYTES- to jump to a given instruction by caus­ RESERVED ing the new address to be placed in the Copper's internal "program counter." By setting bit 15 of the IN­ 200000 TREO (interrupt request) register. th e 8 MEGABYTES RESERVED Copper can cause a level-6 interrupt. FOR FUTURE USE AS PROCESSOR RAM AND PER IPHERALS which should lead to a more complex (LOCATED IN EXPANSION BOX) 68000 routine that will service the situation that caused the interrupt. One important aspect of the Cop­ per is that. while it is waiting for the ------electron beam. it is off the system bus AOOOOO and does not tie up any resources. This is in contrast to many systems 1.988 MEGABYTES- that tie up their processors whi le RESERVED waiting for a given beam position. Because of the Copper. the 68000 is never tied up for several milliseconds BFDOOO _12K RESERVED AS ADDRESS SPACE COOOOO FOR TWO 8520 SERIAL 1/0 CHIPS waiting for a display-related event. ( ADDRESSED AT BFDOFF AND The Copper can handle many BFEOFE HEXADECIMAL) system functions without the interven­ 0.996 MEGABYTE- RESERVED tion of the 68000. For example. it can refresh certain bit-plane and sprite values that must be restored at the DFFOOO -- CUSTOM CH IPS ARE ADDRESSED beginning of each frame. It can also EOOOOO IN THIS 4K SPACE 512K-RESERVED cha nge the color pa lette in mid­ E80000 screen (giving you more than 32 512K CONTROL AREA FOR CONF IGURATION OF EXPANSION AREA colors on the screen) . change the FOOOOO graphics mode (saving memory). and 832K-RESERVED update the display memory without ....;-192K. OFSYSTEM ROM FOOOOO glitches by changing an image after the -FFFFFF IS FINAL ADORESS- electron beam has drawn it for the TOTAL WORKSPACE IS 16 MEGABYTES current frame. The Copper programs give the ma x­ Figure 2: The Amiga memory map. imum amount of control over the video display and events of that

88 BY T E • AUGUST 1985 THE AMIGA

periodicity, but most programmers FIVE BIT PLANES will not create them directly. Many of VIDEO DISPLAY the ROM routines that accomplish high-level tasks manipulate Copper programs to get their work done.

MEMORY SPACE BRIGHT PINK The first 512 K bytes of memory is PIXEL called the chip memory (see figure 2 for a memory map). Any function per­ formed by the custom chips-bit­ INDEX FOR plane and sprite images, Copper pro­ COLOR OF PIXEL grams, and other data (covered below)-must be in this memory area. Of course, in the standard 256K-byte 000 TRANSPARENT Amiga (or the expanded 512 K-byte 3D2 MEDIUM GREEN 7D6 LIGHT GREEN version). the chip memory is also D88 l BRIGHT PINK I--- used for everything else a computer needs RAM for. Commodore/Amiga may announce an expansion box at 1 E AAA LIGHT GRAY 1 F 333 DARK GRAY a later date that can accommodate INDEX VALUE MEANING various peripheral cards and up to 8 ( HEXADECIMAL) continuous megabytes of memory. COLOR REGISTER TABLE Normal programs and data should be placed there, leaving the display Figure 3: Amiga playfield graphics. The bits from a given position in each bit plane memory free for its specialized uses. combine to create an index into the color-register table. The selected entry in the color­ register table determines th e color of the pixel. GRAPHICS The Amiga's graphics are, in a word, breathtaking-in both their quality planes to get a maximum of 32 colors. sent either a color-register table va lue and their speed. The machine's major The color-register table contains for that pixel or a modification to one graphic components are the playfield, 12-bit va lues that can specify any of component of the previous pixel's the sprites, the Blitter. and the anima­ 4096 different colors. Therefore, the color. Using hold-and-modify, you can tion and text routines. Amiga can draw images that use any display all 4096 colors on an analog 32 of these 4096 colors. RGB (red-green-blue) color monitor. THE PLAYFIELD The Amiga has five bit-mapped res­ A playfield image can be much A bit map is an area of memory that olutions. Four of them come from two larger, both horizontally and vertical­ the computer interprets as a rec­ horizontal resolutions (320 pixels per ly, than the sc reen area used to dis­ tangular array of pixels (dots) ; most line, low resolution, and 640 pixels play it. By manipulating several computers have some bit-mapped per line, high resolution) times two register values, you can scroll an graphics capability. Many machines vertical resolutions (200 visible lines image horizontally, vertically, or both, form different colored pixels by per screen, noninterlaced frame, dis­ with very little effort. (When the total grouping two or more adjacent bits in played every 1/60 second, and 400 image is wider than its displayed part. the bit map. The Amiga, however, visible lines per screen, interlaced the last pixel on one line and the first uses only one bit per pixel in its bit frame, displayed in two passes every pixel on the next are not adjacent and map (this is called a bit plane) and 1/30 second). These can take any­ are separated by a fixed number of "sta cks" separate bit planes together where from a minimum of 4000 bytes bytes The Amiga makes use of modulo to get different colors (see figure 3). (for a 320- by 200-pixel image) to registers to make the manipulation of (The colors available are not "hard­ 32,000 bytes (for a 640- by 400-pixel two such bytes as fast and as simple wired" into the machine but are speci­ image). Photo 3 shows an example of as if they were contiguous.) fied in a color-register table, also known the 320 by 200 mode. Another display option is called the as a color palette.) An image created by The fifth mode, called hold-and-modify, dual-playfield mode. When you use this multiple bit planes is called a raster. uses six bit planes in a way that ca n mode, up to six bit planes are divided The playfield is the bit-mapped graph­ simultaneously display all 4096 colors into two separate images of up to ics display that comprises most of the on screen. In this mode, the top 2 bits three bit planes each, wi th one image Amiga's video display. of a pixel control the interpretation of having priority over the other. This The Amiga can stack up to five bit the bottom 4 bits, which may repre- (continu ed)

AUGUST 1985 • BY T E .9 THE AMIGA

often simplifies complex graphic dis­ cept for a transpa rent area that lets defining the horizontal and vertical plays. For example. to simulate the ef­ the lower playfield show through va lues for its upper left corn er; sprites fect of looking at a landscape through are independent of the play field and bin oculars. you can scroll a wide land­ SPRITES appear to be over or under each scape playfield "undernea th" a sta­ A sprite is a small bit-mapped image other and the playfield(sl according to tionary playfield that is all black ex- that ca n be repositioned simply by re- a specified priority The Amiga has eight hardware sprites. each of which can have three colOrs (sprites are two bit planes deep. and each 2-bit pixel translates to three colors plus transparency). Amiga sprites are 16 low-resolution pixels wide by any height Each pair of sprites shares a different three­ color color-register table (for example. sprites 0 and 1 share color registers 17 . 18. and 19 . sprites 2 and 3 share 21. 22. and 23). allowing the eight sp rites to use up to 12 co lors. Adja­ cent sprites (0 and 1. for example) can be attached. meaning that their four bit planes are combined; an attached sprite pair can then use color registers 17 through 31 to display up to 15 colors. As happens often in the Amiga. complexity underlies apparent simpli­ city A sprite is actually a 16-bit va lu e with a specified horizontal displace­ Photo 3: Robocity. an example of Amiga graphics in the 320- by 200-pixe/ ment for the current line of the video 32 -color mode. display In manual mode. you are responsible for creating th e sprite's image on a line-by-line basis (few peo­ ple wi ll use this mode directly) In automa tic mode. however. you activate the sprite's DM A circuitry. which looks to a data structure that contai ns the line-by-Iine position and shape of th e sprite and draws it automatically. In addition. you can redefine the sprite indefinitely while the electron beam crea tes the video display. The sprite DMA circuitry accepts a li st of sprite position and shape-definition words and draws them as long as the bot­ tom line of one occurrence and the top line of th e next are sepa rated by at least one video line (note that this is without intervention of the Copper).

THE BUTTER The Slitter is an area of the animation chip that controls a DMA channel de­ dicated to drawing lines and manipu­ lating rectangular areas of the play­ Photo 4: The Workbench display This is an example of the 640 by 200 mode. field. Its name comes from an earlier (continued)

90 BY T E • AUGUST 1985 THE AMIGA

term, bit-bit. which means "bit-mapped Comps will probably include BOBs for block transfer." Miner calls it a Bimmer, Trw basic a torso, a head, two arms, and two for "bit-mapped image manipulator:' legs. Each AnimComp includes because of its ex tended capabilities, element in the several views of the same object (e.g., but "Blitter" is used exclusively in the animation subroutine arm bent. arm straight) wi th an asso­ Amiga's documentation. ciated time that must elapse before When manipulating blocks of an is the GEL, progressing from one view to the image, the Blitter (when properly set next. Once all this is assembled, up) takes care of a number of "house­ a graphics repeated cal ls to the Animate routine keep in g" tasks that. in other com­ element. substitute new views (as determined puters, tie up a lot of the processor's by their timer constants) into the time. These include masking out the linked list of GELs before drawing the bits just outside the image that belong could you see the " jaggies" that items in the li st. to the same memory word as the proved you weren't lookin g at a hand­ You can do sequenced drawing animation desired bits; sh ifting the image severa l drawn cartoon. by specifying a series of views that bits horizontally to match the word Animation is accomplished through describe a repeated motion and by alignment of the destination; and fill­ a few subroutine calls that draw a specifying an offset to add to the ob­ ing an area bounded on the left and linked li st of things needing to be ject's position each time the routines right by two non horizontal si ngle-pi xel animated. The basic element in the cycle from the last view to the first. For lines (this is the basis of its area-fill animation subsystem is the GEL , or example, take the example of a cat capa bility) graphics element. There are four walking two steps to the right in six The Blitter distinguishes itself from types of GELs: VSprites, BOBs, An im­ views so that view I appears natural other bit-bit devices by its ability to Comps, and An imObjs. when it is shown after view 6. By combine up to three source areas in VSprite stands for "virtual sprite" A specifying the correct horizontal off­ one of 256 ways to become the des­ VSprite is a data structure in memory, se t to the right (which gets added tination area. (If we call the sources closely tied to a hardware sprite, that every time the image cycles back to A. B, and C and their inverses A, B, is managed by the animation routines. view 1), the Animate routine will auto­ and C, these combine in eight By letting th e routines manage the matically draw the six views in the cor­ ways: ABC. ABC, ABC. ... , ABC mapping of VSprites to hardware rect order and position to make the There are 256 possible combinations sprites, you can (wi th some limita­ ca t appear to walk across the entire of these eight terms) tions) define more than eight VSprites width of the screen. When being used to draw lines, the and let the routines keep track of the A lternatively, you can have the Blitter can draw lines as I s, Os, or a details automaticall y. VSprites ca n Animate routine do motion-control anima­ specified pattern; it can also draw also be clipped to display themse lves tion, in which the next position of a single-bit-wide lines, which are only within a ce rtain horizontal slice BOB is automatically calculated from needed to bound an area to be filled. of the display. its current position and four x- and y­ In both its line-drawing and area­ BOB stands for "Blitter object." A axis ve lOCit y and acceleration va lue s. manipu lating operations, the Blitter BOB is an image that acts like a sprite. (You can also do this with a "ring" of must have a moderate amount of but th e animation routines use the BOB views that cycle as in seq uenced "housekeeping" calculations done Blitter to "paste" the image onto the drawing animation.) fi rst. Given the speed and simpli city playfield and (optionally) restore the Another routine, DoCollision, detects of the resulting operation, the setup image that was "underneath" the two types of collisions, GEL-to-GEL calculations are not an unreasonable BOB. A BOB is defined by the com­ collisions and boundary collisions overhead; however, you can deal with bination of a BOB data structure and (collisions of GEls with rectangular the Blitter on a higher level using a VSprite data st ru cture, both of boundary windows); the routine then so me graphics routines in ROM . which point to each other. One advan­ executes a given collision-handling tage of a BOB over a VSprite is that routine from a table of 16 possible ANIMATION ROUTINES a BOB is drawn into a playfield-this routines. GELs can be coded so that The animation routines that are part means it can be of any width and it only certain types of colli sions of the Amiga's ROM form the basis for can have as many colors as the play­ register (useful in a game, for exam­ the most sophisticated color anima­ fi eld (up to 32) BOBs ca n also be ple, to detect missile-target collisions tion the personal computer market clipped to appear only in a certain but not missile-missile collisions) has ever seen. One of the demonstra­ rectangular . tions we saw, Robocity. showed five An AnimComp is an an im ation com­ TEXT cartoon characters roaming across the ponent. one part of an AnimObj, an The Amiga treats text as a special sc reen. The resolution was very an im ation object. If your AnimObj is kind of graphics. Fonts are described good- only when you looked closely a figu re of a man walking, its Anim- [contin ued)

92 BY T E • AUGUST 1985 THE AMIGA

by a Text Font (TF) data structure that its sound table are not interpreted as all ows the crea ti on of either mono­ Fonts rna!! be two 8-bit sound values. Instead. the spaced or proportional characters of modified by any data words are interpreted as volume any height. To save room with larger or period va lues for the current va lue fonts. a font may define anywhere be­ combination of in the channel being modulated (i.e .. tween I and 255 characters. TWo the volume value will determine th e fonts. Topaz 8 and Topaz 9. are in the several styles: current loudness of the channel. and Amiga ROM. The first gives 40 char­ the period value determines how acters per line in normal resolution . underline, italic, much time passes before the channel 80 in high resolution: the second boldface, and extended. sends ou t th e next va lue in its sound gives 30 and 60 characters per lin e. table). You ca n manipulate these respectively. Additional fonts may be va lues to cause either amplitude loaded into and removed from RAM in g chann els 0 and 3. the oth er. chan­ modulation. frequency modulation. or as needed. nels I and 2. The fi lter begins to at­ both. The Amiga uses the ROM routine tenuate frequencies between 5.5 kH z TxWrite to draw a give n message to and 7.5 kHz and effectively eliminates AUDIO SOFTWARE a given location. The text ca n be any higher frequencies. This elimi­ The ROM contains three kinds of rou­ drawn in one of two user-definable nates much aliasing. which is di stortion tines. The first. channel-allocation rou­ "pen" colors and in one of three draw­ that occurs when a signal that was tines. allow you to allocate. use. and ing modes: JAM\. an overstrike mode: sampled too in freq uently is played discard a channel without keeping JAM2. a mode that draws both the back. track of which channel it is. If you have character in one color and the "white The so und cha nn els can be con­ more th an four "virtual" channels space" behind it in another: and Com­ trolled directly by the 68000. which open. the four with the highest priori­ plement. which inverts every pixel gives you complete co ntrol over the ti es are mapped to actual hardware that corresponds to a pi xel of the sou nd but keeps the 68000 from do­ audio channels. character being drawn. ing other work. In most cases. you can Second. the DMA-control routines As in the Apple Macintosh. fonts get th e sound you need by letting the control the way the audio DMA chan­ may be modified by combi nin g any of DMA chann els produce the sound nel manipulates th e hardware audio several styles: underline. itali c. from a table of values (called a sound cha nnel via the vari ous registers and boldface. and extended. However. table) th at describe one or more cycles the sound table. In addition. yo u can unlike the Macintosh. the Amiga text­ o f the needed waveform . ca use the channel to send a user­ drawing routine looks for a separa te­ In th e Amiga. eac h aud io DMA specified signal bit to an existing task ly defined font that contains the chan nel includes registers that give (which may then trigger some event) needed style(s) If this fails. a future th e chan nel's loudness. point to a when th e sou nd channel has played revision of the text-drawing routin e 16-bit-wide table of sound-table bytes a given number of repetiti ons of the may try to modify the existing "nor­ (the values are fetched a wo rd at a sound table: thi s allows tasks to mal" vers ion of the font (this is the time and must be stored on even byte manipulate the Amiga based on the only way of ac hiev ing font styles in boundaries). and establi sh the time sound channel's activity. the Macintosh) that must elapse before the nex t Third. the envel ope-generator rou­ sound byte is sen t out. This last is a tines au tomate the task of varying the AUDIO HARDWARE period register. which contains a va lue amplitude envelope that determines The Amiga includes four hardware that is decremented every 279 ns: the how slow or fast a note changes chan nels of so und that are largely next va lu e from the sound table is volume when it is played To use these controlled by DMA circuitry. indepen­ sent out when the counter reac hes routines. you must create a table of dent of the 68000. Audio-controlling zero. and the register is reset to its four slope/destination values that routines in part of th e Amiga's ROM original va lu e. When th e pointer to describe an ADSR (attac k. decay. sus­ extend these capa bilities. allowin g the so und table reaches its la st value. tain. release) envelope. (The ADSR you to work with the Amiga's so und the pointer is reset to the start of the envelope tells you how fast the note capabilities at a higher conceptual table. In this way. the aud io chan nel gains volume as soon as it starts. what level and to manipulate the sound continues to produce the given wave­ its maximum value is. how fa st it chan nels "on th e fly" without "glitch­ form without supervision until it is ex­ decays once it rea ches that value. on ing" the output. plicitly turned off. what level it remains as long as the The four channels of sound. num­ Sound channels 0 through 2 ca n be note is sustained. and how fast it bered 0 through 3. are converted to attacned to the channels directly above returns to zero once the note is re­ ana log signals. filtered through a low­ th em to modulate the output of th e leased. You can draw such an en­ pass filter. and mixed into two higher channel When a chan nel is at­ ve lope with four line segments: the separate output signals. one co mbin- tached. the 16-bit words that make up (conti~lued)

94 BY T E • AUGUST 1985 THE AMfGA

Amiga defines the ADSR envelope by each screen identifies the screen. (used to drag the window to a new giving the slope and destination y-axis Al l screens have pull-down menus. position). depth arrangers (which values for each line segment.) As with Pressing the right mouse button. move the window to the top or bot­ the audio DMA. the software involved which genera ll y summons a menu. tom of a stack of windows). sizing can be told to send a signal bit to a transforms the screen bar into a menu boxes (which allow you to change the given task when the envelope is bar (a strip containing the names of window's size). and close boxes completed the menus that apply to the current­ (which close a window). One potentially sign ificant piece of ly active window) The screen bar also Intuition supports backdrop windows . code is a library of text-to-speech rou­ contains two boxes that. when clicked wh ich open behind all other windows tines that is included with the stan­ with the left mouse button (generally and cannot be moved. sized. or dard Amiga computer. These are tran­ responsible for selecting things). depth-arranged. The application pro­ sient routines that are loaded from move the screen to the top or bottom gram is entirely responsible for main­ disk to memory when needed: they of the stack of screens. You can se lect taining its contents. and normal win­ are capable of "speaking" normal menu items in the conventional way. . dows appear on top of it. A graphics English text in a variety of pitches and although there are several rlew fea­ program. for example. may use a rates via one of the sound channels. tures. Pull-down menus. for example. backdrop window as the primary We heard the routines and found their can have up to two leve ls (see photo drawing area and call a normal win­ output to be heavily inflected but 4) Menus can contain options that. dow to show you a palette of colors understandable even with our eyes when selected. persist until other. from which to choose. closed (a test that many text-to­ mutually exclusive choices are made. Programmers can specify whether speech algorithms fail). Programs may al low you to use com­ an application will refresh its window mand-key/letter combinations to when partially covered and un­ INTUITION select commonly used menu items. covered. or whether memory must be Intuition. the user interface of the Programmers have considerable allocated to save the concealed por­ Amiga. sits on top of the disk operat­ flexibility in designing the menus. For tions of the window. A third choice. ing system and provides the ­ example. menus can appear in multi­ super bit map. reserves enough memory oriented. mouse-based. desktop­ column format and contain Waphics. to store an image larger than the win­ metaphor interface popularized by Menu items can. when selected. be dowing system will display. Intuition the Apple Macintosh. Intuition com­ marked with checks, and they can automaticall y adjusts and displays as plements the architectural philosophy automatically disp lay command-key/ much of the super bit map as it can. and the graphics capabilities of the letter alternatives. Programmers can use this technique computer by managin g a complex Windows, which appear within to create windows whose contents windowing system and providing ac­ screens. can support all of the scroll. They can also determine where cess to multitasking capabilities. Amiga's graphics. text. and qnimation windows will appear. what color to Intuition allows programs to ex­ features. Since Intuition opens ap­ use when drawing the border and ecute. each in its own window. simul­ plication programs in windows. ap­ text. whether the window will have a taneously. Each program opens a vir­ plications must specify their graphics. border. and whether to include a win­ } Lia I terminal that has access to all the text. and color requirements by dow title. system resources. Even though multi­ selecting or creating an appropriate ple programs can execute simu lta­ screen. Intuition will support as many REQUESTERS. ALERTS. AND neously. only one can accept input screens and windows as can fit in GADGETS and display its . You can memory. but only one window and. Requesters are pop-up information select which program does this by by extension. one screen cqn receive boxes that wait for either keyboard or clicking on its window: this window input at a time. As a virtual terminal. mouse input from you. Normally. you will also display special command programs need not know if they are will have to click the left mouse but­ messages from the system. Different active: they can continue to process ton over an "OK" area before con­ programs can share the video display. data as long as they don't need any tinuing. although you may be able to or a single program can create several external input. switch to a different window (the re­ virtua l terminals. You can activate a window either by quester will still be there when you To support the simultaneous display moving the on-screen pointer inside return to the first window). With a of different resolutions and graphics it and clicking the mouse button or by single call. programmers can attach modes. Intuition uses screens. which moving an icon into it. ClOSing a win­ requesters to a window or to the dou­ are rectangular areas that occupy the dow causes the last activated window ble click of the mouse button. full width of the video diplay. Screens to be reactivated. Windows can in­ Programmers have access to pre­ have predefined resolutions. color clude any of several featur<;s. includ­ defined system requesters. like the palettes. and height and contain one ing vertica l and horizontal scroll bars. "Please Insert Disk XXXX" requester. or more windows. A bar at the top of title bars. window-dragging areas [continued)

96 BY T E • AUGUST J985 Inquiry 22 7

THE AMIGA

To use a custom requester. however, windows. The Workbench automati­ the programmer must specify things cally opens when you enter a disk like gadgets (di sc ussed below), containing it. By opening the Work­ borders, requester tex t. and, if bench library. programmers can ac­ deSired. hand-designed bit-mapped cess Workbench functions to create images. and manipulate the Workbench and Alerts are special scree ns that ca rry Workbench objects. absolutely cru cial informati on. They in th e Workbench, users can open differ from requesters in that no and close disks, tools, projects, screen or window can obsc ure them, drawers, the cl ipboard, and th e and users mu st act immediately on ca n. Opening a tool (Amiga's term for the inform ati on before proceeding. an application program) creates a win­ Recove ry alerts require immediate dow on the current screen. Tools responses: dead-end alerts tell users that create projects-files associated with the system has crashed. the tool. (A document fil e, for exam­ IEEE·488 Interfaces and Sc reens, windows, requesters, and ple, is the project of a word-process­ Bus Extenders For: alerts all use gadgets, which are input ing application.) Opening a tool auto­ devices that attach to windows, re­ matica lly opens a window that lists IBM PC, PCjr questers, and alerts. System gadgets in­ the names of available projects. Open­ clude window-sizing gadgets, window-/ ing a project icon automaticall y opens & COMPATIBLES sc ree n-dragging area s, depth ar­ the tool associated with it. rangers, and close boxes. Workbench also supports extended DEC UNIBUS, Q"! BUS Programmers can design their own se lection , a method of selecting multi­ & RAINBOW 100 gadgets by specifying border shapes ple items that will be operated on in and colors, describing th e select box the ord er they were selected. For ex­ of the gadge t. providing gadget tex t. ample, you can select a word pro­ MULTIBUS, VMEbus supplying a memory buffer for th e cessor and three pro jects (docu­ STD & S·100 gadget response, and defining how ments): the word processor will then th e gadget will behave. wo rk on th e pro jects in the order in Full IEEE-488 functionality, with the most com­ In addition to system gadgets, pro­ which they were selected. prehensive language and operating system pover­ age in the industry. It takes expefience to make grammers can select among Boolean , Drawers are Workbench icons th at IEEE-488 systems work with nearty 4000 devices string, integer, and proportional contain tools, projects, and other available from more than 500 different manufac­ turers, and experience is what enables National gadgets. Boolean gadgets are truelfa lse drawers: when opened, th ey di splay Instruments to take the GPIB to the dev ices that return a va lue only when their co ntents as icons in a window. second power and beyond . se lected. Strin g gadgets return a string To add an item to th e drawer, either from th e keyboard. integer gadgets drag th e item's icon into the wi ndow re tu rn in teger va lu es. Pro portional of an opened drawer or drop it over gadgets, whi ch return a va lu e propor­ a closed drawer's icon. Yo u ca n delete tional to their pos itions on either the an item by moving its icon over the horizontal or vertica l ax is (or both) , trash ca n, a special drawer in each are similar to scroll bars on the Macin­ disk drawer th at contains deleted tosh. A programmer can customi ze objects. th e appea rance of th e knob (th e ele- The clipboard is a specia l obj ect that . ment that slides along th e ax is of lets you transfer data between tools movement) to someth ing different (programs) . The clipboard stores th e

Your personalguaranlee 01 unsurpassed from the defau lt rectangu lar shape. last text. graphi cs, or data cut from a ~':~~'f.'l:o~~ff,?g~l~d,~~I~;~C~\°a"cce 8 s . project as a RAM-based file (di sk­ 10100 + man-years 01 GPIB experience. THE WORKBENCH based if the clipping is too large for intuition includes Workbe nch, an memory) By usin g the clipboard, you iconi c, window-based command inter­ can qui ck ly transfer information be­ V NATIONAL face. The Workbench area is a four­ tween tools or projects. 11 !~!!~!~TS color screen with 64 0- by 200-pi xel Programmers ca n also design cus­ r Austin, TX 78727 resolution. it is both a sc reen on whi ch tom screens, in which th ey can specify 1-800-531-5066 512/250-9119 Telex: 756737 NAT INST AUS disks will open and appli ca ti on pro­ things li ke the screen size and posi­ grams will run and an applicatio n that tio n, th e number of colors ava ilable,

IBM and Pelr are trademarks of 100ernadonai Bu sill,f!sS Maahin~s , MULTI­ keeps track of Workbench objects and the scree n titles, and the default font. BUS ~ a uad,marli 01 Inlel, DEC. UNIBUS. Q·BUS, ~nd Rainbow 100 are trademarks of Digital Equipment Corporallon . disp lays in formation using intuition (co ntinued)

98 BY T E • AUGUST 1985 THE AMIGA

The Workbench also contains a pro­ demonstration programs, and an gram ca lled Preferences that lets you early version of the Graphicraft draw­ Table I: This is a list of the set things like the maximum time for ing program. announced hardware and software two clicks to be considered a double All the screen shots in this product for th e Amiga. cl ick. the monitor type. the speed with preview came from working (though which keyboard keys repeat. the inter­ still unfinished) software, but most of va l before they begin to repeat. and Hardware what we've written about the Amiga's the prese nce of optional peripherals. 20-megabyte hard disk, software came from the documen­ in cluding printers. modems. and 20-megabyte tape backup, tation or the engineers. According to touchpads. multifunction card , Commodore/Amiga. the BASIC that Th e Preferences program can also 2400-bps modem (Tecmar) will be bundled with the system will Lase r disk, have ex tended graphics and sound give you access to a command-line in­ Color digitizer. terface (CLI). which allows you to get Genlock peripheral- allows capabilities driven by ca ll s to the work done via typed-in commands. computer's ROM routines. Table I gives a list The CLI . which opens as a window display to overlay an external of products for the Amiga that we under Workbench. will not be heavil y video signal (Commodore) learned of from their respective documented in the standard manual s. manufacturers. Software and you will normally not see the icon Pascal , associated with it. The CLI uses com­ Li nkage Editor, CONCWSIONS mands that are similar to those of Overlay Loade r, We were impressed by the Amiga's 's MS-DOS. It can. for exam­ Macro Assembler (Metacomco) detail and speed of the color graphics ple. exa mine directories. run pro­ Turbo Pascal (Borland International) and by the quality of its sound system . grams. and redirect input and output; Logo (The LISP Company) The interlocking features of the in essenc e. it gives programmers ac­ Propaint, Amiga-its custom chips. multitasking Business Graphics, cess to th e operating system that is Graphicraft, support. multiple DMA chan nels. "underneath" Workbench . Animation (Island Graphics) shared system bus. display-driven Enable/Write (The Software Group) coprocessor. system routines in ROM . CAVEATS Textcraft (Arktronics) etc.-point to a complexity of hard­ This product preview is unusual in Musicraft (Com modore) ware design that we have not seen th at we looked at the Amiga in an Harmony and fo ur- octave music before in personal computers. (It's in­ keyboard , ea rlier state than we usually do for terestin g to note that the Macintosh's Pitch rider (Cherry Lane o ther product previews. We feel Technologies) complex ity is in its software and that. justified in doing this for two reason s: C Compiler (Lattice) according to several third-party First. the hardware was in its final sta te General Ledger, developers who have used both com­ (the custom chips were working on Accounts Receivable, puters. the Macintosh is harder to pro­ the production-version motherboard. Accounts Payable (C hang gram.) The synergistic effect of these Labol'8tories) although the PROM [programmable features accounts for the speed. quali­ 7 Cities of Gold , read-only memory[ chips did not con­ One on One, ty. and low cost of the Amiga. tain the fin al version of th e ROM Archon, We are also very exci ted about the code); second. the Amiga should be Adventu re Construction Set, inclusion of the text-to-speech library announced by the time you read this. Pinball Construction Set, in the Amiga. This mean s th at any and we feel that the technology used Skyfox, Amiga program can potentially create here is noteworthy. BYTE will print a Financial Cookbook, voice output. something that has Deluxe Music Construction Set, formal review of the Amiga as soon Black Knight, never been common in personal com­ as we ca n get our hands on a finished Video Construction Set, puters because it was never. until now. machine. Return to Atlantis (Electronic Arts) a standard feature. We wrote this product prev iew after Communications package The hardwa re looks good-we have two days with the Amiga engineering (Software 66) see n it work-but we saw very little staff. much study of four volumes of Welcome Aboard, software actuall y working (a painting Print Shop, technical documentation and several program . the Workbench "desktop." SynCalc, user manuals. and subsequent tele­ Mindwheel (Broderbund) and a few demonstration programs). phone conversations. At th e time we Keyboard Cadet, However. we think this machine will saw the machine. neither th e ROM The Halley Project (Mindscape) be a great success; if that happens. code nor the operating system had All Infocom Interactive fiction the Amiga will probably have a great been "frozen." which limited th e products effect on other personal computer amount of software we could see to companies and the industry in the Workbench user interface. several general. _

100 BY T E • AUGUST 1985 Inquiry 2 15 -+