Arena Psychotica
- Type
- Game
- Category
- Arcade maze game (race car versus trail-laying monster)
- Author
- Erik Wolpaw
- Published in
- Antic, April 1984 (Vol. 3, No. 1)
- Year
- 1984
- Language
- Atari BASIC (with machine-language routines)
- Requirements
- 16K RAM (24K with disk), Atari BASIC, joystick in port 1
- Tags
- antic, arcade, joystick, machine-language, display-list-interrupt, antic-mode-4, redefined-characters, erik-wolpaw, 1984
- Related
- Air Raid 2000, Gobbler, Bomb Squad, Box-In, Q.T., Wireball
About the program
Arena Psychotica was Erik Wolpaw's second game for Antic, after Air Raid 2000 in November 1983. The magazine noted that he was then a junior at Cleveland Heights High School in Ohio. The article calls it "very challenging", and it is.
You drive a small race car round an arena. To clear a wave, run over all the prizes scattered about the floor. Each prize makes the car faster. Meanwhile a monster wanders at random, leaving a checkered trail behind it. Touch the monster, its trail or your own trail and you lose a car. Every wave also has one energizer. Hit it and you briefly become a Gobbler that can eat through both trails for a point a piece. A change in the tone warns that you're about to turn back into a car.
Typing it in
Only one line has a special character: the inverse psychotica in line 102 ({inv}…{/inv}: press the Atari key before and after). The REM in line 95 says the next line has 42 spaces. The string in line 100 on the disk actually holds 40, enough to blank a full screen row, so count them carefully. Most of the program is DATA for machine language and two character sets, and one wrong number there can crash the program, so check those lines with care.
How to play
The opening screen says GAME OVER. Plug a joystick into port 1 and press the button to start. Each new wave adds one more prize to collect, and every fifth wave brings a new type of prize. You start with three cars and earn one more every 100 points. The game ends when you run out of cars or after 24 waves. Press the button to play again.
How it works
- Machine language does the moving. The BASIC main loop (lines 15–72) calls two routines each time round.
USR(1542)reads the joystick from location 632 and moves the car directly in screen memory.USR(1684)moves the monster in a random direction, using the POKEY random-number register, and lays its trail. Each routine reports what the car ran into through location 1540, and BASIC decides whether it was a prize, the energizer or a crash. - A custom screen. Line 600 changes the GRAPHICS 0 display list. The arena rows become ANTIC mode 4 (four-colour characters), and the bottom rows become mode 6 (large text).
- A display-list interrupt. Lines 400–425 set the interrupt bit on the last arena row. The 21-byte handler switches back to the ROM character set and changes the colours, so the status lines under the arena show ordinary white letters on black.
- Animation by page-flipping fonts. Lines 750–766 build two redefined character sets eight pages apart. Line 17 flips location 756 between them, so the car, monster and prizes animate without being redrawn.
Listing
0 REM ARENA PSYCHOTICA
1 REM BY E.F. WOLPAW
2 REM ANTIC MAGAZINE APRIL 1984
3 W=0:MA=3:D=1
5 GOSUB 200:GOSUB 700:GOSUB 600:POKE 756,PEEK(106):GOSUB 800:GOSUB 400:GOSUB 300
6 POKE 207,PEEK(88):POKE 208,PEEK(89):GOSUB 100:GOTO 1500
7 SETCOLOR 4,0,11:SETCOLOR 0,1,12:SETCOLOR 1,3,8:SETCOLOR 2,0,0:W=0:GOSUB 100
10 POKE 1537,14:POKE 204,PEEK(89)+1:POKE 1538,75:POKE 1539,1:POKE 1541,0:POKE 208,PEEK(89)+1:POKE 1791,10
12 POKE 1791,INT(RND(1)*255)+1
15 X=USR(1542):X=USR(1684)
17 TI=TI+1:TI=TI-2*(TI=3):POKE 756,PEEK(106)+8*(TI=2):FOR I=1 TO 50-(T*3):NEXT I
20 IF PEEK(1540)=0 AND PM=0 THEN 15
21 A=PEEK(1540):IF A=3 THEN GOSUB 3000:GOTO 40
22 IF PM=1 THEN 45
25 IF A=1 OR A=4 OR A=17 OR A=100 THEN 1000
30 T=T+1:N=N-1:SOUND 2,115,10,15:FOR I=1 TO 30:NEXT I:SOUND 2,0,0,0:IF N=0 THEN SOUND 1,0,0,0:GOSUB 100:GOTO 10
33 IF PM=1 THEN 15
35 SOUND 1,250-T*6,6,6:GOTO 15
40 POKE 1541,5:SOUND 1,0,0,0:PM=1:PT=30:POKE 1539,0:GOTO 15
42 IF A<19 OR A>25 THEN 15
45 PT=PT-1:IF PT<0 THEN POKE 1541,0:PM=0:POKE 1539,1:SOUND 2,0,0,0:GOTO 35
46 D=D*(-1):SOUND 2,100+(D*20)+40*(PT<6),10,4
48 PE=PEEK(1540):IF PE=0 OR PE=1 OR PE=100 THEN 65
54 IF PE>19 AND PE<25 THEN 30
55 IF PE=17 OR PE=4 THEN 1000
60 GOTO 15
65 IF PE=0 THEN 15
66 IF PE=100 THEN PT=PT-5
67 SCO=SCO+1:IF SCO/100=INT(SCO/100) THEN GOSUB 2500:MA=MA+1:POSITION 7,19:? "CARS-";MA
69 POSITION 6,20:? "SCORE-";SCO
72 GOTO 15
95 REM NEXT LINE HAS 42 SPACES
100 FOR I=0 TO 22:POSITION 0,I:? " ";:NEXT I:SOUND 2,0,0,0:GOSUB 300
101 POKE 752,20:T=0:POKE 1541,0:PM=0:POKE 1539,1
102 POSITION 7,19:? "CARS-";MA:POSITION 6,20:? "SCORE-";SCO:POSITION 2,21:? "ARENA {inv}psychotica{/inv}"
104 W=W+1:IF W=24 THEN 2000
105 C=INT(W/5)+51:FOR I=1 TO W
110 X=INT(RND(1)*37)+2:Y=INT(RND(1)*16)+3:LOCATE X,Y,R:IF R<>32 THEN 110
112 IF X=27 AND Y=7 THEN 110
115 POSITION X,Y:? CHR$(52+INT(W/5)):NEXT I
117 N=W
120 X=INT(RND(1)*37)+2:Y=INT(RND(1)*16)+3:LOCATE X,Y,R:IF R<>32 THEN 120
122 POSITION X,Y:? "#"
125 FOR I=1 TO W:POSITION I,0:? CHR$(52+INT(I/5)):NEXT I:SOUND 1,250-T*6,6,6:RETURN
200 DATA 104,172,2,6,173,120,2,201,13,240,66,201,14,240,82,201,11,240,42,201,7,240,6,173,1,6,76,13,6,141,1,6,173
205 DATA 3,6,145,203,200,208,2,230,204,177,203,141,4,6,173,1,6,24,109,5,6,145,203,152,141,2
210 DATA 6,96,141,1,6,173,3,6,145,203,136,208,226,198,204,76,48,6,141,1,6,173,3,6,145,203,152,24,105,40,144,2
215 DATA 230,204,168,76,48,6,141,1,6,173,3,6,145,203,152,56,233,40,176,2,198,204,168,76,48,6
220 FOR I=1542 TO 1662:READ X:POKE I,X:NEXT I:RETURN
300 POKE 559,34
302 FOR I=1 TO 18:POSITION 0,I:? "$";:POSITION 39,I:? "$";:NEXT I:FOR I=0 TO 39:POSITION I,1:? "$";
305 POSITION I,18:? "$";:NEXT I
306 FOR I=3 TO 16:POSITION 2,I:? "$";:POSITION 37,I:? "$";:NEXT I:FOR I=4 TO 16 STEP 2:POSITION 2,I:? "1";
307 POSITION 37,I:? "1";:NEXT I
310 FOR I=1 TO 18 STEP 2:POSITION 0,I:? "1";:POSITION 39,I:? "1";:NEXT I:FOR I=0 TO 38 STEP 2:POSITION I,1:? "1";
315 POSITION I,18:? "1";:NEXT I:RETURN
400 RESTORE 425:POKE DL+23,PEEK(DL+23)+128:FOR I=1663 TO 1683:READ X:POKE I,X:NEXT I:POKE 513,6:POKE 512,127
405 POKE 54286,192:RETURN
425 DATA 72,169,14,141,10,212,141,22,208,169,0,141,26,208,169,224,141,9,212,104,64
600 DL=PEEK(560)+256*PEEK(561):POKE DL+3,PEEK(DL+3)+2:FOR I=DL+6 TO DL+23:POKE I,4:NEXT I
605 FOR I=DL+24 TO DL+28:POKE I,6:NEXT I:RETURN
700 DATA 112,235,235,40,40,235,235,195,195,104,195,195,235,235,40,40,235,235,88,207,207,168,168,168,168,207,207
705 DATA 56,243,243,42,42,42,42,243,243,8,192,192,48,48,12,12,3,3,160,12,12,48,40,40,170,40,40
707 DATA 24,20,20,85,85,85,85,20,20
710 DATA 32,255,255,255,255,255,255,255,255,136,170,170,170,170,170,170,170,170
715 DATA 96,20,20,64,64,64,64,20,20,128,20,20,1,1,1,1,20,20,144,20,20,65,65,65,65,0,0,152,0,0,65,65,65,65,20,20
720 DATA 168,130,130,0,0,0,0,130,130,176,5,5,60,12,15,12,51,34,184,60,60,255,119,119,255,255,51
723 DATA 192,252,60,252,48,56,48,204,204
725 DATA 400,60,227,60,60,60,195,195,0,800,165,165,165,165,90,90,90,90
745 DATA -1
750 POKE 106,PEEK(106)-8:GRAPHICS 0:ST=PEEK(106)*256:RESTORE 700
755 READ R:IF R=-1 THEN 762
760 FOR I=0 TO 7:READ Z:POKE R+I+ST,Z:NEXT I:GOTO 755
762 POKE 106,PEEK(106)-8:ST1=PEEK(106)*256:RESTORE 770
764 READ R:IF R=-1 THEN RETURN
766 FOR I=0 TO 7:READ Z:POKE R+I+ST1,Z:NEXT I:GOTO 764
770 DATA 112,235,235,40,40,235,235,195,195,104,195,195,235,235,40,40,235,235,88,207,207,168,168,168,168,207,207
775 DATA 56,243,243,42,42,42,42,243,243,8,3,3,12,12,48,48,192,192,160,48,48,48,40,40,170,40,40
780 DATA 136,255,255,255,255,255,255,255,255,32,170,170,170,170,170,170,170,170
782 DATA 192,252,248,252,48,48,56,48,48
787 DATA 96,20,20,85,85,85,85,20,20,128,20,20,85,85,85,85,20,20,144,20,20,85,85,85,85,20,20
788 DATA 152,20,20,85,85,85,85,20,20
789 DATA 168,0,0,40,40,40,40,0,0,176,20,20,12,63,12,12,51,34,184,60,60,255,221,221,255,255,204
790 DATA 400,0,60,203,60,60,60,60,60,800,90,90,90,90,165,165,165,165
795 DATA -1
800 DATA 165,207,133,205,165,208,133,206
803 DATA 104,172,255,6,173,10,210,41,3,201,3,240,53,201,2,240,65
805 DATA 201,1,240,33,240,0,169,100,145,205,200,208,2,230,206,177
810 DATA 205,208,17,169,50,24,145,205,165,205,133,207,165,206,133,208,152,141,255
815 DATA 6,96,169,100,145,205,136,208,227,198,206,76,188,6,169,100
820 DATA 145,205,152,24,105,40,144,2,230,206,168,76,188,6,169,100
825 DATA 145,205,152,56,233,40,176,2,198,206,168,76,188,6
840 RESTORE 800:FOR I=1684 TO 1789:READ X:POKE I,X:NEXT I:RETURN
1000 MA=MA-1:GOSUB 1600:IF MA=0 THEN 1500
1005 W=W-1:GOSUB 100:GOTO 10
1500 POKE 559,34:SOUND 1,0,0,0:POSITION 6,19:POKE 77,128:? "GAME OVER":IF STRIG(0)=1 THEN 1500
1505 SCO=0:MA=3:POKE 77,0:GOTO 7
1600 FOR I=44 TO 0 STEP -1:SOUND 1,20+I*2,8,10:SETCOLOR 1,0,11-INT(I/4):SETCOLOR 2,0,11-INT(I/4):NEXT I
1605 SOUND 1,75,8,15:ICR=0.79+6/100:V1=15:V2=15:V3=15
1610 R=INT(RND(1)*15)+1:SETCOLOR 1,3,R:SETCOLOR 2,3,R:SOUND 0,20,8,V1:SOUND 2,40,8,V2
1615 SOUND 3,70,8,V3:V1=V1*ICR:V2=V2*(ICR+0.05):V3=V3*(ICR+0.08):IF V3>1 THEN 1610
1620 POKE 559,0:FOR I=0 TO 3:SOUND I,0,0,0:NEXT I:SETCOLOR 1,3,8:SETCOLOR 2,0,0:RETURN
2000 POSITION 1,19:? "{inv}congratulations{/inv}":POSITION 3,20:? "YOU HAVE WON":GOTO 1500
2500 DATA 108,15,1,1,108,15,1,1,108,7,128,25,144,25,162,25,1,15,81,15,0,0
2505 RESTORE 2500
2510 READ X,Y:IF X=0 THEN SOUND 2,0,0,0:RETURN
2520 SOUND 2,X,10,15:FOR I=1 TO Y:NEXT I:GOTO 2510
3000 DATA 81,10,1,1,81,10,1,1,81,10,1,1,81,20,91,45,96,10,81,50,0,0
3005 RESTORE 3000
3010 READ X,Y:IF X=0 THEN RETURN
3020 SOUND 1,X,10,15:FOR I=1 TO Y:NEXT I:GOTO 3010
7301 DATA 486,130,130,0,0,0,0,130,130,494,5,5,60,12,15,12,51,34,502,60,60,255,119,119,255,255,51
Download
The original program from the Antic disk, to LOAD or ENTER instead of typing it: ARENA.BAS.
Credits
- Program listing: Arena Psychotica — program listing (Antic, April 1984 (Vol. 3, No. 1)) — Erik Wolpaw
- Picture: In the arena: the monster's checkered trail snakes across the floor. — Erik Wolpaw (program); screenshot by the site
- Antic, April 1984 - Vol. 3 No. 1: scan of the printed magazine, Arena Psychotica, by Erik Wolpaw, pp. 84-87 — Erik Wolpaw; Internet Archive, 1984
- Antic disk, April 1984 - Vol. 3 No. 1: ARENA.BAS (detokenized listing) — Erik Wolpaw, 1984
