Dale’s Atari 800 Games › Stan Ockers
Bankshot
By Stan Ockers, in the ACE newsletter of June 1982.
Play BankshotStan’s write-up
Here it is ... yet one more attempt at a Player Missile routine which makes player movement ‘simple’. The problem with the ‘universal’ routine in ‘Chicken’ was it was almost completely independent of Basic. Once set up, everything continued to move, even if the Basic program was stopped. Other problems seemed to crop up because a seperate load player routine was used. If a vertical blank interrupt occured part way through the loading process, unexpected things could happen. The load routine should be part of the VBI movement routine.
I decided to start from scratch. This time I’ve provided an assembly listing of what I came up with. As usual there are a number of special locations in page six. Each player has locations which can be POKEd with X and Y positions as well as one which can be POKEd with a number which determines the image used. Table 1 lists page six locations. The routine itself is completely relocatable and is stored in VB$.
All players are updated during each VBI ... horizontal positions are always updated while vertical positions are updated only if the new vertical position for that player is different from the old. In such cases, zeros are written into the appropriate player area until the proper vertical position is reached. The image to insert is determined by an even number 0,2,4... The numbers refer to a set of pointers loaded into page six starting at 1568. The pointers are the addresses of strings which hold the images. After loading the image, the rest of the area for that player is zeroed out. Jumps from one point on the screen to a second point quite far away can be immediate. To show motion the intervening positions are used.
What has to be set up for this routine to work? Well, first of all the routine is only for single line resolution and only for 4 players (no missiles). Refer to the listing of ‘Bankshot’ for the lines which follow. The routine has to be put into VB$ (lines 250-302) and its address put into a machine language insertion routine (line 380, this routine hooks our routine into VBI). Room has to be set aside for the player-missiles and the Hi byte of the address of this area given to 1551 as well as CTIA (line 610). All strings representing images have to be filled and their addresses (Lo and Hi bytes) placed in the previously mentioned set of pointers (lines 624-645). Image 0 (the first in the list) should probably be the single character zero. This can be used to clear a player area although setting the horizontal position to 0 will get the image off the screen as well. Initial horizontal and vertical positions should be POKEd as in lines 650-660. The old and new vertical positions should be different or the images will never be loaded until they are. The image numbers for the different players have to be POKEd into locations 1552-1555 (line 690) and the normal PM single line resolution initilization given (line 670). Colors can be set (line 695) and finally, the VBI routine inserted (line 710).
The game ‘Bankshot’ is fairly straight forward. There is one problem I was unable to fix. You are not supposed to shoot directly at the pockets. I put a flag (BOUNCE = 1 or 0) to determine if you do, but it doesn’t always work. This is apparently due to the size of the ball and the configuration of the corner pockets. It’s easy to have a collision with the rail almost simultaneously with the ball touching the pocket. I’ve tried extending the corner pockets out but that makes it too easy to sink the shot. If anyone figures out a way to handle this problem, let me know.
Table 1
1536-1545 (0600-0609) Insertion routine 1551 (060F) PM Area Hi byte 1552-1555 (0610-0613) Image #'s (even only) 1556-1559 (0614-0617) Plyr horiz. pos. 1560-1563 (0618-061B) Old vert. pos. 1564-1567 (061C-061F) New vert. pos. 1568 and up (0620) Pointers to images (Lo and Hi bytes) Note! 00CB-00CF also used
—Stan Ockers

