Squeezing Mushrooms into Bytes : Mario's NES Memory Magic
summary
NES games fit Super Mario Bros onto 32KB code + 8KB CHR by drawing 8x8 tiles from pattern tables (256 tiles per table), storing screens as 960 bytes of tile indices, compressing with meta‑tiles and run‑length repeats so the first level fits in ~1001 bytes; sprites are limited to 64 total and 8 per scanline causing per‑frame sprite rotation and visible flicker; Zelda adds battery‑backed RAM for saves. Quake III uses the 0x5f3759df constant and one Newton iteration for the fast inverse square root, trading tiny error (<0.1%) for ~4× speed.
AI-written summary · about
chapters (16)
- 0:00Introduction to NES constraints
- 2:10NES hardware limitations
- 3:53Pattern tables and tile rendering
- 5:40Storing level data efficiently
- 8:50Sprites and hardware limits
- 12:44Color and palette tricks
- 13:07Arithmetic on an 8-bit CPU
- 14:33Random number generation
- 17:27Saving game state on NES
- 22:08From 2D to 3D with Quake 3
- 23:11Vector normalization in Quake
- 28:19Fast inverse square root
- 36:55Quake's math behind the magic
- 37:18Reflections on past challenges
- 38:43Bonus: Duck Hunt hardware tricks
- 40:53Q&A and closing








