Classic Computer Magazine Archive CREATIVE COMPUTING VOL. 11, NO. 9 / SEPTEMBER 1985 / PAGE 34

What makes it so great! (Commodore Amiga) Sheldon Leemon.

The Amiga is a creature of many parts, operating on many different levels. At the lowest level sits the hardware, the physical "body" of the computer. The microprocessor, a 16/32-bit 68000 running at 7.8MHz, is the same one used in Apple's Macintosh. But it is Amiga's set of three custom VLSI chips that sets the machine apart from the competition. Code-named Agnes, Daphne, and Portia, these chips act as powerful coprocessors that relieve the 68000 of many burdensome tasks, including maintenance of screen display, graphics animation, polling the keyboard and mouse ports, disk I/O and peripheral control, and sound generation.

Using up to 25 DMA channels (direct memory access that allows them to bypass the processor and address RAM directly), these chips can actually perform their tasks autonomously, leaving the processor free to crunch numbers (which is what it does best). The distribution of system DMA allows four-channel sound, a screen display of 16 colors in the lo-res mode or four colors in the hires mode, and disk I/O all to operate simultaneously while maintaining a 7.1 MHz rate in the operation of the 68000.

Let's be a little more specific as to the types of tasks that the custom chips perform. First we'll consider the graphics subsystems. In all modes, the screen is bit mapped. This means that there is no special text-only mode like the one available on the IBM PC, and consequently no restrictions on mixing text and graphics on the same screen in any mode. The two basic display modes are a low-resolution mode in which there are 200 rows of 320 dots each, and a high-resolution mode which displays 640X200 dots. In lo-res mode, text characters can be mapped on the screen so that 25 lines of 40-column text are displayed, and in hi-res mode 80-column text can be displayed on a hi-res monochrome or RGB monitor, while 64-column text can be used with an ordinary television set. Both hi- and lo-res screens can be operated in "interlace mode," which effectively doubles the vertical resolution to 400 dots (while adding a bit of flicker).

The normal bit-map screen is referred to as a "playfield." The Amiga supports the display of two separate playfields on screen at the same time, with a selectable priority system which determines which will be superimposed on the other. These playfields can be individually fine-scrolled in any direction.

The color selection mechanism is extremely flexible. Since each bit of color resolution requires a fair amount of display memory (8000 bytes in non-interlaced lo-res mode and 16,000 for hi-res), the system allows the user to choose how many bits of color resolution he wants, and to store each bit of resolution in its own "bit plane." The graphics chip has individual address registers for each bit-plane, so screen memory does not have to be located in one fixed spot as on the IBM PC, or even to be contiguous for matter.

Screen display information can be located anywhere in the bottom 512K of memory. In lo-res mode, the machine will support 2, 4, 8, 16, or 32 colors onsreen simultaneously. In hi-res mode, there can be 2, 4, 8, or 16 colors. There is even a special Hold and Modify mode in which all 4096 colors can be displayed simultaneously.

Colors are selected through an indirect direct register mechanism. Each screen dot points to one of 32 12-bit hardware color registers and is "painted" with the color found in that register. By mixing combinations of four bits each of red, green, and blue, the user selects the color for each register out of a palette of 4096 possible colors.

Spritely Animation

In addition to the playfield graphics system, the Amiga supports sprite graphics. Readers familiar with the Commodore 64, Atari, and TI 99/4 computers know that sprites are a separate graphics system of user-defined screen objects that are superimposed on the normal graphics display. The Amiga graphics chip supports up to eight sprites per horizontal scan line. Each sprite can be up to 16 dots wide and from 1 to 200 dots tall, and use up to four colors (the sprites share some of the 32 playfield color registers). Pairs of sprites can be combined to allow up to 16 colors per sprite. As in most such systems, the hardware supports selectable priorities and collision detection that reports when two or more sprites overlap.

Sprites are one hardware solution to the problem of animation. On most micros, bit-map animation requires a lot of programming. To draw a bit-map object on the screen, the programmer must first save the background image, then superimpose the image of the object bit by bit. To move the object, he must restore the old background image, calculate the memory address for new screen position, save the background image at the new position, and then redraw the object.

The Amiga has another solution, a hardware device known as a "blitter." The blitter moves blocks of data bits around at a very high rate of speed. Though it is used primarily to move screen data, it also comes in handy for other types of high-speed memory moves (like filling memory with zeros). To animate a bit-map image, the programmer first defines a blitter object (I like to call it a "blob") by specifying the location of its outline on the screen. From then on, all he has to do is say "move it," and the blitter does so, immediately. Unlike sprites, there is no limit on the number of blobs that can appear on the screen at once, and a blob can be any size and use a many colors as the screen display will support.

