SHARE
TWEET

Untitled

a guest Oct 15th, 2017 194 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; **NOTE**: You MUST have used some form of spritetool on your ROM in order for this to work.
  2.  
  3. lorom
  4.  
  5. if read1($00FFD5) == $23
  6.     !SA1 = 1
  7.     sa1rom
  8. else
  9.     !SA1 = 0
  10. endif
  11.  
  12. if !SA1
  13.     !base1 = $3000
  14.     !base2 = $6000
  15.    
  16.     !15F6 = $33B8
  17.     !166E = $7600
  18.     !D8 = $3216
  19.     !14D4 = $3258
  20.     !1594 = $3360
  21.     !C2 = $30D8
  22.     !E4 = $322C
  23.     !14E0 = $326E
  24.     !163E = $33FA
  25.     !1534 = $32B0
  26.     !1528 = $329A
  27.     !1570 = $331E
  28.     !187B = $3410
  29.     !7FAB10 = $6040
  30. else
  31.     !base1 = $0000
  32.     !base2 = $0000
  33.    
  34.     !15F6 = $15F6
  35.     !166E = $166E
  36.     !D8 = $D8
  37.     !14D4 = $14D4
  38.     !1594 = $1594
  39.     !C2 = $C2
  40.     !E4 = $E4
  41.     !14E0 = $14E0
  42.     !163E = $163E
  43.     !1534 = $1534
  44.     !1528 = $1528
  45.     !1570 = $1570
  46.     !187B = $187B
  47.     !7FAB10 = $7FAB10
  48. endif
  49.  
  50. !Freeram = $13E6        ;MUST BE CLEARED ON LEVEL LOAD
  51.  
  52. !Music = $0C
  53. !Soundeffect = $23
  54. !Soundbank = $1DF9
  55.  
  56. if !Freeram >= $0100
  57.     !FreeramB = !Freeram|!base2
  58. else
  59.     !FreeramB = !Freeram
  60. endif
  61.  
  62. org $008E2D
  63. autoclean JML TimerStop
  64. NOP
  65.  
  66. org $01C078
  67. autoclean JSL InitCode
  68.  
  69. org $0086C1     ;end of controllerupdate
  70. autoclean JSL NoController
  71. NOP
  72.  
  73. org $01C0A7
  74. autoclean JSL MainCode
  75. ;LDA !1594,x
  76. ;CMP #$08
  77. ;BEQ DontDieInAHole
  78. RTS
  79. DontDieInAHole:
  80. JMP $C0E7
  81.  
  82. org $01C11F
  83. BRA 2 : NOP #2
  84.  
  85. org $01C0EF
  86. BRA $08
  87. NOP #8
  88.  
  89. ;1686: 29
  90. ;190F: 46
  91.  
  92. freecode
  93.  
  94. InitCode:
  95. PHA
  96. LDA !15F6,x
  97. AND #$F1
  98. ORA #$08
  99. STA !15F6,x
  100. LDA !166E,x
  101. AND #$F1
  102. ORA #$08
  103. STA !166E,x
  104. .special
  105. LDA !14D4,x
  106. STA !187B,x
  107. XBA
  108. LDA !D8,x
  109. STA !1570,x
  110. REP #$20
  111. SEC
  112. SBC #$0080
  113. SEP #$20
  114. STA !D8,x
  115. XBA
  116. STA !14D4,x
  117. STZ !1594,x
  118. PLA
  119. SBC #$08
  120. STA !C2,x
  121. RTL
  122.  
  123. MainCode:
  124. LDA !1594,x
  125. JSL $0086DF
  126.  
  127. dw NoTouched
  128. dw Above
  129. dw CalcScore
  130. dw WaitSecond       ;!163E,x for waitsecond timer
  131. dw Falling
  132. dw WaitSecond
  133. dw Jumping
  134. dw FallTime
  135. dw WaitSecond
  136. dw StupidHop
  137. dw Peace
  138. dw TimeScore
  139. dw Derrr
  140.  
  141. NoTouched:
  142. LDA !187B,x
  143. XBA
  144. LDA !1570,x
  145. REP #$20
  146. CMP $96
  147. BCC NotBlargh
  148. SEP #$20
  149.  
  150. LDA !14E0,x
  151. XBA
  152. LDA !E4,x
  153. REP #$20
  154. CMP $94
  155. BCC XTEST
  156. SEP #$20
  157. RTL
  158. -
  159. ;LDA $1338
  160. INC !1594,x
  161. INC !1594,x
  162. STZ $7B
  163. LDA !14D4,x
  164. XBA
  165. LDA !D8,x
  166. REP #$20
  167. SEC
  168. SBC #$0010
  169. CMP $96
  170. SEP #$20
  171. BCC NotBlargh
  172. DEC !1594,x
  173. NotBlargh:
  174. SEP #$20
  175. RTL
  176.  
  177. XTEST:
  178. ADC #$0004
  179. CMP $94
  180. BCC NotBlargh
  181. SBC #$0004
  182. STA $94
  183. SEP #$20
  184. BRA -
  185.  
  186. Above:
  187. LDA !14D4,x
  188. XBA
  189. LDA !D8,x
  190. REP #$20
  191. SEC
  192. SBC #$0010
  193. CMP $96
  194. BCS .NotDoneYet
  195. SEP #$20
  196. INC !1594,x
  197. .NotDoneYet
  198. SEP #$20
  199. STZ $7B
  200. RTL
  201.  
  202. CalcScore:
  203. LDA #$80
  204. STA $1DFB|!base2
  205. INC !1594,x
  206. LDA #$40
  207. STA !163E,x     ;ex: 00F0
  208. LDA !187B,x
  209. XBA
  210. LDA !1570,x
  211. REP #$20        ;0170
  212. SEC
  213. SBC $96
  214. LSR #4      ;divide by 0x10
  215. SEP #$20
  216. JSL $02ACE5
  217. JSL $00FA80 ;clear enemies
  218. LDA #$01
  219. STA !FreeramB
  220. RTL
  221.  
  222. WaitSecond:
  223. LDA !1594,x
  224. CMP #$08
  225. BEQ .nopos
  226. LDA #$20
  227. STA $13E0|!base2
  228. .nopos
  229. LDA #$01
  230. STA $76
  231. STZ $7B
  232. STZ $7D
  233. STZ $77
  234. STZ $1DFA|!base2
  235. STZ $1DFC|!base2
  236. STZ $1DF9|!base2
  237. LDA !163E,x
  238. BNE .notzeroyet
  239. LDA #$40
  240. STA !163E,x
  241. INC !1594,x
  242. LDA !1594,x
  243. CMP #$04
  244. BNE .notzeroyet
  245. LDA #!Soundeffect
  246. STA !Soundbank|!base2
  247. .notzeroyet
  248. RTL
  249.  
  250. Falling:
  251. LDA #$20
  252. STA $13E0|!base2
  253. LDA #$01
  254. STA $76
  255. STZ $7B
  256. STZ $7D
  257. LDA !1534,x
  258. XBA
  259. LDA !1528,x
  260. REP #$20
  261. DEC
  262. DEC
  263. DEC
  264. CMP $96
  265. BEQ .marioground
  266. INC $96
  267. .marioground
  268. SEP #$20
  269. LDA !187B,x
  270. STA $01
  271. LDA !1570,x
  272. STA $00
  273. LDA !14D4,x
  274. XBA
  275. LDA !D8,x
  276. REP #$20
  277. CMP $00
  278. BCS .lolground
  279. INC
  280. SEP #$20
  281. STA !D8,x
  282. XBA
  283. STA !14D4,x
  284. RTL
  285. .lolground
  286. SEP #$20
  287. INC !1594,x
  288. LDA #$10
  289. STA !163E,x
  290. RTL
  291.  
  292. Jumping:
  293. LDA #!Music
  294. STA $1DFB|!base2
  295. LDA #$FF
  296. STA $0DDA|!base2
  297. LDA #$A0
  298. STA $7D
  299. STZ $7B
  300. INC !1594,x
  301. LDA #$01
  302. STA $1DFA|!base2
  303. INC
  304. STA !163E,x
  305. RTL
  306.  
  307. PoseTable:
  308. db $24,$0B
  309.  
  310. FallTime:
  311. JSR Poser
  312. LDA #$01
  313. STA $76
  314. STZ $7B
  315. REP #$20
  316. INC $94
  317. INC $94
  318. SEP #$20
  319. LDA $77
  320. BIT #$04
  321. BEQ .zomg
  322. INC !1594,x
  323. LDA #$40
  324. STA !163E,x
  325. .zomg
  326. RTL
  327.  
  328. Poser:
  329. LDA $187A|!base2
  330. BNE Yoshiiiii
  331. PHB
  332. PHK
  333. PLB
  334. LDA $7D
  335. BEQ StandIt
  336. ROL #2
  337. AND #$01
  338. TAY
  339. LDA PoseTable,y
  340. PLB
  341. STA $13E0|!base2
  342. RTS
  343. StandIt:
  344. STZ $13E0|!base2
  345. PLB
  346. RTS
  347. Yoshiiiii:
  348. LDA #$20
  349. STA $13E0|!base2
  350. RTS
  351.  
  352. StupidHop:
  353. JSR Poser
  354. STZ $7B
  355. LDA #$01
  356. STA $76
  357. LDA $77
  358. BIT #$04
  359. BEQ .end
  360. LDA !163E,x
  361. BNE .jumpers
  362. INC !1594,x
  363. LDA #$40
  364. STA !163E,x
  365. RTL
  366. .jumpers
  367. LDA #$B0
  368. STA $7D
  369. LDA #$01
  370. STA $1DFA|!base2
  371. .end
  372. RTL
  373.  
  374. Peace:
  375. LDA #$26                    ; \ Mario's image = Peace Sign, or
  376. LDY $187A|!base2            ;  |
  377. BEQ CODE_00CA3A             ;  |
  378. LDA #$14                    ;  | Mario's image = Peace Sign on Yoshi
  379. CODE_00CA3A:                ;  |
  380. STA $13E0|!base2            ; /  YEAAAAH ALL.LOG RIP
  381. LDA !163E,x
  382. BNE .end
  383. INC !1594,x
  384. INC !FreeramB
  385. LDA #$11
  386. STA $1DFC|!base2
  387. LDA #$A0
  388. STA !163E,x
  389. .end
  390. RTL
  391.  
  392. TimeScore:
  393. LDA $0F31|!base2
  394. BEQ .tens
  395. DEC $0F31|!base2
  396. REP #$20
  397. LDA $0F34|!base2
  398. CLC
  399. ADC #$01F4
  400. STA $0F34|!base2
  401. SEP #$20
  402. BCC .end
  403. INC $0F36|!base2
  404. RTL
  405. .tens
  406. LDA $0F32|!base2
  407. BEQ .ones
  408. DEC $0F32|!base2
  409. REP #$20
  410. LDA $0F34|!base2
  411. CLC
  412. ADC #$0032
  413. STA $0F34|!base2
  414. SEP #$20
  415. BCC .end
  416. INC $0F36|!base2
  417. RTL
  418. .ones
  419. LDA $0F33|!base2
  420. BEQ .endofitall
  421. DEC $0F33|!base2
  422. REP #$20
  423. LDA $0F34|!base2
  424. CLC
  425. ADC #$0005
  426. STA $0F34|!base2
  427. SEP #$20
  428. BCC .end
  429. INC $0F36|!base2
  430. RTL
  431. .endofitall
  432. INC !1594,x
  433. LDA #$12
  434. STA $1DFC|!base2
  435. .end
  436. RTL
  437.  
  438. Derrr:
  439. LDA !163E,x
  440. BNE .end
  441. LDA $0DD5|!base2
  442. BEQ $02
  443. BPL $19
  444. LDA #$80
  445. BRA $00
  446. LDA #$01
  447. STA $13CE|!base2
  448. STA $0DD5|!base2
  449. INC $1DE9|!base2
  450. LDA #$0B
  451. STA $0100|!base2
  452. RTL
  453. LDA $0DD5|!base2
  454. BEQ $02
  455. BPL $19
  456. LDA #$80
  457. BRA $00
  458. LDA #$01
  459. INC
  460. STA $13CE|!base2
  461. STA $0DD5|!base2
  462. INC $1DE9|!base2
  463. LDA #$0B
  464. STA $0100|!base2
  465. .end
  466. RTL
  467.  
  468. TimerStop:
  469. LDA #$28
  470. STA $0F30|!base2
  471. LDA !FreeramB
  472. BNE .awaaaay
  473. JML $008E32
  474. .awaaaay
  475. JML $008E6F
  476.  
  477. NoController:
  478. LDA $0DA8|!base2,x
  479. STA $18
  480. LDA !FreeramB
  481. BNE .eeef
  482. RTL
  483. .eeef
  484. STZ $15
  485. STZ $16
  486. STZ $17
  487. STZ $18
  488. DEC
  489. BEQ .eeed
  490. STA $15
  491. .eeed
  492. RTL
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top