Backgrounds: Difference between revisions
Rainwarrior (talk | contribs) (stubbing this article) |
Rainwarrior (talk | contribs) (properties, modes 1-4...) |
||
Line 34: | Line 34: | ||
== Properties == | == Properties == | ||
Each of the 4 BG layers has several independent properties: | |||
* [[Tilemap]] VRAM address: [[PPU registers#BGnSC|BGnSC]] | |||
* [[Tile]]set (CHR) VRAM address: [[PPU registers#BG12NBA|BG12NBA]], [[PPU registers#BG34NBA|BG34NBA]] | |||
* Multiple tilemaps in 1x1, 2x1, 1x2, 2x2 arrangements: [[PPU registers#BGnSC|BGnSC]] | |||
* Tile size of 8x8 (or 16x8) or 16x16: [[PPU registers#BGMODE|BGMODE]] | |||
* Scroll position: [[PPU registers#BGnHOFS|BGnHOFS]], [[PPU registers#BGnVOFS|BGnVOFS]] | |||
Each of the 4 BG layers can be independently activated for the main and sub-screen. | |||
* If [[color math]] is enabled, the main screen can be blended with the subscreen. | |||
* If high resolution is enabled ([[PPU registers#SETINI|SETINI]]) the main-screen appears on even columns, and the sub-screen appears on odd columns. | |||
* If neither color math nor high resolution is enabled, only the main screen is seen. | |||
The 4 BG layers and sprites (OBJ) are composited to make the main and sub-screens, layered according to their [[priority]] | |||
== Offset-per-tile == | == Offset-per-tile == | ||
See: [[Offset-per-tile]] | |||
== High resolution == | == High resolution == | ||
The high resolution bit in [[PPU registers#SETINI|SETINI]] | |||
[[#Mode 5|modes 5 and 6]] | |||
== Mode 0 == | == Mode 0 == | ||
The only mode which has 4 independent BG layers. Its drawback is that each layer is only 2bpp (4 color). | |||
Each of the 4 layers and choose one of 8 4-color palettes from a different subset of [[CGRAM]]: | |||
* BG0 at CGRAM 0 | |||
* BG1 at CGRAM 16 | |||
* BG2 at CGRAM 32 | |||
* BG3 at CGRAM 48 | |||
== Mode 1 == | == Mode 1 == | ||
The most commonly used mode, which has two main 4bpp (16 color) layers BG1 and BG2, and one auxiliar 2bpp (4 color) layer BG3. | |||
BG3 has an additional [[priority]] control in mode 1. Its priority bit in [[PPU registers#BGMODE|BGMODE]] allows it to be rendered either above or below BG1 and BG2. | |||
In many games, BG1 and BG2 are used for a colourful main background with parallax, and BG3 to overlay a HUD or text box. | |||
BG3 can also be useful for things like a blended cloud or fog in the foreground, or a third parallax layer in the deep background. (Super Metroid has many good examples.) | |||
== Mode 2 == | == Mode 2 == | ||
Has two 4bpp layers like mode 1, but BG3 is used to encode [[offset-per-tile]] for BG1 and BG2, instead of being a visible layer. | |||
== Mode 3 == | {{anchor|Mode 3|Mode 4}} | ||
== Mode 3 & 4 == | |||
Mode 3 has an 8bpp BG1 layer, allowing 256 color graphics. This can also be used as [[direct color]], bypassing the CGRAM palettes. | |||
Mode 3 also has a 4bpp (16 color) auxiliary layer BG2. | |||
Mode 4 instead has a 2bpp (2 color) auxiliary layer BG2, and BG3 is used to encode [[offset-per-tile]]. | |||
== Mode 6 == | {{anchor|Mode 5|Mode 6}} | ||
== Mode 5 & 6 == | |||
TODO | |||
== Mode 7 == | == Mode 7 == | ||
TODO |
Revision as of 18:39, 31 May 2022
The SNES backgrounds consist of one or more layers of tilemaps.
There are 8 available background modes, which can be changed at any time via BGMODE.
Each mode has 1-4 layers, consisting of tiles that are 2bpp (4-color), 4bpp (16-color), or 8bpp (256-color).
Mode | BG1 | BG2 | BG3 | BG4 | OPT | Hi-res |
---|---|---|---|---|---|---|
0 | 2 | 2 | 2 | 2 | ||
1 | 4 | 4 | 2 | |||
2 | 4 | 4 | ✔ | |||
3 | 8 | 4 | ||||
4 | 8 | 2 | ✔ | |||
5 | 4 | 2 | ✔ | |||
6 | 4 | ✔ | ✔ | |||
7 | 8 | (7) |
Properties
Each of the 4 BG layers has several independent properties:
- Tilemap VRAM address: BGnSC
- Tileset (CHR) VRAM address: BG12NBA, BG34NBA
- Multiple tilemaps in 1x1, 2x1, 1x2, 2x2 arrangements: BGnSC
- Tile size of 8x8 (or 16x8) or 16x16: BGMODE
- Scroll position: BGnHOFS, BGnVOFS
Each of the 4 BG layers can be independently activated for the main and sub-screen.
- If color math is enabled, the main screen can be blended with the subscreen.
- If high resolution is enabled (SETINI) the main-screen appears on even columns, and the sub-screen appears on odd columns.
- If neither color math nor high resolution is enabled, only the main screen is seen.
The 4 BG layers and sprites (OBJ) are composited to make the main and sub-screens, layered according to their priority
Offset-per-tile
See: Offset-per-tile
High resolution
The high resolution bit in SETINI
Mode 0
The only mode which has 4 independent BG layers. Its drawback is that each layer is only 2bpp (4 color).
Each of the 4 layers and choose one of 8 4-color palettes from a different subset of CGRAM:
- BG0 at CGRAM 0
- BG1 at CGRAM 16
- BG2 at CGRAM 32
- BG3 at CGRAM 48
Mode 1
The most commonly used mode, which has two main 4bpp (16 color) layers BG1 and BG2, and one auxiliar 2bpp (4 color) layer BG3.
BG3 has an additional priority control in mode 1. Its priority bit in BGMODE allows it to be rendered either above or below BG1 and BG2.
In many games, BG1 and BG2 are used for a colourful main background with parallax, and BG3 to overlay a HUD or text box.
BG3 can also be useful for things like a blended cloud or fog in the foreground, or a third parallax layer in the deep background. (Super Metroid has many good examples.)
Mode 2
Has two 4bpp layers like mode 1, but BG3 is used to encode offset-per-tile for BG1 and BG2, instead of being a visible layer.
Mode 3 & 4
Mode 3 has an 8bpp BG1 layer, allowing 256 color graphics. This can also be used as direct color, bypassing the CGRAM palettes.
Mode 3 also has a 4bpp (16 color) auxiliary layer BG2.
Mode 4 instead has a 2bpp (2 color) auxiliary layer BG2, and BG3 is used to encode offset-per-tile.
Mode 5 & 6
TODO
Mode 7
TODO