Denise: The Painter of Bitplanes
The Video Output Engine
In the Amiga’s Original Chip Set (OCS), the Denise chip (MOS Technology 8362) serves as the final and most visible stage of the graphics pipeline. While Agnus manages the memory and the Blitter moves the data, Denise is the artist. It is responsible for fetching bitplane data from memory (via Agnus), serializing it, applying color palettes, and generating the analog RGB signals that drive the monitor.
The Philosophy of Bitplanes
To understand Denise, one must understand “Planar” graphics. Modern computers use “Chunky” pixels, where a single byte (or word) in memory represents one pixel (e.g., RRGG BB). The Amiga, however, used Bitplanes.
In a 3-bitplane mode (8 colors):
- Bitplane 1 holds the 1st bit of the color index for every pixel.
- Bitplane 2 holds the 2nd bit.
- Bitplane 3 holds the 3rd bit.
Denise reads a 16-bit word from each of these three separate areas of memory, combines the bits, and forms a color index for each pixel. This architecture was chosen because it was memory-efficient. If you only needed 2 colors, you only used 1 bitplane of RAM. If you needed 32 colors, you used 5 bitplanes.
Resolution and Modes
Denise offered incredible flexibility for 1985:
- Low Res: 320x200 (NTSC) or 320x256 (PAL). The standard for games.
- High Res: 640x200 (NTSC) or 640x256 (PAL). Used for Workbench (the desktop).
- Interlaced: By doubling the vertical scan rate, resolutions of 640x400 or 640x512 were possible, though with significant flicker on standard TVs.
The Palette System
Denise contained 32 color registers (COLOR00 to COLOR31).
- Each register was 12-bit: 4 bits Red, 4 bits Green, 4 bits Blue.
- This gave a master palette of 4,096 colors ($000 to $FFF).
Programming the colors was simple in 68000 Assembly:
; Set background (Color 0) to Deep Purple
LEA $DFF000, a0 ; Base address of custom chips
MOVE.W #$0808, COLOR00(a0) ; R=8, G=0, B=8
; Set Color 1 to Bright Yellow
MOVE.W #$0FF0, COLOR01(a0) ; R=F, G=F, B=0
The Copper Connection
While the CPU could write to these registers, the Copper coprocessor usually handled it. The Copper could change these registers during the display of a frame. This allowed for:
- Copper Bars: Changing the background color on every scanline to create smooth gradients.
- Parallax: Changing the color of the “sky” to “water” halfway down the screen.
Advanced Display Modes
Denise wasn’t just a frame buffer reader; it had hardware modes that defied the standard bitplane logic.
Hold-And-Modify (HAM)
HAM mode is legendary. It allowed the display of all 4,096 colors on screen simultaneously using only 6 bitplanes.
- Bitplanes 5 & 6 acted as control bits.
- 00: Use palette color index from bitplanes 1-4 (16 base colors).
- 01: Hold the previous pixel’s color, but modify the Blue component with bits 1-4.
- 10: Hold previous, modify Red.
- 11: Hold previous, modify Green.
This allowed photorealistic images in 1985, years before VGA. However, it created “fringing” artifacts—if you changed from a red pixel to a blue pixel, you might need two pixels to get there (one to change Red, one to change Blue).
Extra Half-Brite (EHB)
In EHB mode (6 bitplanes), the first 32 colors were standard. The upper 32 colors (indices 32-63) were “shadow” versions of the first 32—exactly half the brightness. This provided a cheap, hardware-accelerated way to do shadow effects in games.
Hardware Sprites
Denise supported 8 hardware sprites. Unlike “Bobs” (which were drawn into memory by the Blitter), Hardware Sprites were composited on-the-fly by Denise as the video beam scanned.
- Size: 16 pixels wide, any height.
- Colors: 3 colors + transparent per sprite.
- Reuse: A sprite channel could be reused multiple times vertically. This allowed for “Sprite Multiplexing,” where a single hardware channel could draw dozens of bullets or enemies, provided they didn’t overlap horizontally on the same scanline.
Dual Playfield Mode
For scrolling games, Denise offered Dual Playfield. The bitplanes were split into two groups (e.g., 3 for foreground, 3 for background).
- Playfield 1 and Playfield 2 scrolled independently.
- Denise prioritized Playfield 1 pixels; if a PF1 pixel was “color 0” (transparent), the PF2 pixel showed through. This hardware-level parallax scrolling was the secret sauce behind the smooth, multi-layered look of Amiga platformers like Shadow of the Beast and Turrican II.
Technical Modules
- Technical Demo: Copper Bars - Shows how changing Denise’s color registers per-line creates gradients.
- Technical Demo: Metaballs - Often utilized HAM mode for smooth color transitions on static screens.
Source & Further Reading
- Amiga Hardware Reference Manual: Chapter 3, “Playfield Hardware” and Chapter 4, “Sprite Hardware”.
- MOS 8362 (Denise) Datasheet: Technical timing and pinout specifications.
- “The Amiga Chipset”: A technical overview by the English Amiga Board. External Link
- “HAM Mode Explained”: A deep dive into the bitwise logic of Hold-And-Modify.