Super Nintendo Graphics Guide

Super Nintendo
Super PPU Graphics Guide
v0.1 (10/09/17)
Mega Cat Studios

  

OVERVIEW OF PPU CONCEPTS


  • Super PPU
        • Super "Picture Processing Unit"
        • Video controller chip that handles the SNES' tile graphics, scroll planes, and sprites.
        • Similar in function to PPU in NES, but super

      • VRAM
        • "Video RAM"
        • RAM used by the Super PPU
        • Holds tiles
          • Each screen mode uses a different tile size for tiles
          • Sizes usually 8x8 px or 16x16 px per tile
        • 64 KB of VRAM

      • OAM
    • "Object Attribute Memory"
        • Holds sprite definition data
        • Can hold data up to a maximum of 128 sprites
        • Similar to OAM in NES, but super

        • OAM data held for each sprite
          • x position of the sprite
            • (9-bit, 0-511 or $00-$1FF)
          • y position of the sprite
            • (8-bit, 0-239 or $00-$EF)
            • "Values 0-239 are on-screen. -63 through -1 are "off the top", so the bottom part of the sprite comes in at the top of the screen. Note that this implies a really big sprite can go off the bottom and come back in the top."

          • First tile ID of sprite
            • 8-bit index

          • Nametable of sprite

          • Palette ID used by sprite
            • (0-7/$00-$07)
            • Recall sprites use subpalette indices in latter 8 subpaletes, so actually ID used is 7+N)

          • Sprite Size
            • 1-bit
            • 0=smaller sprite size available for mode (usually 1 tiles of 16x16px)
            • 1=larger sprite size available for mode (usually 4 tiles (2x2 16x16 px tile))

          • Sprite Priority
            • OAM priority
              • 2-bit
              • These bits determine sprite's priority wrt to the background plans (see graphics plane section below)
            • Priority wrt to other sprites
              • 0th sprite in OAM has the highest priority
              • 1st sprite in OAM has lower priority
              • 2nd sprite in OAM has even lower priority, etc.
      OAM Viewer in No$sns (SMW)

       

      Two main machine types

    • NTSC machines
          • "Super Nintendo (SNES)", 60Hz machines, primarily found in US
          • Screen resolution of 256x224 px (just like NTSC NES)
          • Mega Cat games are NTSC releases, so use these resolutions!

    • PAL machines
        • "Super Famicom (SFC)", 50Hz machines, everywhere else
        • Screen resolution of 256x240 px (just like PAL Famicom)
      Left: NTSC Super Nintendo (Model 1)
      Right: PAL Super Famicom

       

      Tilemaps

      • SNES has 7 different "modes" for how to handle the background
        • Named Mode 0-7
        • Mode 1 has a variation mode
        • Mode 7 has a submode called Mode 7 Ext. BG
        • Each mode has a different amount of background planes available
        • Each mode has a different amount of colors for the available background planes for that mode
        • Each mode has slightly different rendering properties
        • For all modes and for all graphics planes, color index 0 for any subpalette is the transparency color.
      Mode summary table
      • 4 graphics planes
        • The SNES can handle up to 4 graphics planes, named BG1-BG4
        • These graphic planes can be scrolled as necessary
        • Tilemap sizes
          • The tilemap sizes of the scroll planes can be either 32x32 tiles, 32x64, 64x32, or 64x64 tiles.
          • Depending on the size of each block in the tilemap (Blocks of 16x16 px/1 tile, or blocks of 32x32px/2x2 tiles), the tilemap size can range from 256x256px to 1024x1024px
          • See "Tile Maps & Character Maps" from here for more info on tile sizes in tilemaps
        • Properties of each tile in a tilemap
          • V/HFlip of tile
          • Tile priority (low/high)
          • Palette number
            • (3-bit, 0-7/$00-$07)
            • Recall that planes use the 1st 8 subpalettes of CGRAM; the 2nd 8 is used for sprites (OAM)
          • Tile ID
      Tilemap viewer for the 4 BGs in SWM

       

    • Video modes
    • Mode 0
            • 4 BGs each with 4 colors
            • BG Priority (from front to back)


    • Mode 1
          • 2 BGs of 16 colors
          • 1 BG of 4 colors
          • BG Priority (front to back)
            • Priority varies depending upon the setting of bit 3 of $2105


    • Mode 2
              • 2 BGs with 16 colors each
              • BG Priority (front to back)
              • 1st "offset-per-tile" mode (read Mode 2 here for more info)
      • Mode 3
              • 1 BG with 256 colors
              • 1 BG with 16 colors
              • BG Priority (from front to back)
                • Direct Color Mode available (register $2130)
      • Mode 4
            • 1 BG with 256 Colors
            • 1 BG with 4 colors
            • BG Priority (from front to back)
              • 2nd "offset-per-tile" mode (read Mode 4 here for more info)
      • Mode 5
              • 1 BG with 16 colors
              • 1 BG with 4 colors
              • BG Priority (from front to back)
              • Is different from the other modes
                • "Mode 5 is rather different from the previous modes. Instead of using an 8/16 pixel wide tile as normal, it always takes a 16 pixel wide tile (the height may still be 8 or 16) and only uses half the pixels (zero-based, the even pixels for subscreen tiles and the odd pixels for mainscreen tiles). Then it forces pseudo-hires on to render a 512-pixel wide scanline. Also, if Interlace mode is on (see bit 0 of $2133), the screen is 448 or 478 half-lines high instead of 224 or 239. Either the odd half-lines or the even half-lines are drawn each frame, as indicated by bit 7 of $213f. Note that this means you must set $212c and $212d to the same value to get the ‘expected’ display."
      • Mode 6
            • 1 BG with 16 colors
            • BG Priority (from front to back)
            • Special properties
              • Has same oddities as Mode 5
              • Is also an offset-per-tile mode
                • Like with Mode 2
                • "However, remember that Mode 6 always uses 8 pixel (16 half-pixel) wide tiles, this applies to BG3 as well as BG1. You can’t apply the offset to an 8-half-pixel tile nor to a 16-pixel wide area (except by using two offset values for the two 8-pixel areas)."
      • Mode 7
            • 1 BG of 256 colors
            • Very special mode; allows for matrix transformations of BG layer
            • Used for the pseudo-3D effects in games such as Super Mario Kart, FZero, etc
            • Read Mode 7 for full details

         


        CGRAM

      • "Color Graphics RAM"
        • Holds color information for palettes
        • Holds total of 256 ($FF) color palette entries.
        • Each graphics mode divides the 256 palette entries into subpalettes, each with N colors
          • "N" depends on the video mode
          • By default, each subpalette is 16 color entries (256 colors/16 color for subpalette = 16 subpalettes)
          • By default, the first 8 subpalettes (subpalette IDs 0-7/$00-$07, palette entry IDs 0-63/$00-$3F) are used for FG tiles, while the last 8 subpalettes (subpalette IDs 8-16/$08-$10, palette entry IDs 64-127 or $40-$80) are for Sprite objects
          • First color entry in a subpalette will be rendered transparent for tiles/sprite tiles that use the subpalette

        • 15-bit BGR color format
          • Each color entry in CGRAM is in format of 2 bytes (a "word") of format 0BBBBBGG GGGRRRRR (B=Blue bits, G=Green bits, R=Red bits)
          • 16-bit, 1st bit is unused, so 15-bit color range
          • Each color component (B, G, R) ranges from values of 0-31 (decimal) or $00-$1F (hexadecimal)
        Palette breakdown for SNES
        (Super Mario World, in no$sns emulator Palette viewer)

         

        RECOMMENDED DEBUGGING AND ART TOOLS

        Finding good software for creating retro graphics, quantizing pixel art into tiles, and reducing the color count to handle the SNES various video modes can be difficult. Below are a list of recommended art software to deal with retro graphics, and specialized emulators that allow the user to look at VRAM contents and planes

        Art software:

        • YY-CHR
        • Irfanview
          • Generic image viewer/editor, with plugins and very large support for many image file types
          • Can edit, export, and import palettes, as well as increase/decrease the color count of images, and view color count
          • FOSS software
          • Has PNG plugin in order to change color depth while preserving palette order
          • Info links

        Recommended specialty emulators for Super PPU debugging

      • No$sns
          • Debugger-oriented SNES emulator
          • Can emulate SNES-CD Super Disc prototype homebrew
          • Can view machine/CPU state
          • Can view BG layers on- the-fly
          • Can view OAM on-the-fly
          • Can view VRAM tile contents in various color modes
          • Can view CGRAM contents
          • Info

        • Higan
          • Emulator emulating various retro consoles
          • Has very accurate, cycle-accurate emulation of SNES hardware; should be used for emulating/debugging SNES hardware issues
          • Info

         

        REFERENCES/FOR FURTHER READING

        retro game snes snes graphics snes graphics explanation snes graphics guide snes guide for artists super nintendo super nintendo graphics super nintendo graphics explanation super nintendo graphics guide super nintendo guide for artists

        ← Older Post Newer Post →