Add Copper ISA Complete Reference Manual

New file: 08_graphics/copper/copper_reference.md
- Full instruction set reference with opcode encoding table
- Bit-level encoding for MOVE, WAIT, SKIP (7-bit masks)
- Beam position encoding: V counter (8-bit), H counter (7-bit)
- Copper control registers (COP1LC, COP2LC, COPJMP, COPCON, DMACON)
- Copper list structure, dual lists, SKIP-based double buffering
- DMA timing budget calculations per scanline
- Register reference for all copper-writable targets
- OCS/ECS/AGA differences (AGA 24-bit color via BPLCON3 LOCT)
- Programming models: bare metal, OS-friendly UCopList, self-modifying
- Common patterns: rainbow, split screen, status bar, sprite mux
- Debugging: 8 common pitfalls with symptoms and fixes
- Mermaid fetch-execute cycle diagram

Updated files:
- 08_graphics/README.md: add copper_reference.md to index
- 08_graphics/copper/copper.md: cross-reference link, fix MOVE/WAIT
  encoding, fix UCopList CMOVE syntax
- 08_graphics/copper/copper_programming.md: cross-reference link, fix
  horizontal resolution (2 color clocks, not 4)
This commit is contained in:
Ilia Sharin 2026-06-01 14:39:43 -04:00
parent a0fc3e05db
commit 2283178f09
4 changed files with 1031 additions and 10 deletions

View file

@ -61,7 +61,7 @@ graph LR
| No branching/loops | Executes linearly top-to-bottom; no jumps or calls |
| No memory read | Can only WRITE to registers — cannot read anything |
| No CPU memory access | Writes only to custom chip registers (`$DFF000`+), not RAM or CIA |
| No sub-pixel timing | Horizontal resolution: 4 color clocks (~8 low-res pixels) |
| No sub-pixel timing | Horizontal resolution: 2 color clocks (~4 low-res pixels) |
| V counter wraps at 255 | PAL lines 256311 require a double-WAIT trick |
| Chip RAM only | The copper list itself must reside in Chip RAM (DMA-accessible) |
@ -82,7 +82,7 @@ The Copper has exactly **3 instructions**, each 32 bits (2 words):
### MOVE — Write to Register
```
Word 1: RRRRRRRR R0000000 R = register address (9 bits)
Word 1: 0000000R RRRRRRR0 R = register offset (bits 8-1)
Word 2: DDDDDDDD DDDDDDDD D = 16-bit data value
Constraints:
@ -275,8 +275,8 @@ FreeCopList(ucl);
| Item | Cycles |
|---|---|
| Each Copper instruction | 4 color clocks (= 8 low-res pixels) |
| WAIT resolution (horizontal) | 4 color clocks minimum |
| Each Copper instruction | 2 color clocks (= 4 low-res pixels) |
| WAIT resolution (horizontal) | 2 color clocks minimum |
| Maximum instructions per line | ~112 (NTSC) / ~114 (PAL) |
| PAL visible lines | 256 (lines 44300) |
| NTSC visible lines | 200 (lines 44244) |
@ -315,6 +315,7 @@ Reposition sprites mid-frame to display more than 8 sprites:
## References
- HRM: *Copper* chapter — complete instruction encoding
- **[copper_reference.md](copper_reference.md)** — Copper ISA Complete Reference Manual (full encoding, control registers, timing, register map, debugging)
- [copper.md](../../01_hardware/ocs_a500/copper.md) — register-level reference
- [copper.md](copper.md) — graphics.library UCopList API
- [Video Signal & Timing](../../01_hardware/common/video_timing.md) — beam counters, scanline anatomy, clock tree