Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
ppu [2021/09/05 14:59] – [Layer 1 and 2 registers] simer | ppu [2021/09/05 15:03] – [Colors and palettes] simer | ||
---|---|---|---|
Line 127: | Line 127: | ||
The sprite position refers to the center of the sprite (rather than top left corner) and contains signed values with pixel position x=160,y=128 as the origin of the coordinate system and positive Y going upwards. | The sprite position refers to the center of the sprite (rather than top left corner) and contains signed values with pixel position x=160,y=128 as the origin of the coordinate system and positive Y going upwards. | ||
- | Unlike for layers, there is no tile and attribute map: a sprite is made of one single tile, which ID is stored directly in the corresponding register for the sprite. | + | Unlike for layers, there is no tile and attribute map: a sprite is made of one single tile, with the character |
+ | The sprite attribute register format is the same as the one for tile layers, with the exception of bit 14 being assigned to blend enable. | ||
===== Colors and palettes ===== | ===== Colors and palettes ===== | ||
Line 139: | Line 140: | ||
In the 16-bit color mode, the value of each pixel in the segment memory directly stores a color, otherwise the value refers to a palette index. | In the 16-bit color mode, the value of each pixel in the segment memory directly stores a color, otherwise the value refers to a palette index. | ||
The palette memory is mapped to 0x2B00-0x2BFF and stores 256 different colors in the format mentioned above. | The palette memory is mapped to 0x2B00-0x2BFF and stores 256 different colors in the format mentioned above. | ||
- | This memory can be split into multiple | + | This memory can be split into multiple |
The chosen color from the palette memory is determined by the chosen color depth and palette of each tile/sprite and value of each pixel as follows: | The chosen color from the palette memory is determined by the chosen color depth and palette of each tile/sprite and value of each pixel as follows: | ||
- | ^ Color depth ^ Chosen color ^ | + | ^ Color depth ^ Chosen color memory index ^ |
| 2-bit | Palette * 16 + Index | | | 2-bit | Palette * 16 + Index | | ||
| 4-bit | Palette * 16 + Index | | | 4-bit | Palette * 16 + Index | |