home *** CD-ROM | disk | FTP | other *** search
- 100 rem open2,8,1,"0:cc.o"
- 110 sys700
- 120 ;
- 130 ;
- 140 *=$4100
- 150 ;
- 160 ;
- 170 ; .opt o2
- 180 ;
- 190 ;
- 200 font = $3800
- 210 bubbles = $4000
- 220 bubcount = 32
- 230 ;
- 240 highbit = $d011
- 250 getkey = $ffe4
- 260 ;
- 270 fontpntr = $fb
- 280 bubpntr = fontpntr+2
- 290 ;
- 300 ;---------------------------------
- 310 ;
- 320 mainloop = *
- 330 lda #0 ; init both pointers
- 340 sta fontpntr ; both low bytes=0
- 350 sta bubpntr ;
- 360 ;
- 370 lda #>font ; font address
- 380 sta fontpntr+1 ; high byte
- 390 ;
- 400 lda #>bubbles ; bubble data addr
- 410 sta bubpntr+1 ; high byte
- 420 ;
- 430 lda #bubcount ; init bubble count
- 440 sta count ;
- 450 ;
- 460 waitloop = *
- 470 jsr sync ;
- 480 bcs exit ;
- 490 jsr sync ;
- 500 bcs exit ;
- 510 jsr sync ;
- 520 bcs exit ;
- 530 jsr sync ;
- 540 bcs exit ;
- 550 ;
- 560 ldy #7 ; 8 bytes to copy
- 570 tloop = *
- 580 lda (bubpntr),y ; copy bubble data
- 590 sta (fontpntr),y ; to char data
- 600 dey ;
- 610 bpl tloop ;
- 620 ;
- 630 clc ; add 8 to the
- 640 lda #8 ; bubble pointer
- 650 adc bubpntr ;
- 660 sta bubpntr ;
- 670 bcc nocarry ;
- 680 inc bubpntr+1 ;
- 690 ;
- 700 nocarry = *
- 710 dec count ; count=count-1
- 720 bne waitloop ; count>0, waitlp
- 730 beq mainloop ; count=0, mainlp
- 740 ;
- 750 ;
- 760 exit rts ;
- 770 ;
- 780 sync = *
- 790 jsr getkey ; is a key pressed
- 800 bne foundkey ; if so, exit
- 810 ;
- 820 syncloop = *
- 830 bit highbit ; wait til 9th
- 840 bpl syncloop ; raster bit=1
- 850 ;
- 860 clc ; flag 'no key'
- 870 ;
- 880 ; the '.byte $24' below, is a
- 890 ; "bit $38" instruction. $38 is
- 900 ; a "sec" instruction. this
- 910 ; effectively "hides" the "sec"
- 920 ; from the "clc".
- 930 ;
- 940 .byte $24
- 950 ;
- 960 foundkey sec ; flag 'key press'
- 970 rts ;
- 980 ;
- 990 count = *
-