Nintendo Entertainment System
Production-ready patterns for Nintendo Entertainment System development
Rendering
5 patternsFeeding New Columns
As the NES scrolls sideways, write a fresh column of tiles into the offscreen nametable each time the view crosses a tile boundary — so a level far wider than two screens rolls past seamlessly.
Multi-Sprite OAM Update
Manage multiple sprites in the OAM buffer. Update positions, hide unused sprites, and DMA transfer efficiently.
Nametables and Scrolling
Position the NES's 256×240 viewport inside the larger tile map by setting the nametable-select bits and the fine scroll every vblank — the foundation of every scrolling NES game.
Palette Loading
Load colour palettes into PPU memory at $3F00. Required setup for any NES graphics.
Sprite 0 Split
Keep a status bar fixed at the top of the screen while the playfield below scrolls — by placing sprite 0 at the boundary and changing the scroll the instant its hit flag fires. The NES's answer to the mid-screen split.
Input
1 patternAudio
3 patternsA Music Engine
Step a note pattern once per frame from the NMI, handing each APU channel its note from a timer table — the skeleton of every NES music driver.
A Square Wave
Enable one of the NES APU's pulse channels, set its duty, volume and 11-bit timer, and it holds a tone on its own — the foundation of every NES sound.
Sound Effects
Let the APU bend pitch and fade volume in hardware — a swept pulse for a laser, a decaying noise burst for an explosion — each fired with a single trigger write.