Guest User

How to Crash Super Mario World 202

a guest
Feb 5th, 2016
64
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. print "INIT ",pc ;initial code, doesn't do anything
  2. RTL
  3. print "MAIN ",pc ;main code
  4. LDA $E4,x
  5. AND #$F0
  6. STA $9A
  7. LDA $14E0,x
  8. STA $9B
  9. LDA $D8,x
  10. AND #$F0
  11. STA $98
  12. LDA $14D4,x
  13. STA $99
  14. REP #$10
  15. LDX.w #$025B
  16. JSR ChangeMap16
  17. SEP #$10
  18. RTL
  19. PrematureEnd:
  20. PLX
  21. PLY
  22. PLB
  23. PLP
  24. RTS
  25. ChangeMap16:
  26. PHP
  27. SEP #$20
  28. PHB
  29. PHY
  30. LDA #$00
  31. PHA
  32. PLB
  33. REP #$30
  34. PHX
  35. LDA $9A
  36. STA $0C
  37. LDA $98
  38. STA $0E
  39. LDA #$0000
  40. SEP #$20
  41. LDA $5B
  42. STA $09
  43. LDA $1933
  44. BEQ SkipShift
  45. LSR $09
  46. SkipShift:
  47. LDY $0E
  48. LDA $09
  49. AND #$01
  50. BEQ LeaveXY
  51. LDA $9B
  52. STA $00
  53. LDA $99
  54. STA $9B
  55. LDA $00
  56. STA $99
  57. LDY $0C
  58. LeaveXY:
  59. CPY #$0200
  60. BCS PrematureEnd
  61. LDA $1933
  62. ASL A
  63. TAX
  64. LDA $BEA8,x
  65. STA $65
  66. LDA $BEA9,x
  67. STA $66
  68. STZ $67
  69. LDA $1925
  70. ASL A
  71. TAY
  72. LDA [$65],y
  73. STA $04
  74. INY
  75. LDA [$65],y
  76. STA $05
  77. STZ $06
  78. LDA $9B
  79. STA $07
  80. ASL A
  81. CLC
  82. ADC $07
  83. TAY
  84. LDA [$04],y
  85. STA $6B
  86. STA $6E
  87. INY
  88. LDA [$04],y
  89. STA $6C
  90. STA $6F
  91. LDA #$7E
  92. STA $6D
  93. INC A
  94. STA $70
  95. LDA $09
  96. AND #$01
  97. BEQ SwitchXY
  98. LDA $99
  99. LSR A
  100. LDA $9B
  101. AND #$01
  102. BRA CurrentXY
  103. SwitchXY:
  104. LDA $9B
  105. LSR A
  106. LDA $99
  107. CurrentXY:
  108. ROL A
  109. ASL A
  110. ASL A
  111. ORA #$20
  112. STA $04
  113. CPX #$0000
  114. BEQ NoAdd
  115. CLC
  116. ADC #$10
  117. STA $04
  118. NoAdd:
  119. LDA $98
  120. AND #$F0
  121. CLC
  122. ASL A
  123. ROL A
  124. STA $05
  125. ROL A
  126. AND #$03
  127. ORA $04
  128. STA $06
  129. LDA $9A
  130. AND #$F0
  131. REP 3 : LSR A
  132. STA $04
  133. LDA $05
  134. AND #$C0
  135. ORA $04
  136. STA $07
  137. REP #$20
  138. LDA $09
  139. AND #$0001
  140. BNE LayerSwitch
  141. LDA $1A
  142. SEC
  143. SBC #$0080
  144. TAX
  145. LDY $1C
  146. LDA $1933
  147. BEQ CurrentLayer
  148. LDX $1E
  149. LDA $20
  150. SEC
  151. SBC #$0080
  152. TAY
  153. BRA CurrentLayer
  154. LayerSwitch:
  155. LDX $1A
  156. LDA $1C
  157. SEC
  158. SBC #$0080
  159. TAY
  160. LDA $1933
  161. BEQ CurrentLayer
  162. LDA $1E
  163. SEC
  164. SBC #$0080
  165. TAX
  166. LDY $20
  167. CurrentLayer:
  168. STX $08
  169. STY $0A
  170. LDA $98
  171. AND #$01F0
  172. STA $04
  173. LDA $9A
  174. REP 4 : LSR A
  175. AND #$000F
  176. ORA $04
  177. TAY
  178. PLA
  179. SEP #$20
  180. STA [$6B],y
  181. XBA
  182. STA [$6E],y
  183. XBA
  184. REP #$20
  185. ASL A
  186. TAY
  187. PHK
  188. PER $0006
  189. PEA $804C
  190. JML $00C0FB
  191. PLY
  192. PLB
  193. PLP
  194. RTS
RAW Paste Data