I was pretty sure I had already tried the "topmost-per-pixel" approach, and indeed when I applied it again, I ended up with the following image I remembered from my past tests:
the "lighted" tile is OAM0 and I thought (when I first tried this solution) it was a priority problem causing it to appear above BG2B. This time, thanks to AWJ, I knew priorities were fine, so I looked for other possible causes. In particular, toggling off the color math, I obtained this
i.e. color math is the effect responsible for darkened/lightened images...
long story short, the way I implemented sprite priorities was properly disabling color math whenever the sprite had palette 0-3, but it was not enabling it again if the sprite was covered by a BG with color math enabled. Fixing this stupid bug, sprites are finally correct
known graphics issues still present:
- hires mosaic is slightly wrong (and it cannot be fixed without partially rewriting hires rendering, however it should be barely noticeable)
- some tiles get corrupted after a while (R-Type 3)
- TMNT has strange coloured rectangles partially covering texts in the intro...
- pseudo-hires is still missing (I think I have it working, as the following snap shows
but I'd like to test screens with Dr.DNA trivia before officially adding it... does anyone know how to reach one of these trivia screen in Jurassic Park?)