Advertisement
Guest User

Untitled

a guest
Apr 5th, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.07 KB | None | 0 0
  1. ; ---------------------------------------------------------------------------
  2. ; Object 4F - blank.
  3. ;!@ Now Socket bonus stage Door!
  4. ;Using object $19 (unused switch) object as codebase to modify
  5. ; ---------------------------------------------------------------------------
  6.  
  7. obj4F:
  8. moveq #0,d0
  9. move.b obRoutine(a0),d0
  10. move.w Door_Index(pc,d0.w),d1
  11. jmp Door_Index(pc,d1.w)
  12. ; ===========================================================================
  13. Door_Index: dc.w Door_Main-Door_Index
  14. dc.w Door_Action-Door_Index
  15. dc.w Door_Delete-Door_Index
  16.  
  17. ;origY: = $30 ; original y-axis position
  18. ; ===========================================================================
  19.  
  20. Door_Main: ; Routine 0
  21. addq.b #2,obRoutine(a0)
  22. ;!@
  23. move.l #Map_Bonus_Door,obMap(a0)
  24. move.w #$6BE,obGfx(a0)
  25. move.b #4,obRender(a0)
  26. ;move.w obY(a0),origY(a0) ; save position on y-axis
  27. move.b #$10,obActWid(a0)
  28. move.b #2,obPriority(a0)
  29.  
  30. Door_Action: ; Routine 2
  31. ;move.w origY(a0),obY(a0) ; restore position on y-axis
  32. move.w #$10,d1
  33. bsr.w Door_ChkTouch ; check if Sonic touches the Doortch
  34. beq.s Door_ChkDel ; if not, branch
  35.  
  36. ;addq.w #2,obY(a0) ; move object 2 pixels
  37. ;moveq #1,d0
  38. ;move.w d0,(f_Doortch).w ; set Doortch 0 as "pressed"
  39.  
  40. moveq #0,d0
  41. moveq #0,d1
  42. move.b obSubtype(a0),d0
  43. add.w d0,d0
  44. move.w Door_TypeIndex(pc,d0.w),d1
  45. jsr Door_TypeIndex(pc,d1.w)
  46. rts
  47.  
  48. Door_ChkDel:
  49. bsr.w DisplaySprite
  50. ;out_of_range Door_Delete
  51. rts
  52. ; ===========================================================================
  53.  
  54. Door_Delete: ; Routine 4
  55. ;bsr.w DeleteObject
  56. rts
  57.  
  58. ; ---------------------------------------------------------------------------
  59. ; Subroutine to check if Sonic touches the object
  60. ; ---------------------------------------------------------------------------
  61.  
  62. ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
  63.  
  64.  
  65. Door_ChkTouch:
  66. lea (v_player).w,a1
  67. move.w obX(a1),d0
  68. sub.w obX(a0),d0
  69. add.w d1,d0
  70. bmi.s Door_NoTouch
  71. add.w d1,d1
  72. cmp.w d1,d0
  73. bcc.s Door_NoTouch
  74. move.w obY(a1),d2
  75. move.b obHeight(a1),d1
  76. ext.w d1
  77. add.w d2,d1
  78. move.w obY(a0),d0
  79. subi.w #$10,d0
  80. sub.w d1,d0
  81. bhi.s Door_NoTouch
  82. cmpi.w #-$10,d0
  83. bcs.s Door_NoTouch
  84. moveq #-1,d0 ; Sonic has touched it
  85. rts
  86. ; ===========================================================================
  87.  
  88. Door_NoTouch:
  89. moveq #0,d0 ; Sonic hasn't touched it
  90. rts
  91. ; End of function Door_ChkTouch
  92.  
  93. ; ===========================================================================
  94.  
  95. Door_TypeIndex:
  96. dc.w Door_Type00-Door_TypeIndex, Door_Type01-Door_TypeIndex
  97. dc.w Door_Type02-Door_TypeIndex, Door_Type03-Door_TypeIndex
  98. dc.w Door_Type04-Door_TypeIndex, Door_Type05-Door_TypeIndex
  99. dc.w Door_Type06-Door_TypeIndex, Door_Type07-Door_TypeIndex
  100. dc.w Door_Type08-Door_TypeIndex, Door_Type09-Door_TypeIndex
  101. dc.w Door_Type0A-Door_TypeIndex, Door_Type0B-Door_TypeIndex
  102. dc.w Door_Type0C-Door_TypeIndex, Door_Type0D-Door_TypeIndex
  103. dc.w Door_Type0E-Door_TypeIndex, Door_Type0F-Door_TypeIndex
  104. dc.w Door_Type10-Door_TypeIndex, Door_Type11-Door_TypeIndex
  105. dc.w Door_Type12-Door_TypeIndex, Door_Type13-Door_TypeIndex
  106. rts
  107.  
  108. ;Bonus Stage return door
  109. ;Returns Sonic back to zone (the one prior to warping to a bonus stage level)
  110. Door_Type00:
  111. ;Fetch hard-coded positions for each level to return to here into d2 and d3 from an array
  112. ;!@ Copied from StartLocArray (in "LevelSizeLoad & BgScrollSpeed.asm")
  113. move.w (v_warp_zone).w,d0
  114. lsl.b #6,d0
  115. lsr.w #4,d0
  116. lea Warp00Array(pc,d0.w),a1 ; load Sonic's start location
  117. moveq #0,d1
  118. move.w (a1)+,d1
  119. move.w d1,d2 ;x location
  120. moveq #0,d0
  121. move.w (a1),d0 ;y location
  122. move.w d0,d3
  123.  
  124. ;move.w #$E20, d2
  125. ;move.w #$60, d3
  126. move.w (v_warp_zone).w, d4
  127. move.b #2, d5 ;Set warp flag!
  128. bsr.w DoWarp
  129. rts
  130.  
  131. ;!@ When adding more zones, modify this! Based off Start Location Array - Levels.asm
  132. Warp00Array:
  133. ;GHZ
  134. dc.w $80,$A8
  135. dc.w $80,$A8
  136. dc.w $80,$A8
  137. dc.w $80,$A8
  138.  
  139. ;LZ/SBZ3
  140. dc.w $80,$A8
  141. dc.w $80,$A8
  142. dc.w $80,$A8
  143. dc.w $80,$A8
  144.  
  145. ;MZ
  146. dc.w $0570,$0440
  147. dc.w $00BA,$0545
  148. dc.w $0C65,$0055
  149. dc.w $80,$A8
  150.  
  151. ;SLZ
  152. dc.w $80,$A8
  153. dc.w $80,$A8
  154. dc.w $80,$A8
  155. dc.w $80,$A8
  156.  
  157. ;SYZ
  158. dc.w $80,$A8
  159. dc.w $128C,$0265
  160. dc.w $0415,$0050
  161. dc.w $80,$A8
  162.  
  163. ;SBZ/FZ/Nada
  164. dc.w $80,$A8
  165. dc.w $80,$A8
  166. dc.w $80,$A8
  167. dc.w $80,$A8
  168.  
  169. ;END1,2,Null,Null
  170. dc.w $80,$A8
  171. dc.w $80,$A8
  172. dc.w $80,$A8
  173. dc.w $80,$A8
  174.  
  175. ;BZL
  176. dc.w $80,$A8
  177. dc.w $80,$A8
  178. dc.w $80,$A8
  179. dc.w $80,$A8
  180.  
  181. ;BZF
  182. dc.w $80,$A8
  183. dc.w $80,$A8
  184. dc.w $80,$A8
  185. dc.w $80,$A8
  186.  
  187. ;BZC
  188. dc.w $80,$A8
  189. dc.w $80,$A8
  190. dc.w $80,$A8
  191. dc.w $80,$A8
  192.  
  193. ;BZLa
  194. dc.w $80,$A8
  195. dc.w $80,$A8
  196. dc.w $80,$A8
  197. dc.w $80,$A8
  198.  
  199. even
  200. zonewarning Warp00Array,$10
  201.  
  202. ;Goes to Bonus stage levels
  203. ;Hack will have 4 bonus stage types
  204. ;Currently setting all to SBZ A3 (Final Zone) for testing
  205.  
  206. ;Bonus Stage 1 - Lights
  207. Door_Type0F:
  208. move.w #$0702, d4 ;BZL3
  209. jmp Door_Bonus
  210.  
  211. Door_Type0B:
  212. move.w #$0701, d4 ;BZL2
  213. jmp Door_Bonus
  214.  
  215. Door_Type01:
  216. move.w #$0700, d4 ;BZL1
  217. jmp Door_Bonus
  218.  
  219. ;!@ Debug door (goto any level)
  220. Door_Type13:
  221. move.w #$0403, d4 ;OCZ4 (HSZ3)
  222. jmp Door_Bonus
  223.  
  224. Door_Bonus:
  225. ;If options set to skip bonus zone, skip it
  226. tst.b (f_Bonus).w
  227. bne.s SkipBonus
  228. move.w (v_zone).w, (v_warp_zone).w
  229. move.w #0, d2 ;Goto start posx
  230. move.w #0, d3 ;Goto start posy
  231. move.b #2, d5 ;Set warp flag!
  232. bsr.w DoWarp
  233. rts
  234.  
  235. SkipBonus:
  236. move.w (v_zone).w, (v_warp_zone).w
  237. bra.w Door_Type00
  238. rts
  239.  
  240. ;Bonus Stage 2 - Fence
  241. Door_Type10:
  242. move.w #$0802, d4 ;!@Goto SBZ2 (FZ) for now
  243. jmp Door_Bonus
  244. Door_Type0C:
  245. move.w #$0801, d4 ;!@Goto SBZ2 (FZ) for now
  246. jmp Door_Bonus
  247.  
  248. Door_Type02:
  249. move.w #$0800, d4 ;!@Goto SBZ2 (FZ) for now
  250. jmp Door_Bonus
  251.  
  252.  
  253.  
  254. ;Bonus Stage 3 - Castle
  255. Door_Type11:
  256. move.w #$0902, d4 ;!@Goto SBZ2 (FZ) for now
  257. jmp Door_Bonus
  258.  
  259. Door_Type0D:
  260. move.w #$0901, d4 ;!@Goto SBZ2 (FZ) for now
  261. jmp Door_Bonus
  262.  
  263. Door_Type03:
  264. move.w #$0900, d4 ;!@Goto SBZ2 (FZ) for now
  265. jmp Door_Bonus
  266. rts
  267.  
  268. ;Bonus Stage 4 - Lava
  269. Door_Type12:
  270. move.w #$0A02, d4 ;!@Goto SBZ2 (FZ) for now
  271. jmp Door_Bonus
  272.  
  273. Door_Type0E:
  274. move.w #$0A01, d4 ;!@Goto SBZ2 (FZ) for now
  275. jmp Door_Bonus
  276.  
  277. Door_Type04:
  278. move.w #$0A00, d4 ;!@Goto SBZ2 (FZ) for now
  279. jmp Door_Bonus
  280. rts
  281.  
  282.  
  283. ;Inter-level door 1
  284. Door_Type05:
  285.  
  286. ;Fetch hard-coded positions for each level to return to here into d2 and d3 from an array
  287. ;!@ Copied from StartLocArray (in "LevelSizeLoad & BgScrollSpeed.asm")
  288. move.w (v_zone).w,d0
  289. lsl.b #6,d0
  290. lsr.w #4,d0
  291. lea Warp05Array(pc,d0.w),a1 ; load Sonic's start location
  292. moveq #0,d1
  293. move.w (a1)+,d1
  294. move.w d1,d2 ;x location
  295. moveq #0,d0
  296. move.w (a1),d0 ;y location
  297. move.w d0,d3
  298.  
  299. move.w (v_zone).w, d4
  300. move.b #1, d5 ;Set warp flag!
  301. bsr.w DoWarp
  302. rts
  303.  
  304. ;!@NEW Level
  305. Warp05Array:
  306. ;GHZ
  307. dc.w $80,$A8
  308. dc.w $80,$A8
  309. dc.w $80,$A8
  310. dc.w $80,$A8
  311.  
  312. ;LZ/SBZ3
  313. dc.w $80,$A8
  314. dc.w $80,$A8
  315. dc.w $80,$A8
  316. dc.w $80,$A8
  317.  
  318. ;MZ
  319. dc.w $80,$A8
  320. dc.w $09C0, $0230
  321. dc.w $1755,$0270 ;Boss door (with pal change)
  322. dc.w $80,$A8
  323.  
  324. ;SLZ
  325. dc.w $80,$A8
  326. dc.w $80,$A8
  327. dc.w $80,$A8
  328. dc.w $80,$A8
  329.  
  330. ;SYZ
  331. dc.w $80,$A8
  332. dc.w $0AB5,$80
  333. dc.w $10A0,$0275 ;Boss door (with pal change)
  334. dc.w $80,$A8
  335.  
  336. ;SBZ/FZ/Nada
  337. dc.w $80,$A8
  338. dc.w $80,$A8
  339. dc.w $80,$A8
  340. dc.w $80,$A8
  341.  
  342. ;END1,2,Null,Null
  343. dc.w $80,$A8
  344. dc.w $80,$A8
  345. dc.w $80,$A8
  346. dc.w $80,$A8
  347.  
  348. ;BZL
  349. dc.w $80,$A8
  350. dc.w $80,$A8
  351. dc.w $80,$A8
  352. dc.w $80,$A8
  353.  
  354. ;BZF
  355. dc.w $80,$A8
  356. dc.w $80,$A8
  357. dc.w $80,$A8
  358. dc.w $80,$A8
  359.  
  360. ;BZC
  361. dc.w $80,$A8
  362. dc.w $80,$A8
  363. dc.w $80,$A8
  364. dc.w $80,$A8
  365.  
  366. ;BZLa
  367. dc.w $80,$A8
  368. dc.w $80,$A8
  369. dc.w $80,$A8
  370. dc.w $80,$A8
  371.  
  372. even
  373. zonewarning Warp05Array,$10
  374.  
  375.  
  376. ;Inter-level door 2
  377. Door_Type06:
  378.  
  379. ;Fetch hard-coded positions for each level to return to here into d2 and d3 from an array
  380. ;!@ Copied from StartLocArray (in "LevelSizeLoad & BgScrollSpeed.asm")
  381. move.w (v_zone).w,d0
  382. lsl.b #6,d0
  383. lsr.w #4,d0
  384. lea Warp06Array(pc,d0.w),a1 ; load Sonic's start location
  385. moveq #0,d1
  386. move.w (a1)+,d1
  387. move.w d1,d2 ;x location
  388. moveq #0,d0
  389. move.w (a1),d0 ;y location
  390. move.w d0,d3
  391.  
  392. move.w (v_zone).w, d4
  393. move.b #1, d5 ;Set warp flag!
  394. bsr.w DoWarp
  395. rts
  396.  
  397. ;!@NEW Level
  398. Warp06Array:
  399. ;GHZ
  400. dc.w $80,$A8
  401. dc.w $80,$A8
  402. dc.w $80,$A8
  403. dc.w $80,$A8
  404.  
  405. ;LZ/SBZ3
  406. dc.w $80,$A8
  407. dc.w $80,$A8
  408. dc.w $80,$A8
  409. dc.w $80,$A8
  410.  
  411. ;MZ
  412. dc.w $80,$A8
  413. dc.w $80,$A8
  414. dc.w $80,$A8
  415. dc.w $80,$A8
  416.  
  417. ;SLZ
  418. dc.w $80,$A8
  419. dc.w $80,$A8
  420. dc.w $80,$A8
  421. dc.w $80,$A8
  422.  
  423. ;SYZ
  424. dc.w $80,$A8
  425. dc.w $0268,$0540
  426. dc.w $80,$A8
  427. dc.w $80,$A8
  428.  
  429. ;SBZ/FZ/Nada
  430. dc.w $80,$A8
  431. dc.w $80,$A8
  432. dc.w $80,$A8
  433. dc.w $80,$A8
  434.  
  435. ;END1,2,Null,Null
  436. dc.w $80,$A8
  437. dc.w $80,$A8
  438. dc.w $80,$A8
  439. dc.w $80,$A8
  440.  
  441. ;BZL
  442. dc.w $80,$A8
  443. dc.w $80,$A8
  444. dc.w $80,$A8
  445. dc.w $80,$A8
  446.  
  447. ;BZF
  448. dc.w $80,$A8
  449. dc.w $80,$A8
  450. dc.w $80,$A8
  451. dc.w $80,$A8
  452.  
  453. ;BZC
  454. dc.w $80,$A8
  455. dc.w $80,$A8
  456. dc.w $80,$A8
  457. dc.w $80,$A8
  458.  
  459. ;BZLa
  460. dc.w $80,$A8
  461. dc.w $80,$A8
  462. dc.w $80,$A8
  463. dc.w $80,$A8
  464.  
  465. even
  466. zonewarning Warp06Array,$10
  467.  
  468. ;Inter-level door 3
  469. Door_Type07:
  470.  
  471. ;Fetch hard-coded positions for each level to return to here into d2 and d3 from an array
  472. ;!@ Copied from StartLocArray (in "LevelSizeLoad & BgScrollSpeed.asm")
  473. move.w (v_zone).w,d0
  474. lsl.b #6,d0
  475. lsr.w #4,d0
  476. lea Warp07Array(pc,d0.w),a1 ; load Sonic's start location
  477. moveq #0,d1
  478. move.w (a1)+,d1
  479. move.w d1,d2 ;x location
  480. moveq #0,d0
  481. move.w (a1),d0 ;y location
  482. move.w d0,d3
  483.  
  484. move.w (v_zone).w, d4
  485. move.b #1, d5 ;Set warp flag!
  486. bsr.w DoWarp
  487. rts
  488.  
  489. ;!@NEW Level
  490. Warp07Array:
  491. ;GHZ
  492. dc.w $80,$A8
  493. dc.w $80,$A8
  494. dc.w $80,$A8
  495. dc.w $80,$A8
  496.  
  497. ;LZ/SBZ3
  498. dc.w $80,$A8
  499. dc.w $80,$A8
  500. dc.w $80,$A8
  501. dc.w $80,$A8
  502.  
  503. ;MZ
  504. dc.w $80,$A8
  505. dc.w $80,$A8
  506. dc.w $80,$A8
  507. dc.w $80,$A8
  508.  
  509. ;SLZ
  510. dc.w $80,$A8
  511. dc.w $80,$A8
  512. dc.w $80,$A8
  513. dc.w $80,$A8
  514.  
  515. ;SYZ
  516. dc.w $80,$A8
  517. dc.w $0398,$0560
  518. dc.w $80,$A8
  519. dc.w $80,$A8
  520.  
  521. ;SBZ/FZ/Nada
  522. dc.w $80,$A8
  523. dc.w $80,$A8
  524. dc.w $80,$A8
  525. dc.w $80,$A8
  526.  
  527. ;END1,2,Null,Null
  528. dc.w $80,$A8
  529. dc.w $80,$A8
  530. dc.w $80,$A8
  531. dc.w $80,$A8
  532.  
  533. ;BZL
  534. dc.w $80,$A8
  535. dc.w $80,$A8
  536. dc.w $80,$A8
  537. dc.w $80,$A8
  538.  
  539. ;BZF
  540. dc.w $80,$A8
  541. dc.w $80,$A8
  542. dc.w $80,$A8
  543. dc.w $80,$A8
  544.  
  545. ;BZC
  546. dc.w $80,$A8
  547. dc.w $80,$A8
  548. dc.w $80,$A8
  549. dc.w $80,$A8
  550.  
  551. ;BZLa
  552. dc.w $80,$A8
  553. dc.w $80,$A8
  554. dc.w $80,$A8
  555. dc.w $80,$A8
  556.  
  557. even
  558. zonewarning Warp07Array,$10
  559.  
  560. ;Inter-level door 4
  561. Door_Type08:
  562.  
  563. ;Fetch hard-coded positions for each level to return to here into d2 and d3 from an array
  564. ;!@ Copied from StartLocArray (in "LevelSizeLoad & BgScrollSpeed.asm")
  565. move.w (v_zone).w,d0
  566. lsl.b #6,d0
  567. lsr.w #4,d0
  568. lea Warp08Array(pc,d0.w),a1 ; load Sonic's start location
  569. moveq #0,d1
  570. move.w (a1)+,d1
  571. move.w d1,d2 ;x location
  572. moveq #0,d0
  573. move.w (a1),d0 ;y location
  574. move.w d0,d3
  575.  
  576. move.w (v_zone).w, d4
  577. move.b #1, d5 ;Set warp flag!
  578. bsr.w DoWarp
  579. rts
  580.  
  581. ;!@NEW Level
  582. Warp08Array:
  583. ;GHZ
  584. dc.w $80,$A8
  585. dc.w $80,$A8
  586. dc.w $80,$A8
  587. dc.w $80,$A8
  588.  
  589. ;LZ/SBZ3
  590. dc.w $80,$A8
  591. dc.w $80,$A8
  592. dc.w $80,$A8
  593. dc.w $80,$A8
  594.  
  595. ;MZ
  596. dc.w $80,$A8
  597. dc.w $80,$A8
  598. dc.w $80,$A8
  599. dc.w $80,$A8
  600.  
  601. ;SLZ
  602. dc.w $80,$A8
  603. dc.w $80,$A8
  604. dc.w $80,$A8
  605. dc.w $80,$A8
  606.  
  607. ;SYZ
  608. dc.w $80,$A8
  609. dc.w $047B,$0560
  610. dc.w $80,$A8
  611. dc.w $80,$A8
  612.  
  613. ;SBZ/FZ/Nada
  614. dc.w $80,$A8
  615. dc.w $80,$A8
  616. dc.w $80,$A8
  617. dc.w $80,$A8
  618.  
  619. ;END1,2,Null,Null
  620. dc.w $80,$A8
  621. dc.w $80,$A8
  622. dc.w $80,$A8
  623. dc.w $80,$A8
  624.  
  625. ;BZL
  626. dc.w $80,$A8
  627. dc.w $80,$A8
  628. dc.w $80,$A8
  629. dc.w $80,$A8
  630.  
  631. ;BZF
  632. dc.w $80,$A8
  633. dc.w $80,$A8
  634. dc.w $80,$A8
  635. dc.w $80,$A8
  636.  
  637. ;BZC
  638. dc.w $80,$A8
  639. dc.w $80,$A8
  640. dc.w $80,$A8
  641. dc.w $80,$A8
  642.  
  643. ;BZLa
  644. dc.w $80,$A8
  645. dc.w $80,$A8
  646. dc.w $80,$A8
  647. dc.w $80,$A8
  648.  
  649. even
  650. zonewarning Warp08Array,$10
  651.  
  652.  
  653. ;Inter-level door 5
  654. Door_Type09:
  655.  
  656. ;Fetch hard-coded positions for each level to return to here into d2 and d3 from an array
  657. ;!@ Copied from StartLocArray (in "LevelSizeLoad & BgScrollSpeed.asm")
  658. move.w (v_zone).w,d0
  659. lsl.b #6,d0
  660. lsr.w #4,d0
  661. lea Warp09Array(pc,d0.w),a1 ; load Sonic's start location
  662. moveq #0,d1
  663. move.w (a1)+,d1
  664. move.w d1,d2 ;x location
  665. moveq #0,d0
  666. move.w (a1),d0 ;y location
  667. move.w d0,d3
  668.  
  669. move.w (v_zone).w, d4
  670. move.b #1, d5 ;Set warp flag!
  671. bsr.w DoWarp
  672. rts
  673.  
  674. ;!@NEW Level
  675. Warp09Array:
  676. ;GHZ
  677. dc.w $80,$A8
  678. dc.w $80,$A8
  679. dc.w $80,$A8
  680. dc.w $80,$A8
  681.  
  682. ;LZ/SBZ3
  683. dc.w $80,$A8
  684. dc.w $80,$A8
  685. dc.w $80,$A8
  686. dc.w $80,$A8
  687.  
  688. ;MZ
  689. dc.w $80,$A8
  690. dc.w $80,$A8
  691. dc.w $80,$A8
  692. dc.w $80,$A8
  693.  
  694. ;SLZ
  695. dc.w $80,$A8
  696. dc.w $80,$A8
  697. dc.w $80,$A8
  698. dc.w $80,$A8
  699.  
  700. ;SYZ
  701. dc.w $80,$A8
  702. dc.w $0740,$05A5
  703. dc.w $80,$A8
  704. dc.w $80,$A8
  705.  
  706. ;SBZ/FZ/Nada
  707. dc.w $80,$A8
  708. dc.w $80,$A8
  709. dc.w $80,$A8
  710. dc.w $80,$A8
  711.  
  712. ;END1,2,Null,Null
  713. dc.w $80,$A8
  714. dc.w $80,$A8
  715. dc.w $80,$A8
  716. dc.w $80,$A8
  717.  
  718. ;BZL
  719. dc.w $80,$A8
  720. dc.w $80,$A8
  721. dc.w $80,$A8
  722. dc.w $80,$A8
  723.  
  724. ;BZF
  725. dc.w $80,$A8
  726. dc.w $80,$A8
  727. dc.w $80,$A8
  728. dc.w $80,$A8
  729.  
  730. ;BZC
  731. dc.w $80,$A8
  732. dc.w $80,$A8
  733. dc.w $80,$A8
  734. dc.w $80,$A8
  735.  
  736. ;BZLa
  737. dc.w $80,$A8
  738. dc.w $80,$A8
  739. dc.w $80,$A8
  740. dc.w $80,$A8
  741.  
  742. even
  743. zonewarning Warp09Array,$10
  744.  
  745. ;Inter-level door 6
  746. Door_Type0A:
  747.  
  748. ;Fetch hard-coded positions for each level to return to here into d2 and d3 from an array
  749. ;!@ Copied from StartLocArray (in "LevelSizeLoad & BgScrollSpeed.asm")
  750. move.w (v_zone).w,d0
  751. lsl.b #6,d0
  752. lsr.w #4,d0
  753. lea Warp0AArray(pc,d0.w),a1 ; load Sonic's start location
  754. moveq #0,d1
  755. move.w (a1)+,d1
  756. move.w d1,d2 ;x location
  757. moveq #0,d0
  758. move.w (a1),d0 ;y location
  759. move.w d0,d3
  760.  
  761. move.w (v_zone).w, d4
  762. move.b #1, d5 ;Set warp flag!
  763. bsr.w DoWarp
  764. rts
  765.  
  766. ;!@NEW Level
  767. Warp0AArray:
  768. ;GHZ
  769. dc.w $80,$A8
  770. dc.w $80,$A8
  771. dc.w $80,$A8
  772. dc.w $80,$A8
  773.  
  774. ;LZ/SBZ3
  775. dc.w $80,$A8
  776. dc.w $80,$A8
  777. dc.w $80,$A8
  778. dc.w $80,$A8
  779.  
  780. ;MZ
  781. dc.w $80,$A8
  782. dc.w $80,$A8
  783. dc.w $80,$A8
  784. dc.w $80,$A8
  785.  
  786. ;SLZ
  787. dc.w $80,$A8
  788. dc.w $80,$A8
  789. dc.w $80,$A8
  790. dc.w $80,$A8
  791.  
  792. ;SYZ
  793. dc.w $80,$A8
  794. dc.w $1338,$0345
  795. dc.w $80,$A8
  796. dc.w $80,$A8
  797.  
  798. ;SBZ/FZ/Nada
  799. dc.w $80,$A8
  800. dc.w $80,$A8
  801. dc.w $80,$A8
  802. dc.w $80,$A8
  803.  
  804. ;END1,2,Null,Null
  805. dc.w $80,$A8
  806. dc.w $80,$A8
  807. dc.w $80,$A8
  808. dc.w $80,$A8
  809.  
  810. ;BZL
  811. dc.w $80,$A8
  812. dc.w $80,$A8
  813. dc.w $80,$A8
  814. dc.w $80,$A8
  815.  
  816. ;BZF
  817. dc.w $80,$A8
  818. dc.w $80,$A8
  819. dc.w $80,$A8
  820. dc.w $80,$A8
  821.  
  822. ;BZC
  823. dc.w $80,$A8
  824. dc.w $80,$A8
  825. dc.w $80,$A8
  826. dc.w $80,$A8
  827.  
  828. ;BZLa
  829. dc.w $80,$A8
  830. dc.w $80,$A8
  831. dc.w $80,$A8
  832. dc.w $80,$A8
  833.  
  834. even
  835. zonewarning Warp09Array,$10
  836.  
  837. ; ---------------------------------------------------------------------------
  838. ; Subroutine to apply warp params and do the warp
  839. ; ---------------------------------------------------------------------------
  840. DoWarp:
  841.  
  842. ;Params for $4f obj:
  843. ;d2 - X coord to warp to
  844. ;d3 - Y coord to warp to
  845. ;d4 - Zone/Act to warp to (zzaa, 2 bytes)
  846. ;d5 - Warp type (1 or 2 value for f_warp)
  847. ;0=no warp
  848. ;1=inter-level warp (skip Title cards, keep rings/time. If die, go back to previous starpost (if any)
  849. ;2=bonus stage warp (keep rings/time. If die, go back to previous stage.)
  850. ;3=you died in High Speed Zone special stage, go back to previous stage (internally set in game).
  851.  
  852. ;Move the data from regs to appropriate vars for warp
  853. ;sfx sfx_EnterSS,0,1,0 ; play special stage entry sound
  854. move.w d2, (v_warp_x).w
  855. move.w d3, (v_warp_y).w
  856. move.w d4, (v_zone).w ;Zone/Act
  857. move.b d5, (f_warp).w ;Set warp flag!
  858. move.b #1, (f_restart).w ;Do the warp!
  859. rts
  860.  
  861. ; ===========================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement