home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 68 / 068.d81 / bits.pal (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1990-01-01  |  1.7 KB  |  91 lines

  1. 100 rem open2,8,1,"0:cc.o"
  2. 110 sys700
  3. 120 ;
  4. 130 ;
  5. 140 *=$4100
  6. 150 ;
  7. 160 ;
  8. 170 ; .opt o2
  9. 180 ;
  10. 190 ;
  11. 200 font = $3800
  12. 210 bubbles = $4000
  13. 220 bubcount = 32
  14. 230 ;
  15. 240 highbit = $d011
  16. 250 getkey = $ffe4
  17. 260 ;
  18. 270 fontpntr = $fb
  19. 280 bubpntr = fontpntr+2
  20. 290 ;
  21. 300 ;---------------------------------
  22. 310 ;
  23. 320 mainloop = *
  24. 330 lda #0         ; init both pointers
  25. 340 sta fontpntr   ; both low bytes=0
  26. 350 sta bubpntr    ;
  27. 360 ;
  28. 370 lda #>font     ; font address
  29. 380 sta fontpntr+1 ;  high byte
  30. 390 ;
  31. 400 lda #>bubbles  ; bubble data addr
  32. 410 sta bubpntr+1  ;  high byte
  33. 420 ;
  34. 430 lda #bubcount  ; init bubble count
  35. 440 sta count      ;
  36. 450 ;
  37. 460 waitloop = *
  38. 470 jsr sync ;
  39. 480 bcs exit ;
  40. 490 jsr sync ;
  41. 500 bcs exit ;
  42. 510 jsr sync ;
  43. 520 bcs exit ;
  44. 530 jsr sync ;
  45. 540 bcs exit ;
  46. 550 ;
  47. 560 ldy #7           ; 8 bytes to copy
  48. 570 tloop = *
  49. 580 lda (bubpntr),y  ; copy bubble data
  50. 590 sta (fontpntr),y ;  to char data
  51. 600 dey              ;
  52. 610 bpl tloop        ;
  53. 620 ;
  54. 630 clc              ; add 8 to the
  55. 640 lda #8           ;  bubble pointer
  56. 650 adc bubpntr      ;
  57. 660 sta bubpntr      ;
  58. 670 bcc nocarry      ;
  59. 680 inc bubpntr+1    ;
  60. 690 ;
  61. 700 nocarry = *
  62. 710 dec count        ; count=count-1
  63. 720 bne waitloop     ; count>0, waitlp
  64. 730 beq mainloop     ; count=0, mainlp
  65. 740 ;
  66. 750 ;
  67. 760 exit rts         ;
  68. 770 ;
  69. 780 sync = *
  70. 790 jsr getkey       ; is a key pressed
  71. 800 bne foundkey     ;  if so, exit
  72. 810 ;
  73. 820 syncloop = *
  74. 830 bit highbit      ; wait til 9th
  75. 840 bpl syncloop     ;  raster bit=1
  76. 850 ;
  77. 860 clc              ; flag 'no key'
  78. 870 ;
  79. 880 ; the '.byte $24' below, is a
  80. 890 ; "bit $38" instruction.  $38 is
  81. 900 ; a "sec" instruction.  this
  82. 910 ; effectively "hides" the "sec"
  83. 920 ; from the "clc".
  84. 930 ;
  85. 940 .byte $24
  86. 950 ;
  87. 960 foundkey sec     ; flag 'key press'
  88. 970 rts              ;
  89. 980 ;
  90. 990 count = *
  91.