It is currently Tue Oct 17, 2017 11:51 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: sprites transparency
PostPosted: Mon Jun 29, 2015 10:55 am 
Offline

Joined: Sat Jun 27, 2015 1:09 pm
Posts: 68
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 1451 times ]
Top
 Profile  
 
 Post subject: Re: sprites transparency
PostPosted: Mon Jun 29, 2015 12:42 pm 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
Only some games? o.O

Do you know if the color matters?


Top
 Profile  
 
 Post subject: Re: sprites transparency
PostPosted: Mon Jun 29, 2015 1:02 pm 
Offline

Joined: Sat Jun 27, 2015 1:09 pm
Posts: 68
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.


Top
 Profile  
 
 Post subject: Re: sprites transparency
PostPosted: Mon Jun 29, 2015 2:48 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19086
Location: NE Indiana, USA (NTSC)
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.


Top
 Profile  
 
 Post subject: Re: sprites transparency
PostPosted: Mon Jun 29, 2015 6:29 pm 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
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.


Top
 Profile  
 
 Post subject: Re: sprites transparency
PostPosted: Tue Jun 30, 2015 6:04 am 
Offline

Joined: Sat Jun 27, 2015 1:09 pm
Posts: 68
yep, you're right, that fixed it !

thanks !


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group