Every picture, sound and disk read on an Amiga starts with Agnus. The chip generates the memory address for each of the machine’s 25 DMA (direct memory access) channels: bitplanes, sprites, the four audio channels, the disk, the copper and the blitter. It then decides, cycle by cycle, which of them gets the memory next. Commodore’s service manual for the A500 Plus describes it as “an address generator type IC” whose job is to “produce all DMA addresses for 25 channels”.
The other two custom chips never address memory themselves. Denise draws the screen and Paula plays the sound, but Agnus fetches their data and passes it to them. When Agnus runs a bus cycle, the A500 service manual explains, “it outputs a code on the Register Address Bus telling the other 2 chips the nature of the bus cycle”, so the right chip picks up the word. Agnus also contains the Amiga’s two co-processors, the copper and the blitter, and generates the system clocks from a 28 MHz crystal.
The design had a price, and the Hardware Reference Manual states it plainly: in the queue for memory, the 68000 processor comes last.
Fast facts
- Role: DMA controller and address generator for 25 channels, with the copper, the blitter and the beam position counter built in.
- Clock: derives the system clocks from the 28 MHz crystal. One memory cycle, a “colour clock”, lasts about 280 nanoseconds.
- Original chips: 8361 (NTSC) and 8367 (PAL), in the Amiga 1000. They could reach 512K of Chip memory.
- Fat Agnus: 8370 (NTSC) and 8371 (PAL), in early A500s and A2000s. Still 512K of Chip memory, plus 512K of “slow” memory for the processor.
- Enhanced Chip Set (ECS): 8372A, 1MB of Chip memory; 8372B in the A3000 and 8375 in the A500 Plus and A600, 2MB.
- Successor: Alice (8374), in the AGA machines of 1992.
The priority ladder
Commodore’s manual gives each device that uses memory a priority, and a reason for it:
| Priority | Device | The manual’s reason |
|---|---|---|
| Highest | disk, audio, display and sprite DMA | “missed DMA cycles can cause lost data, noise in the sound output, or on-screen interruptions” |
| the copper | “it has to perform its operations at the same time during each display frame to remain synchronized with the display beam” | |
| the blitter | “it performs data copying, modifying, and line drawing operations much faster than the 68000” | |
| Lowest | the 68000 |
Priority is not waste. “If a device does not request one of its allocated time slots,” the manual adds, “the slot is open for other uses.” A screen with few bitplanes and no sound leaves most of the line free.
The blitter’s place above the processor is adjustable. Normally, if the 68000 has waited three memory cycles in a row, the blitter gives it one. Setting bit 10 of DMACON, which the manual says is “commonly referred to as the ‘blitter-nasty’ bit”, takes that courtesy away, and the blitter keeps “every available Chip memory cycle” until it finishes.
227.5 cycles a line, and where they go
A scan line lasts “about 63 microseconds” and holds “227.5 ‘color clocks’, or memory access cycles”, of which 226 can be handed out. Some are spoken for before any picture is drawn:
| Cycles | Purpose |
|---|---|
| 4 | memory refresh |
| 3 | disk DMA |
| 4 | audio DMA (2 bytes per channel) |
| 16 | sprite DMA (2 words per channel) |
The display takes what it needs from the rest, and the cost depends on the screen. With four low-resolution bitplanes or fewer, bitplane fetches use only the cycles the 68000 does not want. With six, as a HAM or Extra Half-Brite screen needs, bitplane DMA “steals 50 percent of the open slots that the processor might have used”. Four high-resolution bitplanes take every slot across the visible line, which “effectively locks out the 68000 (as well as the blitter or Copper) from any memory access during the display, except during horizontal and vertical blanking.”
The screen can also crowd out sprites. Fetching starts earlier for a wider display or a scrolling one, and the manual warns that “larger displays may block out one or more of the highest-numbered sprites, especially with scrolling”, because the extra bitplane fetches take the sprites’ slots.
Why the 68000 hardly notices
Most of the time the processor runs at full speed anyway, and the reason is a matching of rhythms:
The 68000 uses only the even-numbered memory access cycles. The 68000 spends about half of a complete processor instruction time doing internal operations and the other half accessing memory. Therefore, the allocation of alternate memory cycles to the 68000 makes it appear to the 68000 that it has the memory all of the time, and it will run at full speed.
The custom chips use the cycles in between while the 68000 is busy inside itself. (The manual is not consistent about which set it calls odd: the copper chapter says audio, disk, refresh and sprite DMA use “only the even-numbered memory cycles”. What matters is that the two sets alternate.) Contention appears only when an instruction’s memory accesses fall out of step with the even cycles, when the blitter is running, or when the display grows large enough to take the even cycles too. None of this applies to Fast memory or ROM: the custom chips cannot reach them, so they cannot steal cycles there.
The instruction the Amiga cannot use
The scheduling goes deep enough to remove an instruction from the processor. A boxed warning in the manual reads:
Avoid the TAS instruction. The 68000 test-and-set instruction (TAS) should never be used in the Amiga; the indivisible read-modify-write cycle that is used only in this instruction will not fit into a DMA memory access slot.
TAS reads a byte and writes it back as one uninterrupted operation, and Agnus’s slot pattern has no room for an access that long.
Chip memory: 512K, then 1MB, then 2MB
Agnus decides how much of the Amiga’s memory is Chip memory, the memory the custom chips can see. Graphics, sound samples, copper lists and disk buffers all have to live there, so each new Agnus changed what programs could do.
| Chip | Machines | Chip memory | Notes |
|---|---|---|---|
| 8361 (NTSC), 8367 (PAL) | Amiga 1000 | 512K | Separate chips for each TV standard |
| 8370 (NTSC), 8371 (PAL) “Fat Agnus” | early A500 and A2000 | 512K | Adds 512K of “slow” memory at $C00000 for the processor |
| 8372A (ECS) | later A500 and A2000 | 1MB | One chip for both NTSC and PAL, pin compatible with the 8370 and 8371 |
| 8372B (ECS) | A3000 | 2MB | |
| 8375 (ECS) | A500 Plus, A600 | 2MB | 84-pin package; separate PAL and NTSC parts |
| Alice, 8374 (AGA) | A1200, A4000 | 2MB | Replaced Agnus in the AGA chip set |
The “slow” memory of the Fat Agnus machines is only visible to the processor, but the name is honest: it sits behind the same gate as Chip memory, so the custom chips can still hold the processor off it during a busy display.
In the A500, Commodore would not back the extra memory. Its A500 service manual notes that some boards carry the 8372, but “Commodore Business Machines does not support the One Megabyte addressing feature of the Fat Agnus 8372 IC in A500 Computers”. Instructions for enabling it, it warns, “have been circulated without Official Approval”, and doing so would void the warranty. Owners did it anyway. In March 1991 an Amiga Format mail-order advertisement listed a “1Mb Fat Agnus 8372A” for £69.
The 8375 made 2MB standard hardware. The A500 Plus service manual lists “8375 FAT AGNUS which supports 2 Meg. of Chip RAM”, paired with the 8373 ECS Denise.
The copper and the blitter
Both co-processors are part of Agnus, and each has its own entry.
The copper runs a list of instructions in step with the video beam. The manual notes that it “has only three instructions”: MOVE writes a value to a chip register, WAIT waits for a beam position, and SKIP jumps over the next instruction if the beam has passed one. It uses the same memory cycles as everything else; the manual’s timing chart notes that a copper MOVE needs four slots and a WAIT six.
The blitter copies and combines rectangles of Chip memory, draws lines and fills shapes. Its priority over the processor, and the “blitter-nasty” bit that removes the processor’s share, are described above.
Alice
The AGA chip set of 1992 replaced Agnus with Alice, part 8374 in the A4000 service manual’s parts list. It fetched the screen faster, which the new 256-colour modes needed, but the rest of the machine did not change as much as the launch coverage suggested. Asked about A1200 games in 1994, Shaun Southern of Magnetic Fields told The One: “The only thing which is any faster, apart from the processor, is the screen fetch. If you want more colours then you have to put more data down, but the blitter’s no faster at all.”
Registers
| Register | Address | Purpose |
|---|---|---|
DMACONR |
$DFF002 |
DMA control and blitter status, read |
VPOSR |
$DFF004 |
Beam position, high bit, and frame type; bits 8-14 identify the Agnus version |
VHPOSR |
$DFF006 |
Beam position, vertical and horizontal |
COPJMP1 |
$DFF088 |
Restart the copper at its first list |
DMACON |
$DFF096 |
DMA control, write: switches channels on and off, and holds the blitter-nasty bit |
The blitter’s registers start at $DFF040; see the blitter entry.
Sources
- AmigaWorld, volume 1 number 2, November/December 1985, p. 6: the Amiga’s debut at Lincoln Center on 23 July 1985.
- Amiga Hardware Reference Manual, 3rd edition (Commodore-Amiga, Addison-Wesley, 1991): Chip and Fast memory, the Fat Agnus, slow memory and ECS (pp. 3-5); the copper’s three instructions (p. 20); DMA priorities and the 227.5-cycle line (p. 194); Figure 6-9, the time-slot chart and its notes on copper slots and wide displays (p. 195); the copper and the even-numbered cycles (p. 19); even cycles for the 68000 and the
TASwarning (p. 196); six low-resolution and four high-resolution bitplanes, and displays blocking sprites (pp. 196-197); the blitter-nasty bit (p. 198); ECS memory limits (p. 295); Agnus identification inVPOSRand the part numbers (p. 299); register list (Appendix A, pp. 269-285). - Amiga 1000 Service Manual (Commodore): parts list, 8361 Agnus.
- A500 Service Manual, PN 314981-04 (Commodore, October 1990): 25 DMA counters and the register address bus (p. 2-7); DRAM timing and address multiplexing (p. 2-8); feature list and the notice on one-megabyte addressing (p. 2-9); parts list, 8370 and 8371.
- A500 Plus Service Manual (Commodore, October 1991): the 8375 as an address generator for 25 channels, and 2MB of Chip memory; parts list, PAL and NTSC 8375.
- A3000 Service Manual (Commodore, March 1990): parts list, “8372 FAT AGNUS 2 MEG”.
- A600 System Schematics (Commodore, April 1992): “8375RO AGNUS HR PAL 84 PIN PLCC”.
- A4000 Service Manual (Commodore): parts list, “8374, ALICE”.
- Amiga Format, issue 20, March 1991, p. 110: mail-order advertisement, “1Mb Fat Agnus 8372A” at £69.
- The One, issue 72, September 1994: interview with Magnetic Fields, Shaun Southern on the A1200.
See also
- The Amiga custom chipset: how Agnus, Denise and Paula fit together.
- Blitter and Copper: the co-processors inside Agnus.
- Denise and Paula: the chips Agnus fetches for.
- Commodore Amiga: the machine, and what display DMA costs a program.
- 68000: the processor at the bottom of the queue.