@MFG659 if you just correct his code, knowing it won't work, why don't you provide a working code to begin with?
Well, to repeat what he already said:
You can't use $B3 if you want $0DB3, $B3 alone is equal to $00
At least, you picked the right address.
Tp provide a working code:
To clear up your code and make it slightly more simple:
LDA $0DB3 ;load the address
BEQ MakeLuigi ;if you want to compare with #$00, you don't need the CMP
;just use the branch command. It compares with #$00 on it's own
STZ $0DB3 ;If the code doesn't branch to MakeLuigi, that means we want to make Mario!
RTL ;In blocks you use RTL instead of RTS
LDA #$01 ;\
STA $0DB3 ; | Make Luigi and Return
Though if you want a even better solution:
LDA $0DB3 ;Load RAM address
EOR #$01 ;invert the last bit:
;it turnes #$00 into #$01
;and #$01 into #$00
STA $0DB3 ;Store the result back.
The real problem is, that as long as you touch the block, this code will execute, meaning you'll paridly switch between Mario and Luigi.
So, it would be the best, if you either distroy the block, after it's has been used, or you make 2 different blocks, one which turns you into Mario, and one which turns you into Luigi.
Also, for ASM questions, this forum
or this thread
, might be a better place to look at.
modedit: don't table stretch