Dale’s Atari 800 Games › Stan Ockers
By Stan Ockers, in the ACE newsletter of August/September 1982.
Play BalloonsThis month we look at an expansion of the PM graphics routine introduced in June’s ‘Bankshot’ program. I changed the routine slightly so that a vertical position change wouldn’t be necessary to change the images. This was done using old and new image numbers stored in page six and required adjustment of the page six table. Table 1 is a revised listing of page six locations used.
You will also notice a number of flag locations in table 1. Additional machine language routines have been added prior to the main X-Y movement routine. Communication between these routines and Basic is done by setting and resetting flags. In general, the flag for a given routine will be set to one by Basic or another routine. The flag being one is an indication that the routine is active. Upon completion of certain actions, the flag will be reset to zero.
In the game ‘Balloons’ someone is tossing water filled balloons across the screen. Your job is to fire darts trying to bust the ballons. Don’t hit the birds though, you’ll lose points rather than gain them. Allowances must be made for the wind which changes speed and direction every round. At the beginning of the game you are offered a menu you can use to change playing parameters of the game. Try the default parameters first to get used to the game and then try varying parameters.
The whole game could have been written using just the main X-Y movement routine (data in lines 270-302) as ‘Bankshot’ was, but because of the timing between Basic and the Vertical Blank Interrupt, motion would not be smooth. For smooth motion seperate routines have been put in the VBI. The three balloons (3 players) have their horizontal position updated by a routine using data from lines 262 and 263. Speed is determined by bytes in page 6 (1572-1574) with negative numbers indicating motion to the left. When players reach specified limits their horizontal positions are set to zero to remove them from the screen.
—Stan Ockers

