-
Notifications
You must be signed in to change notification settings - Fork 3
Background
The Super Nintendo supports up to 4 background layers. The actual number of available background layers depends on the selected background mode, ranging from mode 0 through mode 7. The background mode also determines the number of available colors for each individual background layer. The background mode is set in the lower 3 bits of BGMODE.
Each background layer is made up of a set of tiles organized into one or more two-dimensional (32×32) tilemaps. All tiles for a background layer are either 8×8 (default) or 16×16 pixels. The tilesize for background layer 1, 2, 3 or 4 is set by bit 4, 5, 6 or 7 respectively of BGMODE.
An individual background layer can be set to one of 4 possible dimensions: 32×32, 64×32, 32×64 or 64×64 tiles. The dimensions for each background layer are set in the lower 2 bits of its corresponding screen configuration (BG1SC, BG2SC, BG3SC and BG4SC).
The overall size in pixels of a background layer is thus determined by its tile size and dimension settings, and varies between 256×256 and 1024×1024 pixels.
Bits 2-6 of a background layer's screen configuration refer to the VRAM segment where the background layer's (first) tilemap is stored. This 5-bit value is shifted left by 10 to obtain the address of the (first) tilemap in VRAM.
Each background layer can be enabled or disabled using corresponding bit (0-3) in TM.
See also: [Tiles.md]