Is there ever any use for every fourth palette entry since they are treated as transparent? Are these ever used as "codes" when doing sprite collision, etc.?
Regards,
-Zom
NES Noob
Question concerning bg color and transparency
Moderator: Moderators
- GradualGames
- Posts: 1106
- Joined: Sun Nov 09, 2008 9:18 pm
- Location: Pennsylvania, USA
- Contact:
Re: Question concerning bg color and transparency
No, they're always transparent. The only way they can be visible on screen is if you exploit the palette trick when the PPU is off. During normal rendering they will never be used.ZomCoder wrote:Is there ever any use for every fourth palette entry since they are treated as transparent?
EDIT - except for $3Fx0, which of course is used as the background color.
No.Are these ever used as "codes" when doing sprite collision, etc.?
Every fourth palette entry except the first exists mainly because it's simpler in hardware to have them than not. Tiles have two bits per pixel, which only specify four possible values. The zero value is transparent, while the other three are combined with attribute bits to form a palette index. Thus, the fourth palette entries can't even be specified by anything. Behind everything is a solid background of palette entry zero, which shows through anything transparent.
So, the fourth palette entries aren't "treated as transparent"; it's that they can't be specified at all (ignoring disabling PPU rendering). Since the attributes aren't even examined when a tile's pixel is transparent, all transparent pixels are alike.
So, the fourth palette entries aren't "treated as transparent"; it's that they can't be specified at all (ignoring disabling PPU rendering). Since the attributes aren't even examined when a tile's pixel is transparent, all transparent pixels are alike.