Language…
14 users online: 35TCB77, Buflen, crm0622, crocodileman94, fanfan21, Green Jerry, Hayashi Neru, Josuke Yoshikage, KoJi, Maw, Metakabe, Neuromancer, signature_steve, toady - Guests: 244 - Bots: 349
Users: 64,795 (2,377 active)
Latest user: mathew

Layer 3 not visible

Hello, I have an issue with color math, layer 3, and layer 2.
Code
	LDA #$01
	STA $3E

	LDA #$22
	STA $44

	LDA #$15
	STA $212C
	LDA #$02
	STA $212D

	LDA.b #$B5
	STA $40

This code is in place in order to create a layer 2 spotlight, giving this effect. However, layer three does not show in the BG, and instead looks, with layer 2 disabled, like this. I believe this may be indicative of a larger problem, and related to this patch which creates a layer three status bar.

Here's a patch of the ROM so you can see what it looks like. Just enter the level then the door in order to get to the sublevel.

Thanks for the read, any and all help woll be appreciated.
If you set $40 to #$B1, rather than #$B5 it will show up.
Originally posted by Medic
If you set $40 to #$B1, rather than #$B5 it will show up.

Nope, that does nothing.
It most certainly does, look closer... the layer is there, just not very visible. Although I am unsure of what effect you are going for, so... if you could describe or make a picture of what the layer 3 background is supposed to look like, that would be helpful.
See how layer 2 appears, ah, normal in this video? Like that. Yaknow, visible behind the spotlight with all it's colors and everything affected by the color math.
Okay got it and you should realize you are trying to write to regs outside a blank which for many regs including the main/subscreen designations you cannot do (assuming this is in levelasm) so you need to use SMW's mirrors instead which would make your code:

Code
LDA #$15
STA $0D9D
LDA #$02
STA $0D9E
LDA.b #$C5
STA $40
RTS


(i dont think you need to mess with $3E or $44)

Maybe some sprites will not entirely work with this but I believe that can be worked around.
Cool, that works as intended. Thanks!
Color math and sprites work not quite as expected on the SNES. It only functions on sprites that use palette C, D, E or F. There is a different way to do it but it would affect Mario too and I tried it and it made him black so you probably don't want that one. Replace #$C5 with #$D5 (enable translucency on sprites). Any sprite that uses palette 8,9,A,B will not be affected and show up normally, while C,D,E,F will be affected (so you might need to insert some edited stuff for this).

(smh ninja'd by an edit?? i'm leaving this up in case the reason you edited that out wasn't because you figured it out already)