block_effects.s 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. *------------------------------------------------------------------------*
  2. *- I did have some cool code in here for chain re-action block -*
  3. *- But Myles would not do any graphics especially for them! -*
  4. *------------------------------------------------------------------------*
  5. *****************************************
  6. **** DRAW BLOCK INTO COPYBACK *****-
  7. *****************************************
  8. Draw_Block_Into_CopyBack
  9. *Send x and y in d0 and d1
  10. *Send graphics in a5
  11. Wait_For_Block_Go
  12. btst #14,dmaconr(a6)
  13. bne.s Wait_For_Block_Go
  14. move.l #$ffffffff,bltafwm(a6)
  15. move.l #$09f00000,bltcon0(a6)
  16. clr.w bltamod(a6)
  17. move.l current_alien_draw_position,a3
  18. andi.w #$fff0,d0
  19. asr.w #3,d0
  20. ext.l d0
  21. move.w d1,d7
  22. muls #BPR,d1
  23. *----test to see if alien over split point---------------
  24. cmp.w split_position,d7
  25. blt block_not_split
  26. sub.l #SCROLL_HEIGHT*BPR,a3
  27. block_not_split
  28. add.l d1,a3 ;y position
  29. add.l add_size,a3 ;copy back pos
  30. add.l d0,a3 ;x position
  31. move.l a3,bltdpth(a6) ;dest
  32. move.l a5,bltapth(a6)
  33. move.w #BPR-2,bltdmod(a6)
  34. move.w #16<<6+1,bltsize(a6)
  35. wait_for_block_to_draw_p1
  36. btst #14,dmaconr(a6)
  37. bne.s wait_for_block_to_draw_p1
  38. add.l #PLANE_INC,a3 ;next plane
  39. add.l #16*2,a5 ;next bob plane
  40. move.l a3,bltdpth(a6) ;dest
  41. move.l a5,bltapth(a6)
  42. move.w #16<<6+1,bltsize(a6)
  43. wait_for_block_to_draw_p2
  44. btst #14,dmaconr(a6)
  45. bne.s wait_for_block_to_draw_p2
  46. add.l #PLANE_INC,a3 ;next plane
  47. add.l #16*2,a5 ;next bob plane
  48. move.l a3,bltdpth(a6) ;dest
  49. move.l a5,bltapth(a6)
  50. move.w #16<<6+1,bltsize(a6)
  51. wait_for_block_to_draw_p3
  52. btst #14,dmaconr(a6)
  53. bne.s wait_for_block_to_draw_p3
  54. add.l #PLANE_INC,a3 ;next plane
  55. add.l #16*2,a5 ;next bob plane
  56. move.l a3,bltdpth(a6) ;dest
  57. move.l a5,bltapth(a6)
  58. move.w #16<<6+1,bltsize(a6)
  59. wait_for_block_to_draw_p4
  60. btst #14,dmaconr(a6)
  61. bne.s wait_for_block_to_draw_p4
  62. finished_drawing_single_block
  63. rts
  64. **********************************************
  65. **** DRAW 68000 BLOCK INTO COPYBACK *****
  66. **********************************************
  67. Draw_68000_Block_Into_CopyBack
  68. *Send x and y in d0 and d1
  69. *Send block number in d2
  70. cmp.w #BLK_X_MIN,d0
  71. blt dont_draw_68000_block
  72. cmp.w #BLK_X_MAX,d0
  73. bgt dont_draw_68000_block
  74. cmp.w #BLK_Y_MIN,d1
  75. blt dont_draw_68000_block
  76. cmp.w #BLK_Y_MAX,d1
  77. bgt dont_draw_68000_block
  78. ext.l d2
  79. move.l background_block_graphics,a5
  80. asl.l #7,d2
  81. add.l d2,a5 ;block graphics
  82. move.l current_alien_draw_position,a3
  83. andi.w #$fff0,d0
  84. asr.w #3,d0
  85. ext.l d0
  86. move.w d1,d7
  87. muls #BPR,d1
  88. *----test to see if alien over split point---------------
  89. cmp.w split_position,d7
  90. blt block_not_split68000
  91. sub.l #SCROLL_HEIGHT*BPR,a3
  92. block_not_split68000
  93. add.l d1,a3 ;y position
  94. add.l add_size,a3 ;copy back pos
  95. add.l d0,a3 ;x position
  96. move.w (a5)+,(a3)
  97. move.w (a5)+,BPR(a3)
  98. move.w (a5)+,BPR*2(a3)
  99. move.w (a5)+,BPR*3(a3)
  100. move.w (a5)+,BPR*4(a3)
  101. move.w (a5)+,BPR*5(a3)
  102. move.w (a5)+,BPR*6(a3)
  103. move.w (a5)+,BPR*7(a3)
  104. move.w (a5)+,BPR*8(a3)
  105. move.w (a5)+,BPR*9(a3)
  106. move.w (a5)+,BPR*10(a3)
  107. move.w (a5)+,BPR*11(a3)
  108. move.w (a5)+,BPR*12(a3)
  109. move.w (a5)+,BPR*13(a3)
  110. move.w (a5)+,BPR*14(a3)
  111. move.w (a5)+,BPR*15(a3)
  112. add.l #PLANE_INC,a3
  113. move.w (a5)+,(a3)
  114. move.w (a5)+,BPR(a3)
  115. move.w (a5)+,BPR*2(a3)
  116. move.w (a5)+,BPR*3(a3)
  117. move.w (a5)+,BPR*4(a3)
  118. move.w (a5)+,BPR*5(a3)
  119. move.w (a5)+,BPR*6(a3)
  120. move.w (a5)+,BPR*7(a3)
  121. move.w (a5)+,BPR*8(a3)
  122. move.w (a5)+,BPR*9(a3)
  123. move.w (a5)+,BPR*10(a3)
  124. move.w (a5)+,BPR*11(a3)
  125. move.w (a5)+,BPR*12(a3)
  126. move.w (a5)+,BPR*13(a3)
  127. move.w (a5)+,BPR*14(a3)
  128. move.w (a5)+,BPR*15(a3)
  129. add.l #PLANE_INC,a3
  130. move.w (a5)+,(a3)
  131. move.w (a5)+,BPR(a3)
  132. move.w (a5)+,BPR*2(a3)
  133. move.w (a5)+,BPR*3(a3)
  134. move.w (a5)+,BPR*4(a3)
  135. move.w (a5)+,BPR*5(a3)
  136. move.w (a5)+,BPR*6(a3)
  137. move.w (a5)+,BPR*7(a3)
  138. move.w (a5)+,BPR*8(a3)
  139. move.w (a5)+,BPR*9(a3)
  140. move.w (a5)+,BPR*10(a3)
  141. move.w (a5)+,BPR*11(a3)
  142. move.w (a5)+,BPR*12(a3)
  143. move.w (a5)+,BPR*13(a3)
  144. move.w (a5)+,BPR*14(a3)
  145. move.w (a5)+,BPR*15(a3)
  146. add.l #PLANE_INC,a3
  147. move.w (a5)+,(a3)
  148. move.w (a5)+,BPR(a3)
  149. move.w (a5)+,BPR*2(a3)
  150. move.w (a5)+,BPR*3(a3)
  151. move.w (a5)+,BPR*4(a3)
  152. move.w (a5)+,BPR*5(a3)
  153. move.w (a5)+,BPR*6(a3)
  154. move.w (a5)+,BPR*7(a3)
  155. move.w (a5)+,BPR*8(a3)
  156. move.w (a5)+,BPR*9(a3)
  157. move.w (a5)+,BPR*10(a3)
  158. move.w (a5)+,BPR*11(a3)
  159. move.w (a5)+,BPR*12(a3)
  160. move.w (a5)+,BPR*13(a3)
  161. move.w (a5)+,BPR*14(a3)
  162. move.w (a5)+,BPR*15(a3)
  163. dont_draw_68000_block
  164. rts