Can't make transparency work

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Can't make transparency work
by on (#211983)
I'm trying to make transparency work, but I can't get it to work. Here is the project:

https://drive.google.com/file/d/1FEokBc ... sp=sharing

To assemble this on Windows, download the WLA suite and add the WLA folder to PATH. Then run transscroll.bat.

I made use of this:

https://wiki.superfamicom.org/translucency

This:

https://en.wikibooks.org/wiki/Super_NES ... _Registers

As well as the SNES development manual.

What am I getting wrong?
Re: Can't make transparency work
by on (#211985)
Did you read my FAQ on the matter?

What part exactly "can't work"? You should include a description of what you're trying to do, what you're getting and why what you're getting is not what you expected.
Re: Can't make transparency work
by on (#211988)
Remember that there are several factors that control how the color math works:

- The layers you have enabled on the main screen
- The layers you have enabled on the sub screen
- The layers you have enabled for color math (yes this is a separate thing)
- Whether you are adding the fixed color or the sub screen
- The color math clipping setting for the color window

There might also be one or two other things I'm forgetting, but you should try to double check all of these.
Re: Can't make transparency work
by on (#211992)
I determined that your translucency was working correctly, and wasn't the actual problem: the problem lied in your setup of BG3. Specifically... the mist was somehow failing to display at all.

Specifically, your mist was failing to display due to a combination of your tilemap setup and the tile base address:
- Your mist palette was not being selected due to not having the correct palette ID set in all of the tilemap entries (they were using the same palette as the main palette: their palette IDs should be set to $04, or $1001 for an overall tilemap entry).
- Your mist BG was not displayed due to being sent to the wrong location: it should be sent to $4000, not $0400. Otherwise, you'd have to set up your tile IDs for the tilemap accordingly.

There is one other potential bug that you may not have noticed, and it's with your scrolling: the scroll register you write to is an 8-bit write-twice register, not a 16-bit write-once register.