home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 3 #1 / Commodore_Disk_User_Vol.3_1_1989_-.d64 / rasters1 (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  2KB  |  96 lines

  1. 1000 !
  2. 1010 *=49152
  3. 1020 !
  4. 1030 jsr init   ! set up delay table
  5. 1040 jsr setirq ! set irq's
  6. 1050 rts        ! and return !
  7. 1060 !
  8. 1070 setirq !
  9. 1080 sei
  10. 1090 lda #$7f
  11. 1100 sta $dc0d
  12. 1110 lda $dc0d
  13. 1120 lda #$1b
  14. 1130 sta $d011
  15. 1140 lda #$32   ! <- set this number
  16. 1150 sta $d012  !    to the first line
  17. 1160 lda #<irq  !    you want your
  18. 1170 sta $314   !    colours to start.
  19. 1180 lda #>irq
  20. 1190 sta $315
  21. 1200 lda #1
  22. 1210 sta $d019
  23. 1220 sta $d01a
  24. 1230 cli
  25. 1240 rts
  26. 1250 !
  27. 1260 max=$88       ! max.coloured lines
  28. 1270 deltab=$c300 !<delay table address
  29. 1280 coltab=$c600 !<colour table address
  30. 1290 !
  31. 1300 irq !
  32. 1310 ldx #$d   !<get in exactly the
  33. 1320 i1 dex    ! right place to start!
  34. 1330 bne i1
  35. 1340 !
  36. 1350 i2 ldy deltab,x !<get delay
  37. 1360 lda coltab,x    !<get colour
  38. 1370 i3 dey          !<to the delay to
  39. 1380 bne i3          ! wait for line.
  40. 1390 sta $d020       !<and store colour
  41. 1400 sta $d021       ! in screen+border
  42. 1410 inx
  43. 1420 cpx #max        !<finished?
  44. 1430 bne i2          ! if not,continue
  45. 1440 !
  46. 1450 lda #1          !<reset irq
  47. 1460 sta $d019
  48. 1470 jmp $ea31       !<and return...
  49. 1480 !
  50. 1490 init ! set up delay table.
  51. 1500 ldx #0
  52. 1510 in0 ldy #0
  53. 1520 in1 lda dtab,y
  54. 1530 sta deltab,x
  55. 1540 inx
  56. 1550 iny
  57. 1560 cpy #8
  58. 1570 bcc in1
  59. 1580 cpx #max
  60. 1590 bcc in0
  61. 1600 rts
  62. 1610 !
  63. 1620 dtab byt 8,8,8,8,8,8,8,1
  64. 1630 ! the dreaded 8th line ^ argh!
  65. 1640 !
  66. 1650 !    single pixel colour-bars
  67. 1660 !    ------------------------
  68. 1670 !
  69. 1680 ! -to use this program,you have to
  70. 1690 ! first assemble it,start it with
  71. 1700 ! sys 49152,and then either poke
  72. 1710 ! from basic,or use a monitor to
  73. 1720 ! put the colour values into the
  74. 1730 ! table from $c600-$c600+max.
  75. 1740 ! eg. 0 for black,1 for white etc
  76. 1750 ! -watch the two tables don't
  77. 1760 ! overwrite each other!!
  78. 1770 !
  79. 1780 ! -thanks to dave weaver!
  80. 1790 !
  81. 1800 *=$c600 ! example colours...
  82. 1810 !
  83. 1820 byt 6,0,6,2,0,6,2,4,0,6,2,4,$a,0
  84. 1830 byt 6,2,4,$a,7,0,6,2,4,$a,7,1
  85. 1840 byt 7,$a,4,2,6,0,7,$a,4,2,6,0
  86. 1850 byt $a,4,2,6,0,4,2,6,0,2,6,0,6,0
  87. 1860 !
  88. 1870 byt 0,6,14,14,14,3,0,14,3,3,3,1,0
  89. 1880 byt 3,1,1,1,3,0,1,3,3,3,14,0
  90. 1890 byt 3,14,14,14,6,0,0
  91. 1900 !
  92. 1910 byt 9,0,9,2,0,9,2,8,0,9,2,8,$a,0
  93. 1920 byt 9,2,8,$a,7,0,9,2,8,$a,7,1
  94. 1930 byt 7,$a,8,2,9,0,7,$a,8,2,9,0
  95. 1940 byt $a,8,2,9,0,8,2,9,0,2,9,0,9,0
  96.