Code: Select all
dynamic sprite sizes:
Since the SNES can only choose between 2 sprite sizes at one time, there is a compromise between screen coverage and flickering. Bigger sprite sizes allow covering more of the screen, but small sprites are less prone to flickering when too many of them are on the same scanline. In this document, we will only discuss 8x8, 16x16 and 32x32 sprites.
small large
mode A: 8x8 16x16
mode B: 8x8 32x32
mode C: 16x16 32x32
These are all the configurations for each "sprite" size in each mode:
mode A:
8x8 1 8x8
16x8 2 8x8s or 1 16x16
8x16 2 8x8s or 1 16x16
16x16 1 16x16
24x24 1 16x16 and 5 8x8s, or 2 16x16s and 2 8x8s
32x24 2 16x16s and 4 8x8s, or 3 16x16s and 2 8x8s, or 4 16x16s
24x32 2 16x16s and 4 8x8s, or 3 16x16s and 2 8x8s, or 4 16x16s
32x32 4 16x16
mode B:
8x8 1 8x8
16x8 2 8x8s
8x16 2 8x8s
16x16 4 8x8s
24x24 9 8x8s or 1 32x32
32x24 12 8x8s or 1 32x32
24x32 12 8x8s or 1 32x32
32x32 1 32x32
mode C
8x8 1 16x16
16x8 1 16x16
8x16 1 16x16
16x16 1 16x16
24x24 1 32x32
32x24 1 32x32
24x32 1 32x32
32x32 1 32x32
Using the following table, determine the number of sprites needed for each sprite size mode. If mode A exceeds 128 sprites, use mode B, and if mode B exceeds 128, use mode C.
size mode A mode B mode C
8x8 1 1 1
16x8 1 2 1
8x16 1 2 1
16x16 1 4 1
24x24 4 1 1
32x24 4 1 1
24x32 4 1 1
32x32 4 1 1
The next step is to calculate the number of sprites it will take for using the minimum amount of 8x8 cells. If the number of sprites exceeds 128, make a compromise between sprites and cells. Always do sprite sizes that save the biggest number of sprites for the smallest number of cells first, in the order of first to last sprite in OAM.
mode A
size sprites cells trade-off
8x8 1 1 NA
16x8 2 2 1 sprite for 2 cells
8x16 2 2 1 sprite for 2 cells
16x16 1 4 NA
24x24 6 9 2 sprites for 1 cell
32x24 6 12 1 sprite for 2 cells (x2)
24x32 6 12 1 sprite for 2 cells (x2)
32x32 4 16 NA
mode B
size sprites cells trade-off
8x8 1 1 NA
16x8 2 2 NA
8x16 2 2 NA
16x16 4 4 NA
24x24 9 9 8 sprites for 7 cells
32x24 12 12 11 sprites for 4 cells
24x32 12 12 11 sprites for 4 cells
32x32 1 16 NA
VRAM alignment:
Sprites always take up the size of their mode C configuration in VRAM. Sprites are always aligned to the left, except with h-flipped is set. Sprites can choose between being aligned on top or on bottom, to minimize flicker in meta-sprites, which are reversed when v-flipped is set.