Wildwest

Type
Game
Category
Paddle catch game
Author
Stan Ockers
Published in
ACE Newsletter (Atari Computer Enthusiasts, Eugene, Oregon), April 1983; reprinted in Page 6 issue 8
Year
1983
Language
Atari BASIC (with machine-language DATA)
Requirements
Any 8-bit Atari with 16K+ and Atari BASIC; one paddle controller in port 1
Dynamite Dan, a cowboy figure made of players, at the top of a red screen with sticks of dynamite falling and four spare hats at the bottom

About the program

If you know Activision's Kaboom!, you know Wildwest. The instructions put it like this: "Dynamite Dan has it in for you". He drops lit sticks of dynamite from the top of the screen, and you slide a sombrero along the bottom with a paddle to catch them. Miss one and the whole volley explodes, and you lose a hat. The REM header in lines 1–8 is the masthead of the ACE newsletter (Atari Computer Enthusiasts of Eugene, Oregon) for April 1983, and the program is by Stan Ockers, ACE's most prolific author. The UK magazine Page 6 also reprinted it, in issue 8.

What you need

A paddle in port 1. The program reads paddle 0 for movement and its trigger (PTRIG(0)) to start each volley. It runs on any Atari with Atari BASIC and 16K or more. On first RUN it builds its data, which the on-screen text says takes 18 seconds.

Typing it in

  • The listing is plain ASCII, but the DATA is long. Lines 1120–1310 hold 398 bytes of machine code for the vertical-blank routine, and lines 460–470 a 42-byte character-set mover. A mistake here usually locks up the machine, so SAVE before you RUN.
  • Line 1040 has twelve values but only nine are read. That's harmless.
  • The big "GAME OVER" banner (lines 350–400) is drawn with # characters and spaces. In the copy reproduced here, runs of spaces have been squeezed to one, so the banner prints as a jumble. The game is unaffected. If you want the banner back, lay out the six rows yourself so the letters line up.

How to play

Press START. At the start of each volley, choose the difficulty (1–9) with SELECT and press the paddle button. Turn the paddle to move the sombrero and catch every falling stick. The score at the top rises as you catch them. Each completed volley raises the difficulty, and each miss lowers it and costs a hat (shown in the bottom-left corner). There's a bonus hat every 1,000 points, up to nine. Press START after "GAME OVER" to play again.

How it works

The BASIC program handles only menus, scoring and the explosions (lines 730–820). The real-time action runs in a deferred vertical-blank interrupt, which lives in the string VBI$ and is installed by the 10-byte routine POKEd to page 6 at line 1330. That routine calls SETVBV ($E45C) with mode 7. Sixty times a second, the VBI reads the paddle, moves the sombrero (player 1) and Dynamite Dan (players 0, 2 and 3, who stroll back and forth along the top), drops the sticks by writing characters straight into screen memory, and checks for catches and misses. It reports back to BASIC through page-6 locations such as 1760 (volley over) and 1768 (sticks caught). BASIC also patches the display list (line 580) so that most of the screen is ANTIC mode 4, the four-colour character mode, and redefines characters for the dynamite, hats and fuses.

Listing

