Noel Berry

Noel Berry

Sometimes, when I'm in the right mood, I make video games and art. Or something.

NES Limitations

NES Limitations Postcard Image
Moved from an old blog

I've been experimenting with making a small game using NES graphical limitations, having been inspired by replaying a bunch of Zelda 1 and Zelda 2. I needed a place to write them all down, and so here they are:

  • 256 x 224 px screen size. Technically 256 x 240, but the top and bottom 8px are cropped
  • Composed of 2 layers: Background Tiles and Sprites
  • Access to 2 sets of 256, 8 x 8 tiles (so 2 textures of 128 x 128px). Usually one is used for Background Tiles, and one is used for Sprites.
  • Refresh rate of 60 Hz
Palettes / Colors
  • The NES has access to 64 different colors that can be used throughout the game
  • A total of 8 palettes can be used at once
  • 4 palettes are used for the Background Tiles. Each palette is composed of 3 colors, plus a common single background color shared between all 4 palettes
  • 4 palettes are used for the Sprites. Each palette is composed of 3 colors, plus transparency
  • Total Colors onscreen: 25 (4 palettes x 3 colors = 12 for sprites, 4 palettes x 3 colors = 12 for background tiles, 1 for background)
  • Palettes can be swapped on the fly (many games use this for cool fade in/out effects, etc)
Background Tiles
  • 8 x 8 pixels in size
  • Snapped to an 8 x 8 grid (can't move freely, basically)
  • Every tile can only use 1 palette
  • Every block of 2 x 2 tiles must use the same palette. For example, tiles (0,0), (1, 0), (0, 1), (1, 1) must share the same palette
  • The NES has access to 256 individual tiles at a time
    (think of a texture that is 128 x 128, split into 8 x 8 tiles)
  • Background tiles can not be flipped, rotated, or scaled
  • Sprites can move around and are not snapped to the grid
  • There are 2 Sprite Modes: 8 x 8 or 8 x 16. Your game may only use 1 mode.
  • The game has access to 256 sprites (think of a texture that is 128 x 128, split into 8 x 8 tiles)
  • Note on 8 x 16 Mode
    In 8 x 16 Sprite mode, the game only has access to 128 sprites (the size of the sprite texture does not change). Every second tile in the texture is used along with the first one, 8px below it.
    For example, if you draw Sprite[0], it will draw Sprite[0] and also draw Sprite[1] 8 pixels below it. You MUST only draw even sprites (so Sprite[0]+Sprite[1], never Sprite[1]+Sprite[2])
    Example Image
  • Each sprite can only use 1 palette (but you can overlap multiple sprites with transparency, ex. Megaman)
  • You can only have 64 sprites on the screen at once
  • You can only have 8 sprites per scaleline at once. What this means is that if more than 8 sprites are drawn on a horizontal line of pixels across the screen (a scanline), only 8 can be visible. Transparent pixels count.
  • Sprites can be flipped horizontally and/or vertically, but can not be rotated or scaled
Things this doesn't cover
  • Memory. The NES has relatively limited memory and how things moved, saved, etc were heavily influenced by that.
  • "Hacks" that programmers could do, like swapping pixels mid-render
  • Probably a bunch of other small stuff
Cool links If I missed anything (or something is wrong) let me know!