Guest User

Untitled

a guest
Jun 19th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.85 KB | None | 0 0
  1. // -------------------------------------
  2. // 1x1 SCROLL SIDE-FLOODER
  3. // Idea by someone from STARION
  4. //
  5. // Done (quite easy) by Digger
  6. // of PETLICZEK DEZIGNS on 1996.09.18
  7. // -------------------------------------
  8.  
  9. .var vtxt = $c0//c1
  10. .var cadd = $c2//c3
  11.  
  12. .var charline = 24 //pos (0-24)
  13.  
  14. .var raster = <$32 + charline * 8
  15. .var scrline = $0400 + [raster - $32] / 8 * 40
  16.  
  17. // -------------------------------------
  18.  
  19. :BasicUpstart2(run)
  20.  
  21. .pc = $0a00 //sys 2560
  22.  
  23. run: lda #$0c
  24. jsr $e536
  25. sei
  26. lda #<irq
  27. ldy #>irq
  28. sta $0314
  29. sty $0315
  30. lda #<scrtxt
  31. ldy #>scrtxt
  32. sta vtxt
  33. sty vtxt+1
  34. lda #$7f
  35. sta $dc0d
  36. lda #$01
  37. sta $d01a
  38. lda #$00
  39. sta $d021
  40. sta $d012
  41. lda #$1b
  42. sta $d011
  43. lda #$18
  44. sta $d018
  45. cli
  46. jmp *
  47.  
  48. // -------------------------------------
  49.  
  50. irq: inc $d019
  51.  
  52. ldy #0 //right border
  53. sty cadd+1
  54. lda scrline
  55. jsr afont
  56. lp2r: lda (cadd),y
  57. ldx roll
  58. beq passr
  59. lp1r: ror
  60. dex
  61. bpl lp1r
  62. passr: and #1
  63. tax
  64. lda rctab,x
  65. sta rtab,y
  66. iny
  67. cpy #$08
  68. bne lp2r
  69.  
  70. ldy #0 //left border
  71. sty cadd+1
  72. lda scrline+$26
  73. jsr afont
  74. lp2l: lda (cadd),y
  75. ldx roll
  76. beq passl
  77. lp1l: ror
  78. dex
  79. bpl lp1l
  80. passl: and #1
  81. tax
  82. lda lctab,x
  83. sta ltab,y
  84. iny
  85. cpy #$08
  86. bne lp2l
  87.  
  88. lda #raster //position
  89. cmp $d012
  90. bne *-3
  91. ldx #$0d
  92. dex
  93. bne *-1
  94. lda roll
  95. sta $d016
  96.  
  97. // -------------------------------------
  98.  
  99. ldy #0 //flooder
  100. lp: lda rtab+1,y //split
  101. sta $d020 //display
  102. ldx #$03
  103. dex
  104. bne *-1
  105. bit $00
  106. lda ltab+1,y
  107. sta $d020
  108. ldx #$04
  109. dex
  110. bne *-1
  111. iny
  112. cpy #$07
  113. bne lp
  114.  
  115. lda #0
  116. sta $d020
  117. lda #$08
  118. sta $d016
  119.  
  120. lda flg
  121. beq scroll
  122.  
  123. lda speed
  124. eor #$01
  125. sta speed
  126.  
  127. // -------------------------------------
  128. // Ordinary scroll...
  129. // (he, he - beat me it is probably the shortest variable speed 1x1 scroll routine in the world)
  130.  
  131. scroll: lda roll
  132. sec
  133. sbc speed
  134. bpl nzero
  135. and #$07
  136. sta roll
  137.  
  138. ldy #0
  139. rewrite: lda scrline+1,y
  140. sta scrline,y
  141. iny
  142. cpy #$27
  143. bne rewrite
  144.  
  145. ldy #0
  146. lda (vtxt),y
  147. bne enter
  148.  
  149. lda #<scrtxt
  150. ldy #>scrtxt
  151. sta vtxt
  152. sty vtxt+1
  153. lda roll
  154. nzero: sta roll
  155. jmp end
  156.  
  157. enter: sta scrline+$27
  158. inc vtxt
  159. bne *+4
  160. inc vtxt+1
  161. jmp end
  162.  
  163. // -------------------------------------
  164. flg: brk
  165.  
  166. rtab: .byte 0,0,0,0,0,0,0,0
  167. ltab: .byte 0,0,0,0,0,0,0,0
  168.  
  169. lctab: .byte 0,$0c //color
  170. rctab: .byte 0,$0c
  171.  
  172. roll: .byte $07
  173. speed: .byte 2 // speed (0-8)
  174.  
  175. // -------------------------------------
  176.  
  177. afont: asl //find char address
  178. rol cadd+1
  179. asl
  180. rol cadd+1
  181. asl
  182. rol cadd+1
  183. sta cadd
  184. lda cadd+1
  185. clc
  186. adc #>charset
  187. sta cadd+1
  188. rts
  189.  
  190. end: lda $dc01
  191. cmp #$7f
  192. beq slow
  193. cmp #$df
  194. beq fast
  195. jmp quit
  196.  
  197. slow: lda #1
  198. sta flg
  199. sta speed
  200. jmp quit
  201.  
  202. fast: lda #0
  203. sta flg
  204. lda #2
  205. sta speed
  206. jmp quit
  207.  
  208. quit: inc $d019
  209. jmp $ea81
  210.  
  211. .pc = $0d00 "Scroll Text"
  212. scrtxt: .import c64 "scr_text.dat"
  213.  
  214. .pc = $2000 "Font"
  215. charset: .import c64 "1x1chars.fnt"
Add Comment
Please, Sign In to add comment