1 REM ******************************
2 REM **ATARI COMPUTER ENTHUSIASTS**
3 REM *********NEWSLETTER***********
4 REM ** 3662 Vine Maple DR **
5 REM ** EUGENE OR 97405 **
6 REM ** April 83 **
7 REM ** $10 yr **
8 REM ******************************
100 REM *******************
110 REM ** WILDWEST **
120 REM ** STAN OCKERS **
130 REM *******************
140 GOSUB 450:GRAPHICS 0:POKE 756,CSPAGE:GOSUB 610:GOSUB 860:GOSUB 1000:GOSUB 1110:GOSUB 1330
150 ? "Press START to begin"
160 IF PEEK(53279)<>6 THEN 160
170 GOSUB 580:RESTORE 180:FOR J=704 TO 712:READ A:POKE J,A:NEXT J:BKG=56
180 DATA 0,44,92,34,66,14,50,0,56
190 DIF=1:SCORE=0:HATS=4:? CHR$(125):POSITION 21,0:? "dif score high":POKE 1761,100:POKE 1762,100
200 FOR J=53248 TO 53251:POKE J,100:NEXT J:POKE 1763,2:POKE 1766,200:POKE 1767,40:GOSUB 1370:BONUS=1000
210 Y=20:FOR X=3 TO HATS*3 STEP 3:GOSUB 840:NEXT X:POSITION 14,0:? HIGH:A=USR(1536):POKE 559,46:POKE 53277,3
220 IF PEEK(53279)=5 THEN DIF=DIF+1:IF DIF=10 THEN DIF=1
230 POSITION 2,0:? DIF:FOR J=1 TO 100:NEXT J:IF PTRIG(0)=1 THEN 220
240 GOSUB 1370:POKE 1760,0:POKE 1781,0:POKE 1768,0:POKE 77,0
250 IF RND(0)<0.01*DIF THEN POKE 1780,1
260 INCR=SCORE+PEEK(1768)*5:POSITION 6,0:? INCR
270 IF PEEK(1760)=0 THEN 250
280 SCORE=INCR:SOUND 1,0,0,0
290 IF SCORE>BONUS THEN BONUS=BONUS+1000:IF HATS<9 THEN HATS=HATS+1:Y=20:X=3*HATS:GOSUB 840
300 IF PEEK(1768)<PEEK(1769) THEN GOSUB 730:GOTO 320
310 DIF=DIF+1:IF DIF>9 THEN DIF=9
320 IF HATS=0 THEN 350
330 GOTO 220
340 REM * game over routine *
350 POSITION 1,7:? " ## # # # ## ## # # ## ##"
360 POSITION 1,8:? "# # # # ## ## # # # # # # # #"
370 POSITION 1,9:? "# # # # # # ## # # ## ## ## # #"
380 POSITION 1,10:? "# ## ### # # # # # # # # ###"
390 POSITION 1,11:? "# # # # # # # # # ### # # #"
400 POSITION 1,12:? " ## # # # # ## ## # ## # #"
410 IF SCORE>HIGH THEN HIGH=SCORE
420 IF PEEK(53279)<>6 THEN 420
430 GOTO 190
440 REM * change character set *
450 DIM MCS$(42):RESTORE 460:FOR J=1 TO 42:READ A:MCS$(J,J)=CHR$(A):NEXT J
460 DATA 104,169,0,133,203,133,205,169,224,133,204,165,106,56,233,5,133,106,24
470 DATA 105,1,133,206,162,4,160,0,177,203,145,205,200,208,249,230,204,230,206,202,208,242,96
480 A=USR(ADR(MCS$)):CSPAGE=PEEK(106)+1:CS=256*CSPAGE
490 RESTORE 500:FOR J=CS+8 TO CS+63:READ A:POKE J,A:NEXT J:RETURN
500 DATA 128,2,32,1,134,1,32,8
510 DATA 2,8,128,2,64,8,32,2
520 DATA 32,130,12,28,20,20,20,20
530 DATA 0,0,8,9,9,9,10,10
540 DATA 0,0,128,128,128,128,128,128
550 DATA 10,10,10,143,143,138,170,0
560 DATA 128,128,128,200,200,136,168,0
570 REM * change display list *
580 DL=PEEK(560)+256*PEEK(561):POKE DL+3,70:POKE DL+6,6:FOR J=DL+7 TO DL+28:POKE J,4:NEXT J
590 RETURN
600 REM * instructions *
610 POKE 752,1:POSITION 5,1:? " # # # WILDWEST # # #"
620 POSITION 2,3:? "Dynamite Dan has it in for you."
630 ? "He drops lighted sticks from the":? "top of the screen at rates which"
640 ? "vary with the difficulty level.":? "Using paddle zero you move a sombrero"
650 ? "to catch them before they reach the":? "bottom and explode. Each time you"
660 ? "miss you lose a hat. Lose all hats":? "and the game is over."
670 ?:? "The difficulty level goes down on":? "each miss, increases with each"
680 ? "sucessful group. You may also change":? "the difficulty level with the SELECT"
690 ? "key during breaks. You get a bonus":? "hat every 1000 points. Use START to"
700 ? "restart the game.":?:? "Initalization takes 18 seconds.":? "INITIALIZING"
710 RETURN
720 REM * explosion routine *
730 X=0:J=0:COL=20
740 IF PEEK(1664+X)=0 THEN 780
750 P=PEEK(1724+X)+PEEK(1736+X)*256:POKE P,1:POKE P+1,2:J=J+1:IF J=4 THEN J=0
760 FOR K=0 TO 2:SOUND J,50+RND(0)*50,8,13+K:NEXT K:POKE 712,COL+8*X
770 POKE P,PEEK(1712+X):POKE P+1,0:FOR L=1 TO 30*RND(0):NEXT L
780 X=X+1:IF X<12 THEN 740
790 SOUND 0,0,0,0:SOUND 1,0,0,0:SOUND 2,0,0,0:SOUND 3,0,0,0:POKE 712,BKG
800 X=HATS*3:Y=20:POSITION X,Y:? " ":POSITION X,Y+1:? " ":HATS=HATS-1
810 DIF=DIF-1:IF DIF=0 THEN DIF=1
820 RETURN
830 REM * print hat *
840 POSITION X,Y:? "$%":POSITION X,Y+1:? "&'":RETURN
850 REM * PM graphics *
860 DIM X$(1):A=ADR(X$):B=INT((A-512)/1024+1)*1024:DIM F$(B-A+511):DIM P0$(128)
870 DIM P1$(128),P2$(128),P3$(128):POKE 54279,B/256
880 DIM C1$(15):RESTORE 890:FOR J=1 TO 15:READ A:C1$(J,J)=CHR$(A):NEXT J
890 DATA 16,56,186,124,0,40,0,40,16,198,170,146,130,68,68
900 P0$(1)=CHR$(0):P0$(128)=CHR$(0):P0$(2)=P0$:P1$=P0$:P2$=P0$:P3$=P0$:P0$(26)=C1$
910 DIM C2$(11):RESTORE 920:FOR J=1 TO 11:READ A:C2$(J,J)=CHR$(A):NEXT J
920 DATA 124,254,254,124,56,16,0,0,0,198,130
930 P2$(30)=C2$
940 DIM C3$(6):RESTORE 950:FOR J=1 TO 6:READ A:C3$(J,J)=CHR$(A):NEXT J:P3$(34)=C3$
950 DATA 170,184,170,184,170,184
960 DIM H$(9):RESTORE 970:FOR J=1 TO 9:READ A:H$(J,J)=CHR$(A):NEXT J:P1$(80)=H$:POKE 53257,1
970 DATA 124,198,124,124,56,56,56,56,40
980 RETURN
990 REM * various strings *
1000 DIM CSND$(15):RESTORE 1020:FOR J=1 TO 15:READ A:CSND$(J,J)=CHR$(A):NEXT J
1010 A=ADR(CSND$):HI=INT(A/256):LO=A-256*HI:POKE 1774,LO:POKE 1776,HI
1020 DATA 30,142,1,25,140,1,20,138,1,15,138,1,0,0,0
1030 DIM DSPD$(9):RESTORE 1040:FOR J=1 TO 9:READ A:DSPD$(J,J)=CHR$(A):NEXT J
1040 DATA 5,5,4,4,4,3,3,2,2,2,1,1
1050 DIM DDLY$(9):RESTORE 1060:FOR J=1 TO 9:READ A:DDLY$(J,J)=CHR$(A):NEXT J
1060 DATA 30,25,20,15,10,5,5,5,5
1070 DIM CNT$(9):RESTORE 1080:FOR J=1 TO 9:READ A:CNT$(J,J)=CHR$(A):NEXT J
1080 DATA 15,20,25,30,35,40,45,50,55
1090 RETURN
1100 REM * create VBI string *
1110 DIM VBI$(398):RESTORE 1120:FOR J=1 TO 398:READ A:VBI$(J,J)=CHR$(A):NEXT J:RETURN
1120 DATA 173,234,6,240,57,206,236,6,16,52,173,238,6,133,208,173,240,6,133,209,172,242,6
1130 DATA 177,208,240,21,141,0,210,200,177,208,141,1,210,200,177,208,141,236,6,200,140,242,6
1140 DATA 208,14,169,0,141,0,210,141,1,210,141,234,6,141,242,6,216,173,224,6,240,3,76,98,228
1150 DATA 173,112,2,73,255
1160 DATA 141,1,208,141,226,6
1170 DATA 173,225,6,24,109,227,6,205,230,6,176,27,205,231,6,144,22,141,225,6,141,0,208,141,2,208,141,3,208
1180 DATA 173,244,6,240,13,169,0,141,244,6
1190 DATA 173,227,6,73,255,141,227,6,206,228,6,16,78,173,245,6,205,233,6,176,70,173,229,6,141,228,6
1200 DATA 162,11,189,128,6,240,5,202,16,248,48,52
1210 DATA 165,89,157,200,6,165,88,24,105,120,157,188,6,144,3,254,200,6,173,225,6,157,164,6,56,233,40
1220 DATA 74,74,24,125,188,6,157,188,6,144,3,254,200,6,169,1,157,128,6,141,235,6,238,245,6
1230 DATA 162,11,189,128,6,240,110,222,140,6,189,140,6,16,102,189,152,6,157,140,6,189,188,6,133,208,189,200,6
1240 DATA 133,209,189,176,6,160,0,145,208,165,208,24,105,40,133,208,157,188,6,144,5,230,209,254,200,6
1250 DATA 254,212,6,189,212,6,201,11,144,28,201,17,176,24,189,164,6,24,105,9,205,226,6,144,13
1260 DATA 56,233,18,205,226,6,176,5,144,30,24,144,165,189,212,6
1270 DATA 201,20,144,8,169,1,141,224,6,24,144,42,177,208,157,176,6
1280 DATA 169,3,145,208,24,144,27,169,1,141,234,6,169,0,157,128,6,157,212,6,157,176,6
1290 DATA 238,232,6,173,232,6,205,233,6,176,209,202,16,196
1300 DATA 169,0,141,2,210,141,3,210,162,11,189,128,6,208,6,202,16,248,76,98,228
1310 DATA 165,20,41,1,141,2,210,169,6,141,3,210,24,144,235
1320 REM * insert VBI *
1330 RESTORE 1350:FOR J=1536 TO 1545:READ A:POKE J,A:NEXT J
1340 VBI=ADR(VBI$):HI=INT(VBI/256):LO=VBI-256*HI:POKE 1538,LO:POKE 1540,HI:RETURN
1350 DATA 104,160,0,162,0,169,7,76,92,228
1360 REM * init. page 6 values *
1370 FOR J=1664 TO 1675:POKE J,0:NEXT J:FOR J=1748 TO 1759:POKE J,0:NEXT J
1380 A=ASC(DSPD$(DIF)):FOR J=1676 TO 1699:POKE J,A:NEXT J
1390 A=ASC(DDLY$(DIF)):POKE 1764,A:POKE 1765,A
1400 A=ASC(CNT$(DIF)):POKE 1769,A:POKE 1768,0
1410 RETURN

Credits