8-Bit Software Online Conversion
Bubbles Animation - Listing
10REM Bubbles
20:
30VDU23,255,120,204,204,120,0,0,0,0
40:
50DIM code% 1024
60FOR loop=0 TO 2 STEP 2
70P%=code%
80[OPT loop
90
100.xlo OPT FNreserve(10)
110.xhi OPT FNreserve(10)
120.ylo OPT FNreserve(10)
130.yhi OPT FNreserve(10)
140.speed OPT FNreserve(10)
150
160.stars
170 LDA #18
180 JSR &FFEE
190 LDA #3
200 JSR &FFEE
210 LDA #1
220 JSR &FFEE
230 JSR display
240
250.stars`loop
260 JSR display
270 JSR move
280 JSR display
290 LDA #&81
300 LDY #&FF
310 LDX #&9D
320 JSR &FFF4
330 CPY #&FF
340 BNE stars`loop
350 RTS
360
370.display
380 LDX #0
390.display`loop
400 LDA #25
410 JSR &FFEE
420 LDA #4
430 JSR &FFEE
440 LDA xlo,X
450 JSR &FFEE
460 LDA xhi,X
470 JSR &FFEE
480 LDA ylo,X
490 JSR &FFEE
500 LDA yhi,X
510 JSR &FFEE
520 LDA #255
530 JSR &FFEE
540 INX
550 CPX#10
560 BNE display`loop
570 RTS
580
590.move
600 LDX #0
610.move`loop
620 LDA ylo,X
630 CLC
640 ADC speed,X
650 STA ylo,X
660 LDA yhi,X
670 ADC #0
680 CMP #5
690 BNE not
700 LDA #0
710.not
720 STA yhi,X
730 INX
740 CPX #10
750 BNE move`loop
760 RTS
770
780]:NEXT
790:
800FOR loop=0 TO 9
810loop?xlo=RND(256)-1
820loop?ylo=RND(256)-1
830loop?speed=RND(20)+10
840loop?xhi=2
850loop?yhi=RND(4)-1
860NEXT
870
880MODE0
890VDU23;8202;0;0;0;5
900CALLstars
910CHAIN"Disk"
920
930DEF FNreserve(bytes)
940P%=P%+bytes
950=loop