The Amiga Blitter: Moving Mountains of RAM
The Workhorse of the OCS
In the mid-1980s, if you wanted to move a graphic object on a computer screen, you typically had to rely on the CPU. The processor would have to pause its calculations, pick up a byte of graphics data, move it to a register, shift it to align with the pixel grid, and write it back to video memory. This “bit-banging” consumed vast amounts of processing power, leaving little room for game logic or physics.
The Amiga changed the rules of the game with the Blitter (Block Image Transferrer). Located within the Agnus chip (part of the OCS/ECS chipset), the Blitter was a dedicated Direct Memory Access (DMA) engine designed for one specific purpose: moving and modifying rectangular blocks of memory faster than the CPU ever could.
The Architecture of Speed
The Blitter was essentially a hardware accelerator for 2D graphics. It operated independently of the 68000 CPU, meaning the computer could technically be “doing two things at once”—calculating the AI for a spaceship while the Blitter drew the explosion.
The Four Channels
The Blitter accessed memory through four DMA channels, named A, B, C, and D:
- Source A: Typically used for the “Mask” (the shape of the object).
- Source B: Typically used for the “Source” graphics (the colors of the object).
- Source C: Typically used for the “Destination Background” (reading the current screen).
- Destination D: The write channel (writing the final result back to memory).
Having three source channels allowed for single-pass operations that would take a standard CPU dozens of instructions to replicate.
The Magic of Minterms (Boolean Logic)
The heart of the Blitter was its logic unit. It didn’t just copy data; it mathematically combined it. The programmer controlled this using an 8-bit “Minterm” (Logic Function) register. This byte defined the boolean operation to perform on the A, B, and C inputs.
For example, to draw a sprite (B) through a mask (A) onto a background (C), you want:
- Where the Mask (A) is 1, show the Sprite (B).
- Where the Mask (A) is 0, show the Background (C).
In boolean logic, this is: D = (A AND B) OR ((NOT A) AND C)
The Blitter could execute any of the 256 possible boolean combinations of three inputs in a single clock cycle per 16-bit word.
The “Cookie Cut” Technique
This boolean capability allowed for the famous “Cookie Cut” blit—the standard way to draw bob (Blitter Objects) without rectangular borders.
; 68000 Assembly: Setting up a Cookie Cut Blit
; Assumption: a5 points to custom chip base ($DFF000)
wait_blitter:
btst #6, DMACONR(a5) ; Check if Blitter is busy
bne.s wait_blitter ; Loop until free
; 1. Set Data Pointers
move.l #mask_data, BLTAPT(a5) ; Channel A: The shape mask
move.l #bob_data, BLTBPT(a5) ; Channel B: The pixel data
move.l #screen_mem,BLTCPT(a5) ; Channel C: Read current screen
move.l #screen_mem,BLTDPT(a5) ; Channel D: Write to screen
; 2. Modulo (Stride) Calculations
; The Blitter needs to know how much to "skip" to get to the next line.
; Modulo = Screen_Width_Bytes - Blit_Width_Bytes
move.w #0, BLTAMOD(a5) ; Mask is packed tightly
move.w #0, BLTBMOD(a5) ; Bob data is packed tightly
move.w #40-4, BLTCMOD(a5) ; Screen is 320px (40 bytes), Bob is 32px (4 bytes)
move.w #40-4, BLTDMOD(a5)
; 3. Masking the Edges
; Since the Blitter works in 16-bit words, you might only want to draw
; part of the first or last word.
move.w #$FFFF, BLTAFWM(a5) ; Draw all bits of first word
move.w #$FFFF, BLTALWM(a5) ; Draw all bits of last word
; 4. The Logic Minterm
; $CA is the magic number for (A & B) | (~A & C)
; $F000 enables channels A, B, C, and D
move.w #$0FCA, BLTCON0(a5)
move.w #0, BLTCON1(a5) ; Normal mode (not line drawing)
; 5. The Trigger
; Height = 32 lines, Width = 2 words (32 pixels)
; Format: (Height << 6) | Width
move.w #(32<<6)|2, BLTSIZE(a5) ; Writing this register starts the Blitter
Advanced Modes: Lines and Fills
The Blitter wasn’t limited to copying rectangular blocks. It had hardware support for other primitives:
Line Drawing
The Blitter implemented Bresenham’s line algorithm in hardware. By setting specific bits in BLTCON1, the Blitter would treat the data as a vector line. This was exponentially faster than calculating pixel coordinates on the CPU, making the Amiga an early powerhouse for 3D wireframe games like Elite and Starglider.
Area Fill Mode
This was perhaps the most unique feature. The Blitter could scan a line of memory and “fill” it between edges. This allowed 3D engines to draw just the outline of a polygon and let the Blitter fill in the color.
- Inclusive Fill: Fills between edges.
- Exclusive Fill: Fills between edges (XOR style).
This “Area Fill” capability is what made the “Vector Balls” demo effect possible—hundreds of filled 3D spheres moving at 60 FPS, a feat the 68000 CPU could never handle alone.
The “Nasty” Bit: Blitter Priority
The Amiga’s architecture is based on shared memory (Chip RAM). Both the CPU and the custom chips (Agus, Denise, Paula) compete for access to this RAM.
Usually, the Blitter is a “polite” citizen. It uses memory cycles that the CPU isn’t using. However, for maximum performance, a programmer could set the Blitter Nasty bit (Bit 10 in DMACON).
When this bit was set, Agnus would give the Blitter priority over the CPU. If the Blitter was doing a large copy, the CPU would completely freeze until the operation was done. While this stopped the OS and multitasking, it guaranteed the fastest possible graphics update—essential for the 50/60Hz refresh rates demanded by the demoscene.
Historical Context
To understand the Blitter’s impact, compare it to the IBM PC of 1987 (VGA era). On a PC, to move a 32x32 pixel sprite with transparency:
- CPU reads byte from sprite.
- CPU reads byte from mask.
- CPU performs
AND. - CPU reads byte from screen.
- CPU performs
OR. - CPU writes byte to screen.
- Repeat 1024 times per frame.
On the Amiga, the CPU simply said: “Blitter, here is the sprite, here is the screen. Do it.” And then the CPU went back to calculating the game logic. This architectural difference is why Amiga games felt fluid and “arcade-perfect” while PC ports often felt sluggish and jerky until the 386/486 era brute-forced the problem.
Technical Modules
- Technical Demo: Vector Balls - The “Area Fill” mode of the Blitter made filled vectors possible.
- Technical Demo: Moire Pattern - Uses the Blitter’s high-speed XOR mode to create interference patterns.
Source & Further Reading
- Amiga Hardware Reference Manual (Chapter 6): The official documentation for the Blitter.
- “Inside the Amiga Blitter”: A technical breakdown of the barrel shifter and logic gates.
- Patent US4777621A: The original Commodore patent for the Bit-Mapped Display Control logic.
- “The startup-sequence”: A detailed look at how the Amiga boots and initializes the chipset.