sprites transparency

Discussion of programming and development for the original Game Boy and Game Boy Color.
Post Reply
DarkMoe
Posts: 70
Joined: Sat Jun 27, 2015 1:09 pm

sprites transparency

Post by DarkMoe »

Hi, I'm writting my first GB emulator, and it's already playing some commercial and demos games almost flawlessly (tetris, SML1, SML2, etc).

However, some other games, show no transparent sprites. For example, the lion king menu screen, has 8x16 sprites for the options, and for some reason they are drawn with a black background. This also happens ingame and with other games, including dr mario.

I've compared the sprites with BGB vram debugger, and the palettes, and they are exactly the same as my emu (showing those black backgrounds in the tile viewer, but showing them transparent in game). All sprites in the lion king menu have OAM attributes = 0, so no priority, x flip or y flip present.

I have no clue what's going on, or what I'm missing, since sprites in other games work as intended. Blarggs cpu instructions rom also passes the 11 tests ok.

Any ideas ?

Thanks,
Attachments
lionking.jpg
lionking.jpg (10.51 KiB) Viewed 4269 times
Sik
Posts: 1589
Joined: Thu Aug 12, 2010 3:43 am

Re: sprites transparency

Post by Sik »

Only some games? o.O

Do you know if the color matters?
DarkMoe
Posts: 70
Joined: Sat Jun 27, 2015 1:09 pm

Re: sprites transparency

Post by DarkMoe »

Yes, it happens in games like The Lion King, Dr Mario, Agro Soar, and some others.

The game calculates the color as 11, which with pallette = 0x1B means the color is BLACK, and as I understand, white is the transparent color for sprites.

The weird thing is that BGB also shows those tiles with a black background, so I think my algorythm is correct.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: sprites transparency

Post by tepples »

I thought the transparent color for sprites was color index 0 and had nothing to do with the palette. If white itself were transparent, then Mario's face in Super Mario Land 2: 6 Golden Coins would look kind of funny in most of Pumpkin Zone.
Sik
Posts: 1589
Joined: Thu Aug 12, 2010 3:43 am

Re: sprites transparency

Post by Sik »

Pretty sure it should be index 0... In fact, note how the interior of the font is transparent. Looks like for whatever reason the wrong color ends up being 0.
DarkMoe
Posts: 70
Joined: Sat Jun 27, 2015 1:09 pm

Re: sprites transparency

Post by DarkMoe »

yep, you're right, that fixed it !

thanks !
Post Reply