Dale’s Atari 800 Games › Stan Ockers
By Stan Ockers, in the ACE newsletter of July 1982.
Play FrogIn ‘Frog’ you play the part of an extremely hungry frog. Your object is to eat all bugs before they reach you. You score points depending on the difficulty level. The level of difficulty can set at the start of the game. Either a joystick or paddle controller can be used although I prefer paddles.
‘Frog’ contains some special techniques to add special touches to the game. The bugs are made to blink on and off by a VBI routine that changes the bugs color to background color and back. The VBI routine also has an important function in connection with another routine, the Display List Interrupt routine.
The display list is modified (lines 700-720) to change the text area to two mode 2 lines and also to set display list interrupts at three points down the vertical height of the screen. When these interrupts occur, the DLI routine changes the background color depending on a counter which counts the DLIs. During the vertical blank period this counter is reset to zero, ready for the next screen. This technique gives seperate colors to the sky, water and score areas.
The character set is changed so the frog can be printed in graphics mode 1. In this mode you have a choice of upper case & punctuation or lower case and graphics symbols. I usually pick the former and change the punctuation starting with that above the numerals on the keyboard. (I leave the quotation mark alone). The set must first be moved from ROM to RAM and I use a machine language routine (stored in ZZ$) to do this (line 3000).
To move the tongue in various directions you need to keep track of a number of print positions. I put these locations in strings; a set of X’s and Y’s for each direction (lines 100-120). The positions are recovered from the strings by using the ASC function (see lines 1002 & 1004).
A very useful function in Atari Basic is the the ability to restore data values to the beginning of a certain line. This function is used in picking up the starting positions and increments of the bugs (346 to start or line 347 to continue). Flags [F(I)] keep track of the condition of the bugs; 0 means the bug is not active, 1 - it’s in motion and 2 means it hit something.
WAIT and BUG are counters that skip over the start-a-bug and move bug sections. When the counters reach zero a new bug is started or all bugs are moved and the counters set to MAXWAIT & MAXBUG respectively. The larger these maximums, the slower things go and the difficulty level is increased by reducing MAXWAIT & MAXBUG.
I hope you find something useful in the code of this program as well as enjoying the game itself.
—Stan Ockers

