Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- !dashTimer = $146C|!addr
- !dashDir = $146D|!addr
- !dashState = $146E|!addr
- !dashTime = $0C
- !dashSpeed = $50
- !refreshOnBounce = 1 ; refresh dash when bouncing off an enemy
- ;;;;;;;;;;;;;;;;;;;;;;;;;;
- nmi:
- LDA !dashState
- BEQ +
- REP #$20
- LDA.w #DashPal : STA $0D82|!addr
- SEP #$20
- +
- RTL
- ;;;;;;;;;;;;;;;;;;;;;;;;;;
- main:
- LDA !dashTimer
- BNE .dashing
- LDA !dashState
- BNE .cantDash
- LDA $18
- AND #$80
- BNE .dash
- RTL
- .cantDash
- LDA $13EF|!addr
- BNE .onGround
- RTL
- .onGround
- STZ !dashState
- RTL
- .dash
- TRB $18
- LDA #!dashTime+1
- STA !dashTimer
- LDA $15
- AND #$0F
- BNE +
- LDA $76
- BNE +
- LDA #$02
- + STA !dashDir
- INC !dashState
- JSR SpawnSmoke
- .dashing
- DEC !dashTimer
- LDA $15
- AND #$0F
- TRB $15
- LDA $13EF
- BEQ .notJumping
- BIT $16
- BPL .notJumping
- STZ !dashTimer
- RTL
- .notJumping:
- LDX !dashDir
- LDA XSpeeds,x
- STA $7B
- LDA YSpeeds,x
- STA $7D
- LDA $77
- AND !dashDir
- BEQ .return
- STZ !dashTimer
- BIT #$03
- BEQ +
- STZ $7B
- + BIT #$0C
- BEQ .return
- STZ $7D
- .return:
- RTL
- SpawnSmoke:
- LDY #$03
- XBA
- - LDA $17C0|!addr,y
- BEQ +
- DEY
- BPL -
- RTS
- + LDA #$01
- STA $17C0|!addr,y
- LDA #$1B
- STA $17CC|!addr,y
- LDA $96
- CLC : ADC #$08
- STA $17C4|!addr,y
- LDA $94
- STA $17C8|!addr,y
- RTS
- ;; Data
- !diagSpeed = (!dashSpeed*90/100)
- XSpeeds: ; UDLR
- db $00 ; -
- db !dashSpeed ; R
- db $100-!dashSpeed ; L
- db $00 ; L+R
- db $00 ; D
- db !diagSpeed ; D+R
- db $100-!diagSpeed ; D+L
- db $00 ; D+L+R
- db $00 ; U
- db !diagSpeed ; U+R
- db $100-!diagSpeed ; U+L
- db $00 ; U+L+R
- db $00 ; U+D
- db !diagSpeed ; U+D+R
- db $100-!diagSpeed ; U+D+L
- db $00 ; U+D+L+R
- YSpeeds: ; UDLR
- db $00 ; -
- db $00 ; R
- db $00 ; L
- db $00 ; L+R
- db !dashSpeed ; D
- db !diagSpeed ; D+R
- db !diagSpeed ; D+L
- db !dashSpeed ; D+L+R
- db $100-!dashSpeed ; U
- db $100-!diagSpeed ; U+R
- db $100-!diagSpeed ; U+L
- db $100-!dashSpeed ; U+L+R
- db $00 ; U+D
- db $00 ; U+D+R
- db $00 ; U+D+L
- db $00 ; U+D+L+R
- pushpc
- org $00FF93
- DashPal:
- dw $635F,$581D,$2802,$7E67 ; $00B2C8: Mario palette (palette 8, colors 6-F).
- dw $44C4,$4E08,$6770,$69A1
- dw $35DF,$03FF
- pullpc
- if !refreshOnBounce
- pushpc
- org $01AA37
- JSL RefreshBounce
- pullpc
- RefreshBounce:
- STZ !dashState
- LDA #$D0
- BIT $15
- RTL
- else
- pushpc
- org $01AA37
- LDA #$D0
- BIT $15
- pullpc
- endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement