Advertisement
Guest User

celeste

a guest
Mar 24th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. !dashTimer = $146C|!addr
  2. !dashDir = $146D|!addr
  3. !dashState = $146E|!addr
  4. !dashTime = $0C
  5.  
  6. !dashSpeed = $50
  7.  
  8.  
  9.  
  10. !refreshOnBounce = 1 ; refresh dash when bouncing off an enemy
  11.  
  12. ;;;;;;;;;;;;;;;;;;;;;;;;;;
  13. nmi:
  14. LDA !dashState
  15. BEQ +
  16. REP #$20
  17. LDA.w #DashPal : STA $0D82|!addr
  18. SEP #$20
  19. +
  20. RTL
  21.  
  22. ;;;;;;;;;;;;;;;;;;;;;;;;;;
  23. main:
  24. LDA !dashTimer
  25. BNE .dashing
  26. LDA !dashState
  27. BNE .cantDash
  28. LDA $18
  29. AND #$80
  30. BNE .dash
  31. RTL
  32. .cantDash
  33. LDA $13EF|!addr
  34. BNE .onGround
  35. RTL
  36.  
  37. .onGround
  38. STZ !dashState
  39. RTL
  40.  
  41. .dash
  42. TRB $18
  43. LDA #!dashTime+1
  44. STA !dashTimer
  45. LDA $15
  46. AND #$0F
  47. BNE +
  48. LDA $76
  49. BNE +
  50. LDA #$02
  51. + STA !dashDir
  52. INC !dashState
  53. JSR SpawnSmoke
  54.  
  55. .dashing
  56. DEC !dashTimer
  57. LDA $15
  58. AND #$0F
  59. TRB $15
  60.  
  61. LDA $13EF
  62. BEQ .notJumping
  63. BIT $16
  64. BPL .notJumping
  65. STZ !dashTimer
  66. RTL
  67.  
  68. .notJumping:
  69. LDX !dashDir
  70. LDA XSpeeds,x
  71. STA $7B
  72. LDA YSpeeds,x
  73. STA $7D
  74. LDA $77
  75. AND !dashDir
  76. BEQ .return
  77.  
  78. STZ !dashTimer
  79. BIT #$03
  80. BEQ +
  81. STZ $7B
  82. + BIT #$0C
  83. BEQ .return
  84. STZ $7D
  85. .return:
  86. RTL
  87.  
  88.  
  89.  
  90. SpawnSmoke:
  91. LDY #$03
  92. XBA
  93. - LDA $17C0|!addr,y
  94. BEQ +
  95. DEY
  96. BPL -
  97. RTS
  98. + LDA #$01
  99. STA $17C0|!addr,y
  100. LDA #$1B
  101. STA $17CC|!addr,y
  102.  
  103. LDA $96
  104. CLC : ADC #$08
  105. STA $17C4|!addr,y
  106. LDA $94
  107. STA $17C8|!addr,y
  108. RTS
  109.  
  110.  
  111. ;; Data
  112. !diagSpeed = (!dashSpeed*90/100)
  113. XSpeeds: ; UDLR
  114. db $00 ; -
  115. db !dashSpeed ; R
  116. db $100-!dashSpeed ; L
  117. db $00 ; L+R
  118. db $00 ; D
  119. db !diagSpeed ; D+R
  120. db $100-!diagSpeed ; D+L
  121. db $00 ; D+L+R
  122. db $00 ; U
  123. db !diagSpeed ; U+R
  124. db $100-!diagSpeed ; U+L
  125. db $00 ; U+L+R
  126. db $00 ; U+D
  127. db !diagSpeed ; U+D+R
  128. db $100-!diagSpeed ; U+D+L
  129. db $00 ; U+D+L+R
  130.  
  131. YSpeeds: ; UDLR
  132. db $00 ; -
  133. db $00 ; R
  134. db $00 ; L
  135. db $00 ; L+R
  136. db !dashSpeed ; D
  137. db !diagSpeed ; D+R
  138. db !diagSpeed ; D+L
  139. db !dashSpeed ; D+L+R
  140. db $100-!dashSpeed ; U
  141. db $100-!diagSpeed ; U+R
  142. db $100-!diagSpeed ; U+L
  143. db $100-!dashSpeed ; U+L+R
  144. db $00 ; U+D
  145. db $00 ; U+D+R
  146. db $00 ; U+D+L
  147. db $00 ; U+D+L+R
  148.  
  149.  
  150. pushpc
  151. org $00FF93
  152. DashPal:
  153. dw $635F,$581D,$2802,$7E67 ; $00B2C8: Mario palette (palette 8, colors 6-F).
  154. dw $44C4,$4E08,$6770,$69A1
  155. dw $35DF,$03FF
  156. pullpc
  157.  
  158.  
  159. if !refreshOnBounce
  160. pushpc
  161. org $01AA37
  162. JSL RefreshBounce
  163. pullpc
  164.  
  165. RefreshBounce:
  166. STZ !dashState
  167. LDA #$D0
  168. BIT $15
  169. RTL
  170. else
  171. pushpc
  172. org $01AA37
  173. LDA #$D0
  174. BIT $15
  175. pullpc
  176. endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement