CoinPoserSA

by mrmeyham

Game: SMW

Description: Coin = Pose

; Load coin count into A
LDA $0DBF|!addr

; Don't do 2A through 2F if Mario doesn't have a cape (0x02)
CMP #$2A
BCS above2a
BRL notcaperange

above2a:
CMP #$30
BCC needscape
BRL notcaperange

needscape:
; Load powerup state into X
LDA $19|!addr
CMP #$02
BNE end
BRL store

notcaperange:
; If 0x40 or 0x41, do nothing
CMP #$40
BEQ end
CMP #$41
BEQ end

; If 0x47 or above, do nothing
CMP #$47
BCC store
BRL end

; Pose state = Coin count
store:
LDA $0DBF|!addr
STA $13E0|!addr

end:
RTL
back to listings