# Denise: bitplanes, playfields, sprites, priority, collisions Denise (OCS 8362; ECS "HighRes" 8373; AGA Lisa) turns the words Agnus fetches into pixels. It never touches memory: Agnus writes BPLxDAT and SPRxDATA/DATB into it on the DMA slots, the CPU or Copper writes its other registers, and the CPU reads two things back (CLXDAT, and on ECS DENISEID). Facts from HRM3 (tier 2), PDF pages; chapter 3 (playfields) pdf~45-110, chapter 4 (sprites) pdf~111-145, chapter 7 (priority, collisions) pdf~205-230. ## Pixels - Lores: 320 pixels across a normal display, one pixel per 7M clock (two per CCK); hires: 640, two per 7M clock; ECS super-hires (35 ns): four per 7M clock (HRM3 appendix C; ECS row). - Bitplanes: up to 6 lores (5 normal + HAM or EHB with 6), up to 4 hires (HRM3 chapter 3). Each plane's word is loaded into a shift register when plane 1's word arrives (BPL1DAT is the trigger): "display processing does not begin until all of the bit-planes for a particular pixel have been fetched" (pdf210). The exact pipeline delay from BPL1DAT's slot to the first pixel, and how it shifts with BPLCON1's scroll, is U11. - Modes: single playfield (2-32 colours from COLOR00-31); dual playfield (odd planes to playfield 1, even planes to playfield 2, PF2PRI in BPLCON2 bit 6 picks which is in front, pdf83-87; BPL1MOD/BPL2MOD per playfield, pdf77, pdf106); **HAM** (hold and modify: 4,096 colours, pdf18 and chapter 3); **EHB** (extra half-brite: plane 6 halves the colour; OCS A1000 Denise revisions may lack it: U12). - Display window: DIWSTRT/DIWSTOP (OCS: the stop's high bits are implied; ECS adds DIWHIGH). The window gates what is shown; data fetch is Agnus's DDFSTRT/STOP. The window's behaviour when set outside the normal ranges is U13 (vAmigaTS Denise/DIW). - Colour registers: 32 x 12 bits (COLOR00-31, DFF180-1BE); AGA has 256 x 24 bits through banking (AGA row). ## Sprites - Eight sprites, 16 lores pixels wide, 3 colours plus transparent each, paired for colour registers (0/1 use COLOR17-19, ...); **attached** pairs (bit 7 of the odd sprite's second control word) give 15 colours (pdf137, pdf143). - Each sprite's DMA fetches two words a line in its slots (agnus.md); the control words SPRxPOS/SPRxCTL set the start and stop lines and the horizontal start at lores-pixel resolution (OCS); a wide or early display steals the slots of the higher sprites (pdf212). - Sprites are re-usable down the screen (a new control pair after the stop line), and the CPU or Copper may write SPRxDATA/DATB directly ("manual" sprites). - Arming: writing SPRxDATA arms the sprite, writing SPRxCTL disarms it; the exact rule used by Denise's comparators, and what happens when a sprite's horizontal start lies in the blank, is U14. ## Priority BPLCON2 sets where each sprite pair sits relative to the two playfields (PF1P2-0, PF2P2-0) and PF2PRI between the playfields (HRM3 pdf225-227, tables 7-1, 7-2, figure 7-3). Sprites have fixed priority among themselves: lower number in front. ## Collisions CLXDAT (read, cleared by reading) reports 15 collision pairs among sprite pairs and the two playfields; CLXCON selects which bitplanes and which odd sprites take part and the bitplane match values (HRM3 tables 7-3 and 7-4, pdf229-230). Collisions are detected in the pixel pipeline, including outside the display window? (U15: whether collisions are counted in the border and in the blank, and how attached and disabled sprites count; vAmigaTS Denise/Sprites decides). **Why collisions matter for the domain split:** CLXDAT is the only register through which the CPU sees Denise's pixel pipeline. A picture producer running beside the main domain (domains-and-speed.md) must therefore make every CLXDAT read a sync point, or compute collisions in the main domain. ## Revisions (machine rows) | Denise | Machines | Differences (HRM3 pdf314; appendix C) | | --- | --- | --- | | 8362 (OCS) | A1000, A500, A2000 | DENISEID not implemented (reads open-bus or the last value: U16) | | 8373 (ECS HighRes) | A500+, A600, A3000, late A2000 | DENISEID returns `$FC` in the low 8 bits; super-hires, productivity modes, programmable border blank (BPLCON3) | | Lisa (AGA) | A1200, A4000, CD32 | 8 planes, 256 colours of 24 bits, 64-pixel sprites, fetch modes (AGA row) |