The program
The listing, “BANKSHOT by Stan Ockers”, is on page 7 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 (Bankshot.zip), proofread against the June 1982 scan. The program text matched; the typist had left out three comments, which are restored: REM INVERSE An and oT (line 90), REM INVERSE BALL PALYER (line 480) and REM INVERSE O'S (line 710).
Show the listing
1 REM ********************************* {inv}BEST OF ACE 1982 1/2{/inv}
2 REM
3 REM **** Reprinted from ****
4 REM **** {inv}ACE{/inv} {inv}NEWSLETTER{/inv} ****
5 REM **** JUN 1982 ****
6 REM **** 3662 VINE MAPLE DR ****
7 REM **** EUGENE, OR 97405 ****
8 REM **** {inv}$10{/inv} {inv}YEAR{/inv} ****
9 REM *********************************
10 REM *****************
20 REM ** BANKSHOT **
30 REM **STAN OCKERS **
35 REM ** 3/82 **
40 REM *****************
90 OPEN #1,4,0,"K:":GRAPHICS 18:POSITION 6,3:? #6;"B{inv}An{/inv}kSh{inv}oT{/inv}":REM INVERSE An and oT
100 POSITION 4,6:? #6;"# PLAYERS?":DIM B$(16)
110 GET #1,NP:NP=NP-48:IF NP<1 OR NP>9 THEN 110
120 DIM SCORE(NP):POSITION 15,6:? #6;NP:POSITION 4,9:? #6;"instructions?":GET #1,A:IF A=89 THEN GOSUB 2000
250 REM * VBI ROUTINE UPDATED BY POKES *
260 DIM VB$(107):FOR I=1 TO 107:READ A:VB$(I,I)=CHR$(A):NEXT I
270 DATA 24,173,15,6,105,4,133,204,162,0,134,207,160,0,132,203,189,20,6,157,0,208,189,28,6,221,24,6
280 DATA 240,63,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,32,6,133,205,189,33,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,208,168
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 3:COLOR 1:PLOT 3,0:DRAWTO 36,0:DRAWTO 36,19:DRAWTO 3,19:DRAWTO 3,0
410 POKE 708,204:POKE 709,0:POKE 712,233:COLOR 2:FOR I=1 TO 14:READ X,Y:PLOT X,Y:NEXT I
420 DATA 3,0,3,1,4,0,19,0,36,0,36,1,35,0,35,19,36,19,36,18,19,19,3,19,3,18,4,19
430 A=PEEK(560)+256*PEEK(561)
440 IF PEEK(A)<>66 THEN A=A+1:GOTO 440
450 POKE A,71:POKE A+3,6:POKE A+4,6:POKE A+5,65:POKE A+6,PEEK(A+7):POKE A+7,PEEK(A+8)
480 POKE 656,0:POKE 657,24:? "{inv}Ball{/inv} {inv}Player{/inv}":GOSUB 1500:REM INVERSE BALL PALYER
600 REM * PLAYER MISSILE SETUP *
610 A=PEEK(106)-16:POKE 54279,A:POKE 1551,A
620 REM ** IMAGE 4 **
624 DIM CUR$(6):FOR I=1 TO 6:READ A:CUR$(I,I)=CHR$(A):NEXT I:CUR=ADR(CUR$):POKE 1573,INT(CUR/256)
625 POKE 1572,CUR-256*PEEK(1573)
626 DATA 16,16,56,16,16,0
628 REM ** IMAGE 2 **
630 DIM BALL$(9):FOR I=1 TO 9:READ A:BALL$(I,I)=CHR$(A):NEXT I:BAL=ADR(BALL$):POKE 1571,INT(BAL/256)
632 POKE 1570,BAL-256*PEEK(1571)
640 DATA 16,56,108,116,124,124,56,16,0
642 REM ** IMAGE 0 **
645 DIM Z$(1):Z$=CHR$(0):ZERO=ADR(Z$):POKE 1569,INT(ZERO/256):POKE 1568,ZERO-256*PEEK(1569)
650 FOR I=1556 TO 1567:READ A:POKE I,A:NEXT I
660 DATA 120,100,86,86,100,30,53,53,120,40,63,63
670 POKE 559,62:POKE 53277,3
690 POKE 1552,2:POKE 1553,4:POKE 1554,0:POKE 1555,0
695 POKE 704,36:POKE 705,0
700 A=USR(1536)
710 YMIN=38:YMAX=177:XMIN=62:XMAX=186:BALL=0:PLYR=0:B$="{inv}OOOOOOOOOOOOOOO{/inv} ":GOSUB 1500:REM INVERSE O'S
720 FOR I=1 TO NP:SCORE(I)=0:NEXT I
730 POKE 77,0:BALL=BALL+1:IF BALL>15 THEN GOTO 3000
735 POKE 656,0:POKE 657,5:? BALL
740 X=INT(RND(0)*100+70):Y=INT(RND(0)*100+70):POKE 1556,X:POKE 1564,Y
743 IF FL=1 THEN FL=0:GOTO 750
745 PLYR=PLYR+1:IF PLYR>NP THEN PLYR=1
747 POKE 656,0:POKE 657,14:? PLYR
749 REM ** MOVE CURSOR ALONG RAIL **
750 S=STICK(0):XP=PEEK(1557):YP=PEEK(1565):X=PEEK(1556):Y=PEEK(1560)
760 IF XP>XMIN AND XP<XMAX THEN 780
765 IF (S=10 OR S=14 OR S=6) AND YP>YMIN+2 THEN YP=YP-1
770 IF (S=9 OR S=13 OR S=5) AND YP<YMAX THEN YP=YP+1
780 IF YP>YMIN+2 AND YP<YMAX THEN 795
785 IF (S=5 OR S=6 OR S=7) AND XP<XMAX THEN XP=XP+1
790 IF (S=9 OR S=10 OR S=11) AND XP>XMIN THEN XP=XP-1
795 POKE 1557,XP:POKE 1565,YP
800 IF STRIG(0)=1 THEN 750
805 R=SQR((XP-X)*(XP-X)+(YP-Y)*(YP-Y))
810 DELY=2*(YP-Y)/R:DELX=2*(XP-X)/R
880 BOUNCE=0:MOVE=0
885 REM ** LOOP TO MOVE BALL **
890 X=X+DELX:Y=Y+DELY
892 IF PEEK(53252)=2 THEN GOSUB 1000:GOTO 940
900 IF X>=XMAX OR X<=XMIN+1 THEN DELX=-DELX:GOSUB 1800
910 IF Y>=YMAX OR Y<=YMIN+1 THEN DELY=-DELY:GOSUB 1800
920 POKE 1556,X:POKE 1564,Y
930 POKE 53278,0:MOVE=MOVE+1:IF MOVE<150 THEN 890
940 POKE 53278,0
970 REM ** FL=1 IF SOMEBODY SCORED **
980 IF FL=1 THEN 730
982 REM ** FL=2 IF SHOT INTO POCKET **
985 IF FL=2 THEN FL=0:GOTO 740
990 GOTO 745
1000 POKE 1556,0:IF BOUNCE=0 THEN POKE 656,1:POKE 657,3:? "MUST BANK SHOT!! ":FL=2:GOTO 1020
1010 SCORE(PLYR)=SCORE(PLYR)+1:FL=1:B$(BALL,BALL)=CHR$(48+PLYR):GOSUB 1500
1020 FOR I=1 TO 30:SOUND 0,150+I,12,10:NEXT I:FOR I=120 TO 180:SOUND 0,I,10,10:SOUND 0,0,0,0:NEXT I
1030 FOR I=50 TO 30 STEP -5:GOSUB 1600:NEXT I:GOSUB 1500:RETURN
1500 POKE 656,1:POKE 657,3:? B$:RETURN
1600 SOUND 0,I,10,10:FOR J=1 TO 5:NEXT J:SOUND 0,0,0,0:RETURN
1800 BOUNCE=1:SOUND 0,50,10,10:FOR I=1 TO 5:NEXT I:SOUND 0,0,0,0:RETURN
2000 ? CHR$(125):POKE 752,1:POSITION 8,3:? "INSTRUCTIONS":? :? "This is a game of one ball pool for"
2010 ? "up to 9 players. All players use":? "joystick 1. Balls are made one at"
2020 ? "a time and must hit at least one":? "rail before going in a pocket to"
2030 ? "count. If a player makes a ball,":? "he gets another turn."
2040 ? :? "Position the cursor on the rail ":? "where you want the ball to first"
2050 ? "hit. The scorecard at the bottom":? "keeps track of which player hit the"
2060 ? "balls"
2070 ? :? :? "Press any key to begin the game."
2080 GET #1,A:RETURN
3000 GRAPHICS 18:POSITION 5,0:? #6;"Final Score":FOR I=1 TO NP:POSITION 3,I:? #6;"Plyr #";I;" - ";SCORE(I)
3005 NEXT I
3010 GOTO 3010