home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Assembler / dse-src6.dms / in.adf / BOUNCHSRCS.LZH / scrolly.S < prev    next >
Encoding:
Text File  |  1987-05-18  |  4.6 KB  |  234 lines

  1.  
  2. ; ADD THIS TO YOUR COPPERLIST!
  3. dc.l $01001200,$00920030,$009400d8,$008e2471,$0090f4dc,$01020000
  4. ;               SCRN    START---^^      ^^---SCRN END
  5. dc.l $01080008,$010a0008
  6. dc.l $01800000,$01820fff
  7. s_scrollbplane:
  8. dc.l $00e00000,$00e20000
  9.  
  10. ;···········································
  11. ;· SCROLLROUTINE CODED BY CHUCKY OF SARGON ·
  12. ;·         SOURCE CAN BE SPREADED!         ·
  13. ;···········································
  14.  
  15. s_scroller:    ;Jump to this once every scan!
  16. bsr s_changespeed
  17. cmp.w #0,s_pause
  18. bne s_stannad
  19. move.w s_speed1,d7
  20. s_fart:
  21. bsr s_scroll
  22. dbf d7,s_fart
  23. bsr s_pixelscroll
  24. rts
  25.  
  26. s_changespeed:
  27. move.w s_speed,d0
  28. move.w s_speed1,d1
  29. cmp.w d1,d0
  30. beq s_nochange
  31.  
  32. add.w #1,s_delay
  33. cmp.w #4,s_delay
  34. bne s_nochange
  35. clr.w s_delay
  36.  
  37. cmp.w d1,d0
  38. bgt s_speedover
  39. blt s_speedlower
  40. s_nochange:
  41. rts
  42.  
  43. s_speedover:
  44. add.w #1,s_speed1
  45. rts
  46.  
  47. s_speedlower:
  48. sub.w #1,s_speed1
  49. rts
  50.  
  51. s_stannad:
  52. sub.w #1,s_pause
  53. rts
  54.  
  55. s_scroll:
  56. add.w #1,s_pixel
  57. cmp.w #0,s_pixels
  58. beq s_scroller1
  59. sub.w #$1,s_pixels
  60. rts
  61.  
  62. s_Space:
  63. move.b #$20,d0    ;Make so you can use text from editors like TxED,ED
  64. bra s_forts
  65.  
  66. s_Scroller1:
  67. lea s_scrolltext(pc),a0
  68. move.l s_scrollpos,d0 ;Maximum length of a text is 4294967295 bytes!
  69. add.l d0,a0
  70. clr.l d0
  71. move.b (a0),d0
  72. add.l #1,s_scrollpos
  73. cmp.b #$0,d0
  74. beq s_wrap
  75. cmp.b #';',d0
  76. beq s_command
  77. cmp.b #$a,d0
  78. beq s_space
  79. s_forts:
  80. sub.b #$20,d0
  81. asl #1,d0    ;Mulu #2,d0
  82. lea s_teckenbredd(pc),a0
  83. add.w d0,a0
  84. move.w (a0),s_pixels
  85. lea s_charplus(pc),a0
  86. add.w d0,a0
  87. move.w (a0),s_plus
  88. bsr s_pixelscroll
  89. bsr s_charblit
  90. rts
  91.  
  92. s_Command:
  93. move.b 1(a0),d0
  94. cmp.b #';',d0
  95. beq s_forts    ;no command
  96.  
  97. cmp.b #'P',d0
  98. beq s_spause
  99. cmp.b #'S',d0
  100. beq s_sspeed
  101. rts
  102.  
  103. s_spause:
  104. bsr s_getnumber
  105. mulu #100,d0
  106. move.w d0,s_pause
  107. add.l #2,s_scrollpos
  108. rts
  109.  
  110. s_sspeed:
  111. bsr s_getnumber
  112. move.w d0,s_speed
  113. add.l #2,s_scrollpos
  114. rts
  115.  
  116. s_getnumber:
  117. move.b 2(a0),d0
  118. sub.b #'0',d0
  119. rts
  120.  
  121. s_Wrap:
  122. clr.l s_scrollpos
  123. clr.w s_speed
  124. clr.w s_speed1
  125. bra s_scroller1
  126.  
  127. vblt:
  128. move.w #$09f0,$dff040   ;USE D,A SATT MINTERM D=A
  129. clr.w  $dff042          ;O=BLTCON1
  130. move.w #$ffff,$dff044
  131. move.w #$ffff,$dff046
  132. move.w #$8040,$dff096  ;SATT PA BLITTER DMA
  133. rts
  134.  
  135. s_CharBlit:
  136. bsr vanta
  137. bsr vblt
  138. move.l #s_scrollplane+$30,d0
  139. move.w s_plus,d2
  140. move.l #$50000,d1    ;where the font is!
  141. add.w d2,d1
  142. move.w #0,d2    ;numbers of bitplanes minus one
  143. s_cplanes:
  144. bsr vanta
  145. move.l d1,$dff050   ;A
  146. move.l d0,$dff054   ;D
  147. move.w #0048,$dff066     ;MODULO D
  148. move.w #0036,$dff064     ;MODULO A
  149. move.w #%0000100000000010,$dff058   ;SATT STORLEK,STARTA BLT
  150. ;        hhhhhhhhhhwwwwww
  151. add.w #1728,d0    ;add to next plane on scroll
  152. add.w #4000,d1    ;add to next plane on font
  153. dbf d2,s_cplanes
  154. rts
  155.  
  156. s_PixelScroll:
  157. move.w s_Pixel,d1
  158. cmp.w #0,d1
  159. beq s_nopixel
  160. sub.w #1,d1
  161. bsr vanta
  162. bsr vblt
  163. move.w #$9f0,d0
  164. asl #8,d1
  165. asl #4,d1
  166. eor #$f000,d1
  167. add.w d1,d0
  168. move.w d0,$dff040   ;Shift RIGHT 15 pixels
  169. move.l #s_scrollplane,d0
  170. move.l #s_scrollplane+2,d1
  171. move.w #0,d2    ;numbers of bitplanes minus one!
  172. s_pplanes:
  173. bsr vanta
  174. move.l d1,$dff050   ;A
  175. move.l d0,$dff054   ;D
  176. move.w #0000,$dff066     ;MODULO D
  177. move.w #0000,$dff064     ;MODULO A
  178. move.w #%0000100000011011,$dff058   ;SATT STORLEK,STARTA BLT
  179. ;        hhhhhhhhhhwwwwww
  180. add.w #1728,d0    ;add to the next plane (54 bytes per line)
  181. add.w #1728,d1    ;add to the next plane
  182. dbf d2,s_pplanes
  183. clr.w s_pixel
  184. s_nopixel:
  185. rts
  186.  
  187. vanta:        ;wait until the blitter is ready
  188. btst #14,$dff002
  189. bne vanta
  190. rts
  191.  
  192. s_CharPlus:    ;How much to add to the next char on the font piccy!
  193. dc.w 0,4,8,12,16,20,24,28,32,36
  194. dc.w 1280,1284,1288,1292,1296,1300,1304,1308,1312,1316
  195. dc.w 2560,2564,2568,2572,2576,2580,2584,2588,2592,2596
  196. dc.w 3840,3844,3848,3852,3856,3860,3864,3868,3872,3876
  197. dc.w 5120,5124,5128,5132,5136,5140,5144,5148,5152,5156
  198. dc.w 6400,6404,6408,6412,6416,6420,6424,6428,6432,6436
  199.  
  200. s_plus: dc.w 0
  201. s_TeckenBredd:    ;Width of chars (in pixels)
  202. ;   " " !  "  #  $  %  &  '  (  )
  203. dc.w 31,31,31,31,31,31,31,31,31,31
  204. ;    *  +  ,  -  .  /  0  1  2  3
  205. dc.w 31,31,31,31,31,31,31,31,31,31
  206. ;    4  5  6  7  8  9  :  ;  <  =
  207. dc.w 31,31,31,31,31,31,31,31,31,31
  208. ;    >  ?  @  A  B  C  D  E  F  G
  209. dc.w 31,31,31,31,31,31,31,31,31,31
  210. ;    H  I  J  K  L  M  N  O  P  Q
  211. dc.w 31,31,31,31,31,31,31,31,31,31
  212. ;    R  S  T  U  V  W  X  Y  Z
  213. dc.w 31,31,31,31,31,31,31,31,31,31
  214.  
  215. s_Scrollplane: blk 1728,0    ;NOTE: change the value if you have
  216.                 ;more then one bitplane!
  217.                 ;add 1728 bytes per bitplane!
  218.  
  219. s_pause: dc.w 0
  220. s_Speed: dc.w 0
  221. s_Speed1: dc.w 0
  222. s_delay: dc.w 0
  223. s_scrollpos: dc.l 0    ;those lables are for the scroller!
  224. s_pixel: dc.w 0        ;so don't mix with anything here!
  225. s_pixels: dc.w 0
  226.  
  227. s_scrolltext:
  228.  
  229. ; SPEED=';S<SPEED>'   PAUSE=';P<PAUSE>'    ;=';;'
  230. ; so speed 2 looks like   ;S2   pause 2=   ;P2
  231.  
  232. DC 'THIS;S6 IS A LITTLE SCROLL ;S0ROUTINE BY CHUCKY OF SARGON        '
  233. DC 0    ;WRAP
  234.