Konami's Devil World HW (twin16) has a nice feature in which sprites can create a shadow by darkening the background layer below it. The hardware presumably is incapable of shadowing ontop of another sprite. So, what happens when the background layer is a lake of lava, and the platform is a sprite? Unfortunately, the shadow looks like darkened lava, which is really ugly. (first pic).
To take care of this issue, I created a new priority tag for background tilemap mode 0 layer 1 (lava):
TWIN16_BG_DEF_SHADOW = 0x08 // BG pixel can't be shadowed, use a default shadow -dink
... and draw the first layer of mode 0 w/that priority.
Then take care of the rest in the shadow handling section of the sprites drawing function:
if (pdest[sx] & TWIN16_BG_DEF_SHADOW)
dest[sx] = 0x801; // this is the palette index for the default shadow, rgb 0x282828.
else // normal shadow handling check here
How does it look?
First pic: before - FBA (dev build) and MAME. (it looks much worse when animating)
Second pic: after - note, the small platforms are sprites, and the large platform is the background tilemap.
Third pic: when the platform below the characters is a tilemap.