The only drawback to using blobs is that there is a little more overhead involved in setting one up than in creating a sprite, and if you try to animate too many blobs at once, it can slow down the system. To keep "garbage" off the screen while such complex animation is going on, the Amiga supports double buffering, so that a static copy of the screen is displayed while changes are made to a duplicate copy "off-screen." The graphics hardware contains, in addition to blobs, support for high-speed line drawing and area filling.

The Amiga video hardware supports output to a television set, a composite monitor, a digital RGB monitor, or an analog RGB monitor--virtually every type of display screen available (though the analog RGB monitor that Commodore will be selling is the only kind that can take advantage of both the 640X400 resolution and the 4096 colors). Besides having a multitude of video outputs, the computer also has a video input jack. This unique feature, known as the Gen-lock interface, allows the user to send an ordinary television signal (from a VCR, a video camera, or even another computer) into the Amiga, and to display that picture on the screen with Amiga graphics superimposed.

Sound Ideas

The Amiga custom chip set supports great sound as well as great graphics. The sound synthesizer supports four voices, which are routed to stereo output jacks--two voices on the left channel and two on the right. Each channel has its own 8-bit digital-to-analog converter driven by a DMA channel. Each can produce sounds in a range of about 0-7500 KHz, and has its own 6-bit volume control for 64 volume levels. The programmer controls the tone quality of the sound produced by creating a data model of the sound in memory. The hardware uses this data to generate the waveform shaping and envelope control of the sound.

In addition to synthesized sound, the system supports the reproduction of recorded sounds using a digital sampling technique. For this purpose, stereo audio input jacks are included on the machine. While digital sampling reproduces sounds very accurately, it has been of limited application because it requires thousands of bytes of data for a few seconds of sound. With memory and mass storage getting cheaper all of the time, however, this feature becomes increasingly interesting.

Finally, it should be pointed out that the Amiga is a completely open-architecture machine. The expansion port on the computer gives third-party designers total access to the system hardware and will make the addition of a variety of external devices relatively simple. This will insure that Amiga owners will be able to take advantage of all current technological enhancements, as well as benefiting from future developments.

From the above description it should be clear that the Amiga hardware is exceptional. Even the most impressive hardware, however, requires software to make it do anything. The Amiga ROM Kernel was designed to support fully the hardware, and, wherever possible, to enhance its operation. At the heart of the system is the multitasking system executive (Exec), which controls the execution of numerous small programs (or tasks), communication between tasks, memory allocation, the sharing of hardware resources, and the handling of interrupts and exceptions.

Exec was designed to facilitate the execution of several tasks simultaneously. The tasks themselves do not have to be designed in any special way for multitasking, since Exec provides each with its own operating environment, and each can run as if it had its own private 68000 processor. Programs actually share processor time, each task getting a minimum time-slice of about 1/15 of a second to run before being pre-empted by the next task on the list. A system of selectable priorities allows higher priority tasks to pre-empt lower priority ones and some tasks to "go to sleep" until a certain event happens. The order in which tasks are performed can also be changed by messages which one task passes to another via the message ports through which the various tasks communicate. Exec also provides a device independent I/O interface by which a task can access a hardware device through a central I/O request block.

Extraordinary Software

The rest of the system software consists of several software libraries. These routines include low-level functions for controlling graphics modes, animation, text, and sound generation. The libraries offer much more extensive hardware support than is normally given by built-in system software. For example, although typical video display hardware is limited in the amount of information it can show on the screen at once, programmers commonly use software tricks to change the display in midscreen so as to achieve better performance than the video chip normally offers.

By careful programming, for instance, an eight-sprite limit can be bypassed by "reusing" a sprite, moving it down to another screen position after it has been displayed once. Most machines require the programmer to perform the critical timing involved. On the Amiga, however, the system software allows the programmer to create "virtual sprites." If he creates more than eight of them, the system itself performs the delicate task of juggling hardware sprites to display these virtual sprites at the correct screen positions.

Moreover, virtual sprites are but a small part of the Amiga animation toolkit. An illusion of animation can be created by flipping through various "views" of a graphic object at a designated rate; moving sub-parts can be linked into a larger moving object; and full collision detection allows the programmer to designate how the animation will change if two sprites or playfield objects collide.

This high level of system support for functions normally performed by applications software is consistent throughout the Amiga system ROM. A window, for example, can be turned into a "viewport" on a scrolling virtual screen of up to 1024X1024 dots. The text package supports font styles like underlined, bold, italic, extended, and even has provisions for proportional print. The sound chip support includes not only facilities for making music and sound effects, but complete support for software speech synthesis, including both phonetic input and text-to-speech conversion. Obviously, the list of examples could go on and on.

Like the hardware, the system ROM was designed to be totally expandable. Wherever possible, it uses linked lists of pointers rather than jump tables or vectors that must be installed at a given absolute address. And, wherever possible, it leaves "hooks" where the user (or future system software) can add functions to the existing ones. Such a design suggests the contemplation of an upwardly-compatible family of elite microcomputers.