From 2eb8321d00ba62eec8f54953a5011c87eb87f94c Mon Sep 17 00:00:00 2001 From: Ilia Sharin Date: Sat, 25 Apr 2026 14:58:33 -0400 Subject: [PATCH] Minor fixes in layout and indexing --- 08_graphics/README.md | 1 - 08_graphics/pixel_conversion.md | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/08_graphics/README.md b/08_graphics/README.md index 4ea919e..2df202d 100644 --- a/08_graphics/README.md +++ b/08_graphics/README.md @@ -21,4 +21,3 @@ The Amiga graphics system is built on custom DMA-driven hardware (Agnus/Alice + | [views.md](views.md) | View, ViewPort, MakeVPort, display construction | | [text_fonts.md](text_fonts.md) | TextFont bitmap layout, baseline rendering, algorithmic styles, AvailFonts enumeration | | [animation.md](animation.md) | GEL system deep dive: BOBs, VSprites, AnimObs, hardware foundation (Blitter/Copper/Sprite interaction), collision detection, double buffering, performance tuning | -| [pixel_conversion.md](pixel_conversion.md) | Chunky↔Planar conversion: butterfly algorithm, Akiko C2P, Blitter-assisted, RTG bypass; SoA/AoS parallels to GPU/SIMD | diff --git a/08_graphics/pixel_conversion.md b/08_graphics/pixel_conversion.md index a2526ad..3e95cb8 100644 --- a/08_graphics/pixel_conversion.md +++ b/08_graphics/pixel_conversion.md @@ -71,14 +71,14 @@ The downside only became critical as rendering algorithms evolved past 2D sprite C2P is a **bit matrix transposition**. Given 32 chunky pixels (each 8 bits wide), you have a 32×8 bit matrix (32 rows × 8 columns). C2P transposes this to an 8×32 matrix (8 bitplanes × 32 bits each): ``` -Input (chunky): Output (planar): - 32 pixels × 8 bits 8 bitplanes × 32 bits - ┌─────────────────┐ ┌──────────────────────────────┐ - │ P0: b7 b6 b5 b4 b3 b2 b1 b0 │ │ Plane 0: p0.b0 p1.b0 p2.b0 ... p31.b0 │ - │ P1: b7 b6 b5 b4 b3 b2 b1 b0 │ │ Plane 1: p0.b1 p1.b1 p2.b1 ... p31.b1 │ - │ ... │ │ ... │ - │ P31: b7 b6 b5 b4 b3 b2 b1 b0 │ │ Plane 7: p0.b7 p1.b7 p2.b7 ... p31.b7 │ - └─────────────────┘ └──────────────────────────────┘ + Input (chunky): Output (planar): + 32 pixels × 8 bits 8 bitplanes × 32 bits + ┌──────────────────────────────┐ ┌────────────────────────────────────────┐ + │ P0: b7 b6 b5 b4 b3 b2 b1 b0 │ │ Plane 0: p0.b0 p1.b0 p2.b0 ... p31.b0 │ + │ P1: b7 b6 b5 b4 b3 b2 b1 b0 │ │ Plane 1: p0.b1 p1.b1 p2.b1 ... p31.b1 │ + │ ... │ │ ... │ + │ P31: b7 b6 b5 b4 b3 b2 b1 b0 │ │ Plane 7: p0.b7 p1.b7 p2.b7 ... p31.b7 │ + └──────────────────────────────┘ └────────────────────────────────────────┘ ``` This is equivalent to a 90° bit rotation. On a modern CPU with SIMD, this is trivial. On a 68020 with 8 data registers and no bit-parallel instructions, it is an algorithmic challenge that consumed thousands of programmer-hours across the demoscene.