 | Original Amiga chipset: Encyclopedia II - Original Amiga chipset - Agnus
Original Amiga chipset - Agnus
The central aspect of the chipset's power is that all operations are synchronised with the output of the video beam. This includes access to the built-in RAM, which is known as chip RAM because the chipset has access to it. The CPU and other members of the chipset have to arbitrate for access with Agnus. From the perspective of system architecture, this is known as Direct Memory Access (DMA), and Agnus is the DMA Controller (DMAC) in that respect.
Agnus has a complex priority-based memory access policy. Bitplane data fetches are more important than blitter transfers, for example. As the original 68000 in Amigas can only access memory on every second clock cycle, Agnus operates a system where the time-critical custom chips access get the "odd" cycle and the CPU gets the "even" cycle, thus the CPU does not get locked out of memory access and does not appear to slow down. However, non-time-critical custom chip access, such as blitter transfers, can use up any unused odd or even cycles and, if the "BLITHOG" (blitter hog) flag is set, Agnus will lock out the even cycles from the CPU in deference to the blitter.
Agnus's timings were measured in "colour clocks" of 280 ns. This is equivalent to two lowres (140 ns) pixels or four hi-res (70 ns) pixels. Like Denise, these timings were designed for display on household TVs, and can be synchronised to an external clock source.
Original Amiga chipset - Blitter
The blitter—"blit" is shorthand for "block image transfer" (or bit blit). The Blitter is a highly parallel memory transfer and logic operation unit. It has three modes of operation: copying blocks of memory, filling blocks (e.g. polygon filling) and line drawing.
Block copying mode takes zero to three data sources in memory (A, B and C), and writes to a destination area (D). Any of these areas can overlap. All blocks are on 16-bit (two byte) boundaries. The blitter either runs from the start of the block to the end, known as "ascending" mode, or in reverse, "descending" mode. Blocks are "rectangular"; they have a "width" in 16-bit words (not pixels), a height measured in "lines", and a "stride" distance to move from the end of one line to the next. This allows the blitter to operate on any conceivable video resolution. The copy automatically performs a per-pixel logical operation. These operations are described generically using minterms. This is most commonly used to do direct copies (D = A), or apply a pixel mask around blitted objects (D = A AND C). The copy can also barrel shift each line by 0 to 15 pixels. This allows the blitter to draw at pixel offsets that are not exactly multiples of 16.
The line mode draws single-pixel thick lines using the Bresenham line drawing algorithm. It can also apply a 16-bit repeating pattern to the line. The filling mode is used to fill per-line horizontal spans. On each span, it reads each pixel in turn from left to right. Whenever it reads a set pixel, it toggles filling mode on or off. When filling mode is on, it sets every pixel until filling mode is turned off or the line ends. Together, these modes allow the blitter to draw individual flat-shaded polygons, albeit very slowly in comparison to modern 3D graphics chipsets or the CPU of a moderately fast Amiga.
Original Amiga chipset - Copper
The copper—short for "co-processor"—is a programmable finite state machine. When it is turned on, it has three states; either reading an instruction, executing it, or waiting for a specific video beam position. The copper runs a program called the copper list in parallel with the main CPU. The copper runs in sync with the video beam, and it can be used to perform various operations in sync to the video beam. Most commonly it is used to control video output, but it can write to any of the chipset registers and thus can be used to set audio registers or interrupt the CPU.
The copper list has three kinds of instructions, each one being a pair of two bytes, four bytes in total:
- The MOVE instruction writes a 16-bit value into one of the chipset's hardware registers.
- The WAIT instruction halts copper execution until a given beam position is reached, thus making possible to synchronize other instructions with respect to screen drawing. It can also wait for a blitter operation to finish.
- The SKIP instruction will skip the following copper instruction if a given beam position has already been reached. This can be used to create copper list loops.
The length of the copper list program is limited by execution time. The copper restarts executing the copper list at the start of each new video frame. There is no explicit "end" instruction, instead the WAIT instruction is used to wait for a location which is never reached.
Common functions of the copper are:
- Set-up of the hardware registers that require re-initialisation on each frame.
- Split the screen in multiple regions, each having separate overall position, palette and in some cases different graphics resolution. Most notably the AmigaOS uses this extensively for its screen-dragging capabilities.
- Showing only part of the screen in vertical direction.
- Changing a colour register once per scanline, creating the "raster bars" effect seen commonly in Amiga games.
- Changing other hardware registers once per scanline, for example the bitplane pointers. This can be exploited to give a number of pleasing graphical effects, usually seen in demos rather than games.
Less common functions of the copper are:
- Driving hardware sprites with MOVE and WAIT instructions. This includes re-using sprites more than once on the same scanline, by repositioning them in mid-scan after they have already been drawn.
- Driving blitter operations directly.
- Emulating a 12-bit true color mode by changing the background colour register in sync with screen drawing. This requires no actual bitplane graphics to be displayed at all!
- Trigger CPU interrupts to synchronize CPU on hw screen drawing.
Other related archives3D graphics, 68000, A1000, Advanced Graphics Architecture, Amiga, Amiga 1000, Amiga 2000, Amiga 500, AmigaOS, Apple II, Bresenham line drawing algorithm, CPU, Commodore, Commodore 1541, Commodore 1581 formatted 3.5" floppy for C64 and C128, DAC, DACs, DIPs, DMA, Direct Memory Access, EHB, Enhanced Chip Set, Extra-HalfBrite, ExtraHalfBrite, FIFO, HAM, Halfbrite mode, Hold And Modify, Hold-and-Modify, Hz, IBM PC, KiB, MFM, MIDI, MOS Technology, Mac, MiB, NMOS, PCM, PLCC, RAM, TVs, United States, bit blit, bitplanes, blitter, chip RAM, chip manufacturing, chipset, chromakey, finite state machine, genlocking, interlaced, interlacing, interrupts, minterms, ns, planar, reconstruction filter, sprites
 Adapted from the Wikipedia article "Agnus", under the G.N U Free Docmentation License. Please also see http://en.wikipedia.org/wiki |