Hello everyone,
I have a bug on my project, it works on emulator but not on the real machine.
Here I put BG 2 transparency, it works (for example, water), but if I want some tileset BG 2 are not transparent as I do?
Thank you in advance
http://img15.hostingpics.net/pics/343215exempleSNES.png
You're going to need to provide more information, it's not at all clear from the screenshot what you're even trying to do. What parts of the screen are on each BG layer and what PPU register settings are you using (particularly TM, TS, CGWSEL and CGADSUB)?
Thank you for answering,
Yes sorry it's been a while since I have not programmed SNES.
The sol is the BG2 and BG1 (the white square are the BG2)
Code:
SNES_TM $17
SNES_TS $11
SNES_CGSWSEL $02
SNES_CGADSUB $42
So, the water is high-priority BG2 tiles and the part of the ground that's turning white is low-priority BG2 tiles?
Make sure you've initialized COLDATA to black by writing #$e0 to it. Otherwise if there is no layer under BG2 then it will get blended with whatever is in that register, with halving forced off.
Also, what emulator are you using?
Thank you, I have not used well COLDATA, it works perfectly now.
I use SNES9X, but the bug persists Znes and NOSNS.
Thank you again;)
Leaving hardware registers or RAM uninitialized is probably the number one source of "My code works on emulators, but..." bugs.
It is probably not the best ressource ever, but I also was puzzled by the complexity of SNES' transparency, so I typed down my notes about it in a FAQ here :
http://www.romhacking.net/documents/428/