Description of PPU Concepts
Super PPU
Super "Picture P rocessing U nit" is a video controller chip that processes tile graphics, scrolling planes and SNES sprites. The function is similar to the PPU of the NES console.
VRAM
V ideo RAM - RAM used by Super PPU. Contains tiles. Each screen mode uses its own tile size. This is usually 8x8 or 16x16 pixels per tile. VRAM has a capacity of 64 KB.
Oam
"Object Attribute Memory" - contains the data definitions of sprites. May contain data of no more than 128 sprites. Similar to OAM in NES, but more advanced.
OAM data stored for each sprite
- X sprite position (9 bits, 0-511 or $ 00- $ 1FF)
- The sprite position in Y (8 bits, 0-239 or $ 00- $ EF). Values 0-239 are on the screen, from -63 to -1 - "above the screen", so the bottom of the sprite is visible on top of the screen. This implies that a very large sprite can start at the bottom and end at the top.
- ID of the first sprite tile. 8-bit index
- Sprite Name Table
- The ID of the palette used by the sprite (0-7 / $ 00- $ 07). Sprites use sub-palette indices in the last 8 sub-palettes, so the ID is actually 7 + N
- The size of the sprite. 1 bit: 0 = a smaller sprite is available for the current mode (usually 1 tile 16x16 pixels), 1 = a larger sprite is available for the current mode (usually 4 tiles (2x2 tiles 16x16 pixels))
- Sprite priority Priority in OAM: 2 bits; these bits determine the priority of the sprite relative to the background planes (see the section on graphics planes below). Priority over other sprites. Zero sprite in OAM has the highest priority. The first sprite in OAM has a lower priority. The second is even lower, and so on.
OAM Viewer emulator No $ sns (SMW)
Two main types of machines
NTSC Consoles
- Super Nintendo (SNES), 60 Hertz machines, mostly sold in the USA. Screen resolution 256x224 pixels (like NTSC NES)
PAL Consoles
- Super Famicom (SFC), 50 hertz cars sold all over the rest of the world. Screen resolution 256x240 pixels (like PAL Famicom)
Left: NTSC Super Nintendo (Model 1), right: PAL Super Famicom
Tile cards
SNES had 7 different "modes" of background processing
- They were called Mode 0-7. Mode 1 had a variation mode. Mode 7 had a submode of Mode 7 Ext. BG Each mode had its own number of available background planes. Each mode had its own number of colors for the background planes available in this mode. The rendering properties of each background were slightly different. In all modes and in all planes of the graphic, the color index 0 in any sub-palette always denoted a transparent color.
Summary table of modes
4 plane graphics
SNES could process up to 4 graphics planes, called BG1-BG4. These graphics planes could scroll (scroll).
Tile Card Sizes
- Tiling maps of scrolling planes could have a size of 32x32, 32x64, 64x32 or 64x64 tiles. Depending on the size of each block of the tile card (blocks of 16x16 px / 1 tile or 32x32 / 2x2 tiles), the size of the tile card could vary from 256x256 to 1024x1024 pixels
- For more information on tile sizes in tile maps, see the “Tile Maps & Character Maps” section of this article.
Properties of each tile in the tile map
- V / HFlip tiles (vertical / horizontal reflection)
- Tile Priority (Low / High)
- Palette number (3 bits, 0-7 / $ 00- $ 07). Planes use the first 8 sub-palettes of CGRAM; second 8 sub-palettes are used for sprites (OAM)
- Tile ID
Tilemap viewer for 4 backgrounds (BG) in SWM
Video modes
Mode 0
- 4 backgrounds (BG), each with 4 colors
- Priority BG (front to back)
Mode 1
- 2 BG with 16 colors
- 1 BG with 4 colors
- Priority BG (front to back). The priority varies depending on the state of bit 3 in the register $ 2105.
Mode 2
- 2 BG with 16 colors each
- Priority BG (front to back)
- The first mode with "offset by tile" (for more details, see Mode 2 )
Mode 3
- 1 BG with 256 colors
- 1 BG with 16 colors
- Priority BG (front to back)
- Available Direct Color Mode (register $ 2130)
Mode 4
- 1 BG with 256 colors
- 1 BG with 4 colors
- Priority BG (front to back)
- The second mode with "offset by tile" (for more details, see Mode 4 )
Mode 5
- 1 BG with 16 colors
- 1 BG with 4 colors
- Priority BG (front to back)
- “Mode 5 is different from previous modes. Instead of a standard tile with a width of 8/16 pixels, it always uses a tile with a width of 16 pixels (the height can still be 8 or 16) and uses only half the pixels (starting from zero, even pixels for sub-screen tiles, odd pixels for main screen tiles). Then it switches to pseudo-hires to render a 512-pixel wide raster line. In addition, if Interlace mode is on (see bit 0 in register $ 2133), then the screen height instead of 224 or 239 is 448 or 478 half-lines. Either even or odd lines are drawn in each frame, which is determined by bit 7 in the $ 213f register. It also means that $ 212c and $ 212d can be assigned the same value to get the “expected” display. ”
Mode 6
- 1 BG with 16 colors
- Priority BG (front to back)
- Special properties: like Mode 5, it has certain differences. Like Mode 2, it is also a shift to tile mode. “However, it is worth remembering that Mode 6 always uses tiles with a width of 8 pixels (16 half-pixels), which applies to BG3, as well as to BG1. "You cannot apply an offset to a tile of 8 half-pixels or to an area 16 pixels wide (only if you do not use two offset values for two 8-pixel areas)."
Mode 7
- 1 BG with 256 colors
- A very different mode; allows matrix transformations of the BG layer
- Used for pseudo-3D effect in games like Super Mario Kart, FZero, etc.
- See Mode 7 for more details.
Cgram
"Color Graphics RAM"
- Contains color information for palettes
- In total, it contains 256 ($ FF) palette color entries.
- Each graphics mode divides 256 palette entries into sub-palettes, each with N colors. N depends on the video mode. By default, each sub-palette consists of 16 colors (256 colors / 16 colors per sub-palette = 16 sub-palettes). By default, the first 8 sub-palettes (with ID 0-7 / $ 00- $ 07, palette entry IDs 0-63 / $ 00- $ 3F) are used for foreground tiles (FG), and the last 8 sub-palettes (sub-palette IDs 8-16 / $ 08- $ 10, records ID palettes 64-127 or $ 40- $ 80) - for sprite objects. The first color in the sub-palette is rendered transparent for tiles / sprites using this sub-palette
- 15-bit BGR color format. Each color entry in CGRAM has a format of 2 bytes (“word”) and the form 0BBBBBGG GGGRRRRR (B = bits of blue, G = bits of green, R = bits of red). 16 bits, the first bit is not used, so a 15-bit color range remains. Each color component (B, G, R) has a value in the range 0-31 (decimal) or $ 00- $ 1F (hexadecimal)
Breakdown of the SNES palette (Super Mario World in Palette viewer emulator no $ sns)
Recommended Debugging and Graphics Tools
Finding good software to create retro graphics, split pixel art into tiles, and reduce the number of colors to process in various SNES video modes can be difficult. Below is a list of recommended software for working with retro graphics and specialized emulators that allow you to explore the contents of VRAM and the plane.
Graphics software:
Yy-chr
- Multi-platform tile editor
- New version in C #
- Old C ++ Version
Irfanview
- The program for viewing / editing for general purposes, has plugins and broad support for many file types
- Can edit, export and import palettes, as well as increase / decrease the number of colors in images and display this number
- Free and open source software
- Has a PNG plugin for changing color depth changes while preserving the palette order
- Homepage
Recommended specialized emulators for debugging Super PPU
No $ sns
- Debug SNES emulator
- Can emulate SNES-CD Super Disc homebrew prototypes
- Can display machine / CPU status
- Displays BG layers on the fly
- Can display on the fly OAM
- Can display the contents of VRAM tiles in various color modes
- Can display CGRAM content
- Information
Higan
- Emulator of various retro consoles
- Has a very accurate emulation of SNES equipment cycles ; used to emulate / debug SNES hardware issues
- Information