Name Tables

From NerdConsole
Jump to navigationJump to search

Name Tables describe the background layer for a game. You can think of this as the play field or the map of the game. NerdConsole has 2 Name Table areas. The main name table represents a 2x2 screen area as a single large area in memory. The fixed name table is an additional 1x1 screen area used for fixed regions of the screen. The individual entries in the name tables are the same regardless of which name table they are used in. Additionally, there are 4 backgrounds worth of main name tables that represent background layers that are rendered behind each other to allow interesting graphical effects. These also use the same name table format.

Name Table Format - Tile Mode

Bit 7 6 5 4 3 2 1 0
Byte 0 M F T C p p p p
Byte 1 i i i i i i i i

Key

  • M - Mirror (Left/Right)
  • F - Flip (Top/Bottom)
  • T - Force Non-Transparent (color 0 is color not transparency indicator)
  • C - Color Cycling
  • p - Sub-Palette Index
  • i - Tile Table Index

Name Table Format - Text Format

Name Tables support a "Text Mode" that still uses a 2-byte structure but that trades the attributes for foreground and background color information. These always refer to palette 0.

Bit 7 6 5 4 3 2 1 0
Byte 0 f f f f b b b b
Byte 1 i i i i i i i i

Key

  • f - Foreground Color
  • b - Background Color
  • i - Tile Table Index