The listing, “BALLOONS by Stan Ockers”, is on pages 9, 10 of the issue. The game page runs it line by line in an emulated Atari 800, just as typed in.
Where this copy came from: Typed-in copy from Atarimania (Balloons.zip), proofread against the August/September 1982 scan. The program text matched, including every DATA number. The typist had added a line 0 (POKE 580,1) that isn't in Stan's listing; it has been removed.
1 REM **********************
2 REM ** ACE NEWSLETTER **
3 REM ** 3662 VINE MAPLE **
4 REM ** EUGENE, OR 97405 **
5 REM ** $10 YR **
6 REM ** BULLETIN BOARD **
7 REM ** (503)343-4352 **
8 REM **********************
10 REM *******************
20 REM ** BALLOONS **
30 REM **STAN OCKERS 6/2**
35 REM ** AUG 1982 **
40 REM *******************
90 ? "JUST A SEC..."
100 PMHI=1547:IMAGE0=1552:IMAGE1=1553:IMAGE2=1554:IMAGE3=1555:HPOS3=1559:VPOS3=1567
110 FLAG0=1568:FLAG1=1569:FLAG2=1570:FLAG3=1571:FLAG4=1578:FLAG5=1579:WIND=1576:DIR=1577
120 SPEED0=1572:SPEED1=1573:SPEED2=1574:SPEED3=1575:IMGPNT=1584:SIZEP3=53259:P3PL=53263:AUDC1=53761
130 AUDC2=53763:AUDC3=53765:AUDC4=53767:RAMTOP=106:PMBASE=54279:SDMCTL=559:GRACTL=53277
140 PCOLR0=704:PCOLR1=705:PCOLR2=706:PCOLR3=707
150 NR=5:ROUND=1:DIF=4:DLY=10:DSPD=10:WAIT=20:AMMO=15:NP=1:BPR=0.4
200 OPEN #1,4,0,"K"
250 REM * VBI ROUTINE UPDATED BY POKES *
260 DIM VB$(348):FOR I=1 TO 348:READ A:VB$(I,I)=CHR$(A):NEXT I
261 DATA 173,20,6,141,0,210,173,21,6,141,2,210,173,22,6,141,4,210,173,35,6,240,6,173,31,6,141,6,210
262 DATA 162,2,189,32,6,240,46,188,36,6,240,41,48,15,254,20,6,136,208,250,189,20,6,201,200,144,26,176,13
263 DATA 222,20,6,200,208,250,189,20,6,201,32,176,8,169,0,157,20,6,157,36,6,157,32,6,202,16,202
264 DATA 173,35,6,240,60,174,39,6,173,10,6,208,19,173,40,6,141,10,6,173,41,6,208,5,206,23,6
265 DATA 16,3,238,23,6,206,31,6,206,10,6,173,31,6,201,32,176,17,169,120,141,23,6,169,224,141,31,6
266 DATA 169,0,141,35,6,240,3,202,16,199
267 DATA 173,42,6,208,31,173,15,208,240,26,162,0,74,176,5,232,224,4,208,248,169,0,141,35,6,157,32,6,157,20,6
268 DATA 169,1,141,42,6,173,43,6,240,36,238,31,6,173,31,6,201,224,144,26,141,30,208,169,120
269 DATA 141,23,6,169,224,141,31,6,169,4,141,19,6,169,0,141,42,6,141,43,6
270 DATA 24,173,11,6,105,4,133,204,162,0,134,207,160,0,132,203,189,20,6,157,0,208,189,12,6,221,16,6,208,8,189,28,6
280 DATA 221,24,6,240,69,189,16,6,157,12,6,189,28,6,157,24,6,165,203,221,28,6,240,10,169,0,145,203,230,203,240,42
290 DATA 208,239,189,16,6,170,189,48,6,133,205,189,49,6,133,206,177,205,240,14,145,203,230,205,208,2
300 DATA 230,206,230,203,240,10,208,238,169,0,145,203,230,203,208,250,230,204,166,207,232,134,207,224,4,144,154
302 DATA 76,98,228
350 REM * PAGE 6 - INSERT VBI ROUTINE *
360 FOR I=1536 TO 1545:READ A:POKE I,A:NEXT I
370 DATA 104,160,0,162,0,169,7,76,92,228
380 A=ADR(VB$):B=INT(A/256):C=A-256*B:POKE 1538,C:POKE 1540,B
400 GRAPHICS 17:DIM N$(3)
430 GOSUB 1800:DIM T(NP)
500 REM * PLAYER MISSILE SETUP *
510 A=PEEK(RAMTOP)-16:POKE PMBASE,A:POKE PMHI,A
560 REM ** IMAGE 14 BIRD FALL **
562 DIM BFALL$(11):FOR I=1 TO 11:READ A:BFALL$(I,I)=CHR$(A):NEXT I:BFL=ADR(BFALL$):POKE IMGPNT+15,INT(BFL/256)
564 POKE IMGPNT+14,BFL-256*PEEK(IMGPNT+15)
566 DATA 68,68,68,40,40,56,56,16,16,16,0
570 REM ** IMAGE 12 BIRD SPLAT **
572 DIM BOOM3$(11):FOR I=1 TO 11:READ A:BOOM3$(I,I)=CHR$(A):NEXT I:BM3=ADR(BOOM3$):POKE IMGPNT+13,INT(BM3/256)
574 POKE IMGPNT+12,BM3-256*PEEK(IMGPNT+13)
576 DATA 16,40,146,214,124,124,56,56,16,40,0
580 REM ** IMAGE 10 BALLOON BURST **
582 DIM BOOM2$(14):FOR I=1 TO 14:READ A:BOOM2$(I,I)=CHR$(A):NEXT I:BM2=ADR(BOOM2$):POKE IMGPNT+11,INT(BM2/256)
584 POKE IMGPNT+10,BM2-256*PEEK(IMGPNT+11)
586 DATA 8,40,52,84,74,42,33,17,84,76,42,50,16,0
590 REM ** IMAGE 8 BIRD **
592 DIM BIRD$(9):FOR I=1 TO 9:READ A:BIRD$(I,I)=CHR$(A):NEXT I:BRD=ADR(BIRD$):POKE IMGPNT+9,INT(BRD/256)
594 POKE IMGPNT+8,BRD-256*PEEK(IMGPNT+9)
596 DATA 192,96,112,58,63,126,60,24,0
600 REM ** IMAGE 6 RAIN **
610 DIM RAIN$(10):FOR I=1 TO 10:READ A:RAIN$(I,I)=CHR$(A):NEXT I:RAI=ADR(RAIN$):POKE IMGPNT+7,INT(RAI/256)
612 POKE IMGPNT+6,RAI-256*PEEK(IMGPNT+7)
614 DATA 32,4,8,66,32,133,32,8,68,0
620 REM ** IMAGE 4 DART **
624 DIM DART$(9):FOR I=1 TO 9:READ A:DART$(I,I)=CHR$(A):NEXT I:DAR=ADR(DART$):POKE IMGPNT+5,INT(DAR/256)
625 POKE IMGPNT+4,DAR-256*PEEK(IMGPNT+5)
626 DATA 16,16,16,16,16,56,56,40,0
628 REM ** IMAGE 2 **
630 DIM BALL$(11):FOR I=1 TO 11:READ A:BALL$(I,I)=CHR$(A):NEXT I:BAL=ADR(BALL$):POKE IMGPNT+3,INT(BAL/256)
632 POKE IMGPNT+2,BAL-256*PEEK(IMGPNT+3)
640 DATA 36,24,52,122,126,126,126,126,60,24,0
642 REM ** IMAGE 0 **
645 DIM Z$(1):Z$=CHR$(0):ZERO=ADR(Z$):POKE IMGPNT+1,INT(ZERO/256):POKE IMGPNT,ZERO-256*PEEK(IMGPNT+1)
649 REM ** INIT. IMAGES, HOR. & VERT. POS. **
650 FOR I=1552 TO 1567:READ A:POKE I,A:NEXT I
660 DATA 2,2,2,4,0,0,0,120,0,0,0,0,50,90,130,230
669 REM ** PM GRAPHICS - COLORS **
670 POKE SDMCTL,62:POKE GRACTL,3
695 POKE PCOLR0,38:POKE PCOLR1,56:POKE PCOLR2,70:POKE PCOLR3,86
700 A=USR(1536)
720 RESTORE 725:DIM MPH$(5),SPD$(8):FOR I=1 TO 5:READ A:MPH$(I,I)=CHR$(A):NEXT I
722 FOR I=1 TO 8:READ A:SPD$(I,I)=CHR$(A):NEXT I:POKE FLAG3,0:POKE FLAG4,0:POKE FLAG5,0
725 DATA 3,6,9,14,20,254,1,253,2,251,3,250,4
726 FOR I=1 TO NP:T(I)=0:NEXT I:PLYR=0:GOSUB 1400
728 POKE SPEED3,DSPD:SHOTS=AMMO:GOTO 732
729 REM ** MAIN LOOP STARTS HERE **
730 GOSUB 1600:POKE 77,0:SOUND 3,0,0,0:GOSUB 1700:SHOTS=AMMO
732 ? #6;CHR$(125):POSITION 1,0:? #6;"{inv}XXXXXXXXXXXXXXXXXX{/inv} ":REM X'S IN INVERSE
734 SX=3:SY=19:FOR I=1 TO SHOTS:GOSUB 1100:? #6;"*";:NEXT I:SX=3:SY=19
740 R0=RND(0)*DLY:R1=RND(0)*DLY:R2=RND(0)*DLY
742 T(PLYR)=T(PLYR)+TOT:TOT=0
756 POSITION 4,18:? #6;"shots":POSITION 13,18:? #6;"wind":POSITION 12,22:? #6;"score"
762 PLYR=PLYR+1:IF PLYR>NP THEN PLYR=1:ROUND=ROUND+1:GOSUB 1400:IF ROUND>NR THEN 1000
764 POSITION 12,19:IF R8=0 THEN FOR I=1 TO 6-R9:? #6;"<";:NEXT I
766 IF R8=1 THEN FOR I=1 TO 6-R9:? #6;">";:NEXT I
780 POSITION 2,5:? #6;"PULL STICK TO GO"
782 POSITION 12,21:? #6;T(PLYR)
784 FOR J=1 TO 30:NEXT J:POSITION 3,23:? #6;" "
786 FOR J=1 TO 30:NEXT J:POSITION 11,23:? #6;"plyr #";PLYR:POSITION 3,23:? #6;"rnd #";ROUND
788 IF STICK(0)<>13 THEN 784
790 POSITION 2,5:? #6;" "
800 IF SHOTS=0 THEN 830
810 IF STRIG(0)=0 AND PEEK(FLAG3)=0 AND PEEK(FLAG4)=0 THEN POKE FLAG3,1:SHOTS=SHOTS-1:GOSUB 1100:? #6;" ";
820 IF PEEK(FLAG3)=1 THEN POKE AUDC4,168
830 IF PEEK(FLAG3)=0 THEN POKE AUDC4,0
835 R=INT(RND(0)*DIF)+1:SP=ASC(SPD$(R))
840 IF PEEK(FLAG0)=0 THEN R0=R0-1:POKE AUDC1,0
842 IF R0<0 THEN R0=RND(0)*DLY:POKE FLAG0,1:POKE SPEED0,SP:POKE IMAGE0,2:E0=0:IF RND(0)<BPR THEN GOSUB 1300
844 IF PEEK(FLAG0)=1 THEN POKE AUDC1,162
850 IF PEEK(FLAG1)=0 THEN R1=R1-1:POKE AUDC2,0
852 IF R1<0 THEN R1=RND(0)*DLY:POKE FLAG1,1:POKE SPEED1,SP:POKE IMAGE1,2:E1=0:IF RND(0)<BPR THEN GOSUB 1310
854 IF PEEK(FLAG1)=1 THEN POKE AUDC2,162
860 IF PEEK(FLAG2)=0 THEN R2=R2-1:POKE AUDC3,0
862 IF R2<0 THEN R2=RND(0)*DLY:POKE FLAG2,1:POKE SPEED2,SP:POKE IMAGE2,2:E2=0:IF RND(0)<BPR THEN GOSUB 1320
864 IF PEEK(FLAG2)=1 THEN POKE AUDC3,162
870 IF PEEK(FLAG4)=1 AND PEEK(FLAG5)=0 THEN GOSUB 1500:POKE IMAGE3,6:POKE FLAG5,1
880 IF PEEK(FLAG5)=1 THEN SOUND 3,PEEK(VPOS3),10,8:IF FLAG6=1 THEN POKE IMAGE3,14
890 IF PEEK(FLAG5)=0 THEN POKE IMAGE3,4
900 IF SHOTS=0 THEN PTIM=0:TIME=WAIT:GOTO 730
910 TIME=TIME-1:IF TIME<0 THEN TIME=WAIT:GOSUB 1200:IF PTIM>18 THEN PTIM=0:GOTO 730
920 GOTO 800
999 REM ** FINAL SCORES **
1000 ? #6;CHR$(125):POSITION 3,3:? #6;"final scores":X=3:Y=5:FOR I=1 TO NP:POSITION X,Y
1005 ? #6;"PLYR # ";I;"=";T(I):Y=Y+1:NEXT I
1010 GOTO 1010
1099 REM ** POS. FOR PRINTING '*' **
1100 SX=SX+1:IF SX=9 THEN SX=4:SY=SY+1
1110 POSITION SX,SY:RETURN
1199 REM ** POS. FOR PRINTING 'x' **
1200 PTIM=PTIM+1:POSITION PTIM,0:? #6;"x";:RETURN
1299 REM ** CHANGE TO A BIRD SUBR. **
1300 POKE IMAGE0,8:POKE SPEED0,1:E0=1:RETURN
1310 POKE IMAGE1,8:POKE SPEED1,1:E1=1:RETURN
1320 POKE IMAGE2,8:POKE SPEED2,1:E2=1:RETURN
1399 REM ** WIND SPEED AND DIR SUBR. **
1400 R9=INT(RND(0)*5+1):MPH=ASC(MPH$(R9)):POKE WIND,MPH:R8=INT(RND(0)*2):POKE DIR,R8:RETURN
1499 REM ** HIT BIRD OR BALLOON SUBR. **
1500 PHIT=PEEK(P3PL):IF (E0=0 AND E1=0) AND E2=0 THEN GOTO 1508
1502 IF (PHIT=1 AND E0=0) OR (PHIT=2 AND E1=0) OR (PHIT=4 AND E2=0) THEN 1508
1504 FOR I=1 TO 3:POKE IMAGE3,12:SOUND 3,10*I+10,10,10:FOR J=1 TO 3:NEXT J:POKE IMAGE3,0
1506 FOR J=1 TO 3:NEXT J:NEXT I:FLAG6=1:GOTO 1514
1508 H3=PEEK(HPOS3):RESTORE 1530:FOR I=1 TO 3:READ M,X:POKE HPOS3,H3-X:POKE SIZEP3,M:POKE IMAGE3,10
1510 SOUND 3,100-10*I,12,10:POKE 1555,0:FOR J=1 TO 30:NEXT J:NEXT I:POKE 53259,0:FLAG6=0:POKE 1559,H3
1514 IF PHIT=1 AND E0=1 THEN E0=0:TOT=TOT-60
1516 IF PHIT=2 AND E1=1 THEN E1=0:TOT=TOT-40
1518 IF PHIT=4 AND E2=1 THEN E2=0:TOT=TOT-20
1520 IF PHIT=1 AND E0=0 THEN TOT=TOT+30
1522 IF PHIT=2 AND E1=0 THEN TOT=TOT+20
1524 IF PHIT=4 AND E2=0 THEN TOT=TOT+10
1526 POSITION 12,21:? #6;T(PLYR)+TOT;" "
1528 RETURN
1530 DATA 0,0,1,8,3,16
1599 REM ** DART TO INIT. POS. **
1600 POKE FLAG3,0:POKE IMAGE3,4:POKE HPOS3,120:POKE VPOS3,230:POKE FLAG6,0:RETURN
1699 REM ** ROUND OVER SUBR. **
1700 FOR I=1 TO 10:FOR J=1 TO 30:NEXT J:POSITION 5,6:IF SHOTS=0 THEN ? #6;"out of shots":GOTO 1720
1710 ? #6;"out of time "
1720 POSITION 12,21:? #6;T(PLYR)+TOT:FOR J=1 TO 30:NEXT J:POSITION 5,6:? #6;" "
1730 POSITION 12,21:? #6;" ":NEXT I:RETURN
1799 REM ** ENTER PARAMETERS SUBR. **
1800 ? #6;CHR$(125):POSITION 3,3:? #6;"PLAYING VALUES":POSITION 3,5:? #6;"enter one #"
1810 POSITION 3,7:? #6;"(1)# SHOTS =";AMMO:POSITION 3,8:? #6;"(2)DART SP.=";DSPD
1820 POSITION 3,9:? #6;"(3)BAL. SP.=";DIF:POSITION 3,10:? #6;"(4)BAL. DLY=";DLY
1830 POSITION 3,11:? #6;"(5)RND TIME=";WAIT:POSITION 3,12:? #6;"(6)# ROUNDS=";NR
1840 POSITION 3,13:? #6;"(7)# PLYRS =";NP
1842 POSITION 3,14:? #6;"(8)BIRDS =";BPR
1845 POSITION 3,15:? #6;"(9) NO CHANGES"
1850 GET #1,A:IF A<49 OR A>57 THEN 1850
1855 TRAP 1800
1860 ? #6;CHR$(125):POSITION 3,6:K=A-48:GOSUB 1900+K*10
1870 IF K=9 THEN RETURN
1880 GOTO 1800
1910 ? #6;"# SHOTS = ";AMMO:POSITION 6,10:? #6;"(1 TO 20)":GOSUB 1991:AMMO=A:RETURN
1920 ? #6;"DART SPEED =";DSPD:POSITION 3,10:? #6;"1(SLOW)-20(FAST)":GOSUB 1991:DSPD=A:RETURN
1930 ? #6;"BAL. SPEED =";DIF:POSITION 3,10:? #6;"1(SLOW)-8(FAST)":GOSUB 1991:DIF=A:RETURN
1940 ? #6;"BAL. DELAY =";DLY:POSITION 2,10:? #6;"1(SHORT)-50(LONG)":GOSUB 1991:DLY=A:RETURN
1950 ? #6;"RND TIME =";WAIT:POSITION 3,10:? #6;"5(FAST)-30(SLOW)":GOSUB 1991:WAIT=A:RETURN
1960 ? #6;"# ROUNDS =";NR:POSITION 4,10:? #6;"(1-WHATEVER)":GOSUB 1991:NR=A:RETURN
1970 ? #6;"# PLAYERS = ";NP:POSITION 5,10:? #6;"(1 OR MORE)":GOSUB 1991:NP=A:RETURN
1980 ? #6;"BIRD PROB. = ";BPR:POSITION 5,10:? #6;"(0.1 TO 0.9)":GOSUB 1991:BPR=A:RETURN
1990 RETURN
1991 N$="":POSITION 3,8:? #6;"INPUT NEW VALUE ";:POSITION 8,12
1992 GET #1,A:? #6;CHR$(A);:IF A=155 THEN A=VAL(N$):RETURN
1994 N$(LEN(N$)+1)=CHR$(A):GOTO 1992