sprite_routines.s 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. SCANNER_X EQU 16
  2. SCANNER_Y EQU 185
  3. SCANNER_HEIGHT EQU 46
  4. PAUSE_X EQU 139
  5. PAUSE_Y EQU 115
  6. PAUSE_HEIGHT EQU 9
  7. ***************************************
  8. ***** SETUP SCANNER *****
  9. ***************************************
  10. Setup_Scanner
  11. move.w #SCANNER_X,d0
  12. move.w #SCANNER_Y,d1
  13. move.w #SCANNER_HEIGHT,d2
  14. move.l #scanner1,a0
  15. movem.l d0-d2,-(sp)
  16. bsr Position_Any_Sprite
  17. movem.l (sp)+,d0-d2
  18. add.w #16,d0
  19. move.l #scanner2,a0
  20. movem.l d0-d2,-(sp)
  21. bsr Position_Any_Sprite
  22. movem.l (sp)+,d0-d2
  23. add.w #16,d0
  24. rts
  25. ***************************************
  26. ***** DISPLAY SCANNER *****
  27. ***************************************
  28. Display_Scanner
  29. move.l #scanner1,d0
  30. move.w d0,sprite4l
  31. swap d0
  32. move.w d0,sprite4h
  33. move.l #scanner2,d0
  34. move.w d0,sprite5l
  35. swap d0
  36. move.w d0,sprite5h
  37. move.l #blank_data,d0
  38. move.w d0,sprite6l
  39. swap d0
  40. move.w d0,sprite6h
  41. move.l #blank_data,d0
  42. move.w d0,sprite7l
  43. swap d0
  44. move.w d0,sprite7h
  45. rts
  46. ***************************************
  47. ***** REMOVE SCANNER *****
  48. ***************************************
  49. Remove_Scanner
  50. move.l #blank_data,d0
  51. move.w d0,sprite4l
  52. swap d0
  53. move.w d0,sprite4h
  54. move.l #blank_data,d0
  55. move.w d0,sprite5l
  56. swap d0
  57. move.w d0,sprite5h
  58. move.l #blank_data,d0
  59. move.w d0,sprite6l
  60. swap d0
  61. move.w d0,sprite6h
  62. move.l #blank_data,d0
  63. move.w d0,sprite7l
  64. swap d0
  65. move.w d0,sprite7h
  66. rts
  67. blank_sprite
  68. ds.w 6
  69. ***************************************
  70. ***** POSITION ANY SPRITE *****
  71. ***************************************
  72. Position_Any_Sprite
  73. *send in data in a0
  74. *x in d0
  75. *y in d1
  76. *height in d2
  77. add.w #$81-1,d0 ;tricky positioning
  78. move.b #0,3(A0)
  79. asr.w d0
  80. bcc.s genno_bit_set
  81. bset #0,3(a0)
  82. genno_bit_set
  83. move.b d0,1(a0)
  84. add.w #$2c,d1
  85. btst #8,d1
  86. beq.s gennot_vert_set
  87. bset #2,3(a0)
  88. gennot_vert_set
  89. move.b d1,(a0)
  90. add.w d2,d1
  91. btst #8,d1
  92. beq.s gennot_vstop_set
  93. bset #1,3(a0)
  94. gennot_vstop_set
  95. move.b d1,2(a0)
  96. rts
  97. *****************************************
  98. *** Display_Pause *****
  99. *****************************************
  100. Display_Pause
  101. move.w #PAUSE_X,d0
  102. move.w #PAUSE_Y,d1
  103. move.w #PAUSE_HEIGHT,d2
  104. move.l #pause1,a0
  105. movem.l d0-d2,-(sp)
  106. bsr Position_Any_Sprite
  107. movem.l (sp)+,d0-d2
  108. add.w #16,d0
  109. move.l #pause2,a0
  110. movem.l d0-d2,-(sp)
  111. bsr Position_Any_Sprite
  112. movem.l (sp)+,d0-d2
  113. add.w #16,d0
  114. move.l #pause3,a0
  115. movem.l d0-d2,-(sp)
  116. bsr Position_Any_Sprite
  117. movem.l (sp)+,d0-d2
  118. move.l #pause1,d0
  119. move.w d0,sprite0l
  120. swap d0
  121. move.w d0,sprite0h
  122. move.l #pause2,d0
  123. move.w d0,sprite1l
  124. swap d0
  125. move.w d0,sprite1h
  126. move.l #pause3,d0
  127. move.w d0,sprite2l
  128. swap d0
  129. move.w d0,sprite2h
  130. move.l #Blank_Data,d0
  131. move.w d0,sprite3l
  132. swap d0
  133. move.w d0,sprite3h
  134. rts
  135. ***************************************
  136. ***** SET UP TEXT SPRITE COLS *****
  137. ***************************************
  138. Set_Up_Text_Sprite_Cols
  139. move.w #$1A0,d0
  140. move.w #8-1,d1
  141. move.l #sprite_cols,a0
  142. move.l #text_cols,a1
  143. sp_text_col_loop
  144. move.w d0,(a0)+
  145. move.w (a1)+,(a0)+
  146. add.w #$2,d0
  147. dbra d1,sp_text_col_loop
  148. rts
  149. text_cols
  150. dc.w 0,$b11,0,$f00
  151. dc.w 0,$b11,0,$f00
  152. ***************************************
  153. ***** REMOVE SPRITE TEXT *****
  154. ***************************************
  155. Remove_Sprite_Text
  156. move.l #blank_sprite,d0
  157. move.w d0,sprite0l
  158. swap d0
  159. move.w d0,sprite0h
  160. move.l #blank_sprite,d0
  161. move.w d0,sprite1l
  162. swap d0
  163. move.w d0,sprite1h
  164. move.l #blank_sprite,d0
  165. move.w d0,sprite2l
  166. swap d0
  167. move.w d0,sprite2h
  168. rts
  169. ***************************************
  170. ***** FLASH PAUSE ******
  171. ***************************************
  172. Flash_Pause
  173. subq.w #1,pause_wait_count
  174. bgt.s dont_change_flag
  175. move.w #PAUSE_WAIT,pause_wait_count
  176. bchg.b #0,pause_flag
  177. beq.s display_the_pause
  178. bsr Remove_Sprite_Text
  179. bra.s dont_change_flag
  180. display_the_pause
  181. bsr Display_Pause
  182. dont_change_flag
  183. rts
  184. rts
  185. PAUSE_WAIT EQU 15
  186. pause_wait_count
  187. dc.w PAUSE_WAIT
  188. pause_flag
  189. dc.w 0
  190. even