The listing, “FROG by Stan Ockers”, is on pages 6, 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 (Frog_Stan_Ockers_ACE_Newsletter.zip), proofread against the July 1982 scan. The program text matched. That printer couldn't show inverse video, so Stan marked inverse text with comments; the typist missed some of it, and following his comments, 'paddle' and 'joystick' (lines 130 and 135, as line 131 says), 'start' and 'select' (lines 400 and 401) and the bottom row of the frog (line 2020) are now inverse.
Reprinted in Antic, October 1982 (Bonus Game).
0 REM *******************
1 REM **ACE NEWSLETTER***
2 REM **3662 VINE MAPLE**
3 REM ** EUGENE, OR **
4 REM ** 97405 **
5 REM ** $10 YR **
6 REM ** JUL 82 **
7 REM ** **
8 REM *******************
10 REM *****************
20 REM ** FROG **
30 REM ** STAN OCKERS **
35 REM ** 6/82 **
40 REM *****************
49 REM VBI AND DLI ROUTINES
50 FOR I=1536 TO 1613:READ A:POKE I,A:NEXT I:POKE 206,4:POKE 207,4:A=USR(1536)
60 DATA 104,160,10,162,6,169,7,76,92,228,173,199,2,205,200,2,240,16,198,207,208,25,169,5,133,206
70 DATA 173,200,2,141,199,2,208,13,198,206,208,9,169,10,133,207,165,208,141,199,2,169,0,133,209,76,98,228
80 DATA 72,138,72,166,209,189,75,6,141,10,212,141,26,208,232,134,209,104,170,104,64,155,152,24
89 REM CHANGE CHARACTER SET
90 GOSUB 3000
99 REM STRINGS HOLDING PRINT POS.
100 DIM C$(7),X$(7),Y$(7),X5$(7),Y5$(7),X7$(7),Y7$(7),X6$(7),Y6$(7),X14$(7),Y14$(7),X10$(7),Y10$(7)
105 DIM X11$(7),Y11$(7),X9$(7),Y9$(7),BX(7),BY(7)
110 FOR I=1 TO 7:X5$(I)=CHR$(8+I):Y5$(I)=CHR$(8+I):X7$(I)=CHR$(8+I):Y7$(I)=CHR$(9):X6$(I)=CHR$(8+I)
115 Y6$(I)=CHR$(10-I):X14$(I)=CHR$(9):Y14$(I)=CHR$(10-I):X10$(I)=CHR$(10-I):Y10$(I)=CHR$(10-I)
120 X11$(I)=CHR$(10-I):Y11$(I)=CHR$(9):X9$(I)=CHR$(10-I):Y9$(I)=CHR$(8+I)
129 REM CHOOSE INPUT DEVICE
130 GRAPHICS 18:POKE 756,START/256:NEXT I:POSITION 6,3:? #6;"choose":POSITION 4,5:? #6;"1 {inv}paddle{/inv}"
131 REM 'paddle' & 'joystick' IN INVERSE CHAR.
135 POSITION 8,6:? #6;"or":POSITION 4,7:? #6;"2 {inv}joystick{/inv}":OPEN #1,4,0,"K"
140 GET #1,A:IF A<49 OR A>50 THEN 140
150 POSITION 9,9:? #6;CHR$(A):INDEV=A-48
199 REM PROGRAM INITIALIZATION
200 DIM F(7),ST$(10),BP$(4):BP$="burp":MAXWAIT=6:MAXBUG=30
210 RESTORE 220:FOR I=1 TO 10:READ A:ST$(I)=CHR$(A):NEXT I
220 DATA 7,5,6,0,1,3,2,0,0,4
280 POKE 208,37:S=1:REM 208 IS BUG COLOR
285 REM INITIAL DIFFICULTY SELECTION
286 GRAPHICS 1:POKE 708,229:POKE 712,155:GOSUB 700:GOSUB 400
289 REM RESTART GAME
290 FOR I=1 TO 7:F(I)=0:NEXT I:SCORE=0:NUMBUG=0:BONUS=50
300 GRAPHICS 1:POKE 756,START/256:GOSUB 700:X$=X5$:Y$=Y5$:POKE 708,229:POKE 709,54:POKE 710,227:POKE 712,155
305 REM DRAW FROG
306 GOSUB 2000:POSITION 8,5:GOSUB 905
308 REM MAIN LOOP
309 IF INDEV=2 THEN GOSUB 500:GOTO 320
310 S=INT((PADDLE(0)-45)/20):IF S>7 THEN S=7
312 IF S<1 THEN S=1
314 S=8-S
320 POSITION 8,5:GOSUB 900+S
325 IF INDEV=2 AND STRIG(0)=0 THEN GOSUB 1000
330 IF INDEV=1 AND PTRIG(0)=0 THEN GOSUB 1000
339 I=0:IF WAIT>1 THEN WAIT=WAIT-1:GOTO 350
340 WAIT=MAXWAIT
341 I=I+1:IF I=8 THEN 350
342 IF F(I)=0 THEN 341
345 IF F(I)=2 THEN 347
346 RESTORE 800+I:READ DX,DY,BX,BY:POSITION BX,BY:? #6;CHR$(129):F(I)=2:BX(I)=BX:BY(I)=BY:GOTO 341
347 RESTORE 800+I:READ DX,DY:POSITION BX(I),BY(I):? #6;" ":BX(I)=BX(I)+DX:BY(I)=BY(I)+DY
348 POSITION BX(I),BY(I):? #6;CHR$(129):IF BX(I)>5 AND BX(I)<13 AND BY(I)>5 AND BY(I)<11 THEN 370
349 GOTO 341
350 IF BUG>1 THEN BUG=BUG-1:GOTO 360
352 BUG=MAXBUG:IF NUMBUG=7 THEN 360
354 I=INT(RND(0)*7)+1:IF F(I)>0 THEN 354
356 F(I)=1:NUMBUG=NUMBUG+1
360 GOTO 309
369 REM BUG GOT TO FROG
370 POSITION 8,5:? #6;". .":FOR I=1 TO 6:POKE 708,38:SOUND 0,100,12,10:FOR J=1 TO 50:NEXT J
375 POKE 708,36:SOUND 0,150,12,10:FOR J=1 TO 10:NEXT J:NEXT I:SOUND 0,0,0,0
398 GOSUB 400:GOTO 290
399 REM PROMPT FOR NEW GAME
400 POSITION 4,13:? #6;"PRESS {inv}start{/inv}":POSITION 6,14:? #6;"TO PLAY":REM USE IN INVERSE CHAR. IN THESE TWO LINES
401 POSITION 4,16:? #6;"PRESS {inv}select{/inv}":POSITION 3,17:? #6;"FOR DIFFICULTY"
402 POKE 53279,8:K=PEEK(53279):IF K=6 THEN 420
404 IF K=5 THEN MAXWAIT=MAXWAIT-1:MAXBUG=MAXBUG-5:IF MAXBUG<5 THEN MAXBUG=30:MAXWAIT=6
406 POKE 656,0:POKE 657,3:? 7-MAXWAIT
408 FOR I=1 TO 100:NEXT I
410 GOTO 402
420 POSITION 5,16:? #6;" ":POSITION 3,17:? #6;" "
430 IF SCORE>MAXSCORE THEN MAXSCORE=SCORE
440 RETURN
499 REM JOYSTICK SUBROUTINE
500 S0=STICK(0):IF S0=15 OR S0=13 THEN RETURN
510 S=ASC(ST$(S0-4)):RETURN
599 REM BURP SUBROUTINE
600 POKE 77,0:X=1:Y=0:FOR K=1 TO 4:X=X+1:Y=Y+1:POSITION X,Y:? #6;BP$(K,K):NEXT K
620 FOR K=250 TO 150 STEP -3:SOUND 0,K,2,10:NEXT K
630 X=1:Y=0:FOR K=1 TO 4:X=X+1:Y=Y+1:POSITION X,Y:? #6;" ":NEXT K:RETURN
699 REM CHANGE DISPLAY LIST
700 A=PEEK(560)+256*PEEK(561):POKE A+3,198:POKE A+15,134:POKE A+24,134
710 IF PEEK(A)<>66 THEN A=A+1:GOTO 710
720 POKE A,71:POKE A+3,7:POKE A+4,65:POKE A+5,PEEK(A+7):POKE A+6,PEEK(A+8)
722 POKE 512,54:POKE 513,6:POKE 54286,192
730 POKE 656,0:POKE 657,3:? 7-MAXWAIT:POKE 656,0:POKE 657,15:? MAXSCORE
740 POSITION 2,19:? #6;"dif score high":RETURN
800 REM X-Y INCREMENTS & STARTING POS.
801 DATA 1,-1,0,18
802 DATA 1,0,0,9
803 DATA 1,1,0,0
804 DATA 0,1,9,0
805 DATA -1,1,18,0
806 DATA -1,0,18,9
807 DATA -1,-1,18,18
900 REM PRINT EYES ON FROG
901 X$=X9$:Y$=Y9$:? #6;") )":RETURN
902 X$=X11$:Y$=Y11$:? #6;"( (":RETURN
903 X$=X10$:Y$=Y10$:? #6;"# #":RETURN
904 X$=X14$:Y$=Y14$:? #6;"$ $":RETURN
905 X$=X6$:Y$=Y6$:? #6;"% %":RETURN
906 X$=X7$:Y$=Y7$:? #6;"& &":RETURN
907 X$=X5$:Y$=Y5$:? #6;"' '":RETURN
999 REM TONGUE ROUTINE
1000 I=0
1001 I=I+1:IF I=8 THEN 1010
1002 POSITION ASC(X$(I)),ASC(Y$(I)):GET #6,A:C$(I,I)=CHR$(A)
1004 POSITION ASC(X$(I)),ASC(Y$(I)):? #6;CHR$(13):SOUND 0,7-I,8,8:IF A=129 THEN GOTO 1050
1005 GOTO 1001
1010 I=I-1:IF I=0 THEN 1020
1012 POSITION ASC(X$(I)),ASC(Y$(I)):? #6;C$(I,I):SOUND 0,7-I,8,8:GOTO 1010
1020 IF BURP=1 THEN GOSUB 600:BURP=0
1022 SOUND 0,0,0,0:RETURN
1049 REM GOT A BUG
1050 F(S)=0
1060 SCORE=SCORE+10*(7-MAXWAIT):POKE 656,0:POKE 657,8:? SCORE;" ":NUMBUG=NUMBUG-1
1070 IF SCORE>BONUS THEN MAXWAIT=MAXWAIT-1:MAXBUG=MAXBUG-5:BONUS=BONUS+100*(7-MAXWAIT):BURP=1
1072 IF MAXBUG<5 THEN MAXBUG=5:MAXWAIT=1
1080 POKE 656,0:POKE 657,3:? 7-MAXWAIT
1090 C$(I,I)=" ":I=I+1:GOTO 1010
1999 REM PRINT FROG SUBROUTINE
2000 POSITION 6,6:? #6;"+*- -+*":POSITION 6,7:? #6;"+*---+*":POSITION 6,8:? #6;"+-----*"
2010 POSITION 6,9:? #6;"--* +--":POSITION 5,10:? #6;"+-+---*-*"
2020 POSITION 5,11:? #6;"{inv}---------{/inv}":RETURN :REM INVERSE CHAR. IN THIS LINE
2999 REM CHANGE CHAR. SET SUBR.
3000 DIM ZZ$(32):RESTORE 3010:FOR I=1 TO 32:READ A:ZZ$(I)=CHR$(A):NEXT I
3010 DATA 104,104,133,204,104,133,203,104,133,206,104,133,205,162,4,160,0
3020 DATA 177,203,145,205,136,208,249,230,204,230,206,202,208,240,96
3030 POKE 106,PEEK(106)-5:GRAPHICS 0:START=(PEEK(106)+1)*256:POKE 756,START/256:POKE 752,1:? "INITIALIZING ...."
3040 A=USR(ADR(ZZ$),57344,START):RESTORE 3100:FOR I=START+8 TO START+119:READ A:POKE I,A:NEXT I
3050 RETURN
3100 DATA 0,34,85,62,54,85,34,0,0,102,102,102,0,0,0,0,255,241,241,241,129,129,255,255
3110 DATA 255,189,189,189,129,129,255,255,255,143,143,143,129,129,255,255,255,129,143,143,143,129,255,255
3120 DATA 255,129,129,143,143,143,255,255,255,129,241,241,241,129,255,255,255,129,129,241,241,241,255,255
3130 DATA 240,240,240,240,240,240,240,240,15,15,15,15,15,15,15,15,0,0,0,0,0,24,24,48
3140 DATA 255,255,255,255,255,255,255,255,255,145,145,255,145,145,255,255