So are we saying now that this new layer (3 in del3's case) can have both BGPDH/BGSCR applied to it, and be assigned scripted areas to be used with BGON/BGOFF? This must be the case, since del3's "wave" entity uses both BGPDH to (presumably) set its depth, as well as BGON/OFFs to animate it. I had kind of assumed that the BGON/OFF only applied to the foreground layer (layer one, in your analogy) but then I guess it must work on all layers; perhaps even layer 0 if it had the right area ID assigned to it? (though this wouldn't really make sense on the very back layer as it would be blank if you turned it off).
I dont think this could be even called layer now, cause the second one have many layers itself =)
1st background - always rendered first. It doesn't have animation or depth. (maybe depth could be set with opcodes?)
Info in dat files are X position, Y position, texture X, texture Y, clut, texture flags.
2nd background - contains fixed depth tiles. It can have animation.
Info in dat files are X position, Y position, texture X, texture Y, clut, texture flags, depth info, animation info.
3rd and 4th background - contains movable tiles. It has no depth by itself (it needs to be specify by opcodes), but can have animation. there only two of them.
Info in dat files are X position, Y position, texture X, texture Y, clut, texture flags, animation info.
As I can see 3rd and 4th background contains 4bpp textures and have size 32x32. This needs to be implemented =)
Now we (think we) know what the layer argument deals with, I'll have a look at BGPDH, and also at that field with both layer 2 and 3. It's ztruck that has both 2 and 3, btw, I seem to recall you asking; that might be a good place to test.
Mmm I looked at this... nothing unusual. 2 movable layers with animation. 32x32 size tiles. Now I need to implement new tile size first =)