Doomed

Type
Game
Category
Single-screen survival action game
Author
Tony Barnes
Published in
Antic, June 1989 (Vol. 8, No. 2)
Year
1989
Language
Atari BASIC
Requirements
32K RAM, Atari BASIC, joystick in port 1; disk or cassette
A brick-walled pit with a green coiled creature at the left and a green two-headed beast mid-screen, above a maroon panel with the Doomed logo, TONY BARNES ANTIC, the score and a row of blue flags

About the program

Doomed was Antic's "Game of the Month" in June 1989. The setup is short and grim: you've been found guilty and thrown into a pit, with the promise that if you survive three minutes you can go free. Then the beasts start charging in from both sides, faster and faster. Luckily, it turns out you can kill them with your mind.

Tony Barnes was a freshman at a San Francisco community college. He had already written two Antic games, Escape From Hell (June 1988) and Shutdown (April 1989). Like those, Doomed squeezes smooth player-missile animation, a redefined character set and display-list-interrupt colours out of Atari BASIC with a few small machine-language routines.

What you need

An Atari 8-bit with at least 32K, Atari BASIC and a joystick in port 1. The magazine supported both disk and cassette.

Typing it in

The disk listing here is complete. The magazine warned that lines 50, 5530–5565, 11000–11010 and 20006–20010 are hard to type. They hold machine code, player shapes and character data as strings of control and inverse characters, so it also printed a second program that wrote those lines to a file LINES.LST for you to ENTER after loading the main listing. If you type them by hand: {inv}…{/inv} means inverse (Atari key), {CTRL-x} means hold CTRL and press the key ({CTRL-,} is the heart, ATASCII 0), and the cursor and edit codes {UP} {LEFT} {RIGHT} {BACK S} {TAB} {INS CHAR} {DEL CHAR} {CTRL-TAB} are typed as ESC followed by that key. One wrong byte in these strings can crash the machine, so SAVE before you RUN.

How to play

RUN it and wait. Setting up the character set and machine code takes a little while with the screen off. The title scene plays out ("GUILTY AS CHARGED… but i am innocent… TO THE DOOM CHAMBER"). Press the joystick button to start; it also skips the introduction.

  • Move left and right with the stick. Push forward to jump. While you're falling you can steer left or right.
  • Button plus left or right fires your mind-blaster beside you. Each beast you destroy scores 5.
  • Beasts on the floor are out of the blaster's range, so you have to jump over them.
  • Later on, the floor starts to crumble. Jump over the holes, and steer onto solid bricks if you start to fall.
  • The flags at the bottom show your strength, and each hit costs one. When they're gone, you're doomed.

Survive, and the program has a twist for you at the end.

How it works

  • Players in strings. Line 5500 DIMs a dummy string F2$ just long enough to push PM$ onto a 1K boundary. The missile and four player strings (M$, P0$–P3$, 128 bytes each) are then DIMmed straight after it, so together they form the double-line player-missile area, and line 5515 points PMBASE (54279) at it. Moving a sprite up or down is then a fast string assignment such as P0$(Y1)=R1$, and the walking frames L1$/L2$/R1$/R2$ are swapped the same way.
  • Machine-code helpers. MOV (line 20010) is a block-move routine that copies the ROM font to 38912 and pokes in the redefined characters from C$: each 9-byte record is a character number plus its 8 bytes. DLI$ (lines 11000–11010) is a display-list interrupt, switched on for display-list bytes 10–12 by lines 10000–10040, that changes colours partway down the screen.
  • Collisions. After each mind-blast, the player-to-player collision register for the blast (53261) reports value 4 or 8 when player 2 or 3 is hit. Register 53260 tells the program that a beast has touched you. POKE 53278,1 clears them all.
  • The clock. Line 100 watches location 19, the middle byte of the system's frame counter. Every 1,024 frames (about 17 seconds on an NTSC machine) the level, and with it the beasts' speed, goes up by one. After level 8 you've won. From level 6, line 250 erodes random floor bricks.

Variations to try

  • Change LVL>5 in line 1001 to make the floor start crumbling sooner or later.
  • Shorten or lengthen the ordeal by changing LVL>8 in line 100.

Listing

2 REM DOOMED
4 REM BY TONY BARNES
6 REM (c)1989, ANTIC PUBLISHING INC.
10 GRAPHICS 18:GOSUB 50:GOSUB 20000:GOSUB 11000:GOSUB 10000:GOSUB 5500:GOSUB 40
20 POSITION 3,7:? #6;"&'":POSITION 3,8:? #6;"()**+,-"
25 POSITION 0,9:? #6;"tony barnes    antic";
30 GOTO 8000
40 POKE 708,6:POKE 710,22:POKE 709,10:RETURN
50 BRK=USR(ADR("h{inv}){/inv}{CTRL-,}{inv}{CTRL-E}{/inv}Mhh{inv}I{/inv}{CTRL-,}{inv}p{/inv}{CTRL-G}{inv}){/inv}p{inv}{CTRL-E}{/inv}{CTRL-P}{inv}{CTRL-M}{/inv}{CTRL-N}{inv}R{/inv}{CTRL-.}"),1):RETURN
60 FOR T=15 TO 0 STEP -1:SOUND 0,193,10,T:SOUND 1,47,12,T:NEXT T
65 SC=SC+5:POKE 53278,1:POSITION 0,11:? #6;SC:RETURN
100 IF PEEK(19)>=4 THEN POKE 19,0:LVL=LVL+1:IF LVL>8 THEN 1300
105 MN= NOT MN:IF MN THEN 200
110 IF X2<57 OR X2>190 OR Z1=1 THEN 130
115 X2=X2+D2:POKE 53250,X2:SOUND 3,PEEK(53770),2,1:RETURN
130 FOR T=200 TO 192 STEP -1:SOUND 0,T,12,2:POKE 706,T:NEXT T
135 POKE 53250,0:POKE 706,200:Z1=0:P2$=PM$:I=INT(RND(0)*2)
140 D2=LVL*(I=0)-LVL*(I>0):X2=57*(I=0)+190*(I>0):I=INT(RND(0)*3)+1
145 Y2=31*(I=1)+39*(I=2)+47*(I=3):IF D2<0 THEN P2$(Y2)=BR$:RETURN
150 IF D2>0 THEN P2$(Y2)=BL$:RETURN
200 IF X3<57 OR X3>190 OR Z2=1 THEN 220
205 X3=X3+D3:POKE 53251,X3:SOUND 2,PEEK(53770),2,1:RETURN
210 FOR T=200 TO 192 STEP -1:SOUND 0,T,12,2:POKE 707,T:NEXT T
220 POKE 53251,0:POKE 707,200:Z2=0:P3$=PM$:I=INT(RND(0)*2)
225 D3=LVL*(I=0)-LVL*(I>0):X3=57*(I=0)+190*(I>0):I=INT(RND(0)*3)+1
230 Y3=31*(I=1)+39*(I=2)+47*(I=3):IF D3<0 THEN P3$(Y3)=BR$:RETURN
235 IF D3>0 THEN P3$(Y3)=BL$:RETURN
250 I=INT(RND(0)*18)+1:LOCATE I,5,Z:T=132*(Z=132 OR Z=162)+162*(Z=161)+35*(Z=35)
255 COLOR T:PLOT I,5:RETURN
1000 ST=PEEK(632):GOSUB 100:POKE 53278,1:IF PEEK(53260)>0 THEN GOSUB 1200
1001 IF LVL>5 THEN GOSUB 250
1002 IF PEEK(644)=0 AND ST<12 THEN 1100
1005 X=INT((X1-44)/8):Y=INT((Y1-16)/8):LOCATE X,Y+2,Z:IF Z=132 THEN 1250
1010 IF Z=32 THEN Y1=Y1+1:IF ST>12 THEN P0$(Y1)=R1$
1015 IF (ST=10 OR ST=6 OR ST=14) AND Z<>32 THEN 1150
1030 X=X-(ST>8 AND ST<12)+(ST<8):IF X<1 OR X>18 THEN 1035
1032 X1=X1-2*(ST>8 AND ST<12)+2*(ST<8):WLK= NOT WLK
1035 IF ST<8 THEN 1060
1037 IF ST>12 THEN 1000
1040 IF WLK=0 THEN P0$(Y1)=R1$
1045 IF WLK=1 THEN P0$(Y1)=R2$
1055 POKE 53248,X1:GOTO 1000
1060 IF WLK=0 THEN P0$(Y1)=L2$
1065 IF WLK=1 THEN P0$(Y1)=L1$
1075 POKE 53248,X1:GOTO 1000
1100 SOUND 0,143,10,3:SOUND 1,147,10,3:POKE 53249,X1-17*(ST>8)+9*(ST<8)
1105 GOSUB 100:IF ST>8 THEN P0$(Y1)=R1$:P1$(Y1+3)="U{inv}*{/inv}"
1110 IF ST<8 THEN P0$(Y1)=L1$:P1$(Y1+3)="{inv}*{/inv}U"
1115 POKE 705,PEEK(20):IF PEEK(53261)=4 THEN Z1=1:GOSUB 60
1120 IF PEEK(53261)=8 THEN Z2=1:GOSUB 60
1125 POKE 53278,1:IF PEEK(53260)>=4 THEN GOSUB 1200
1130 SOUND 0,0,0,0:SOUND 1,0,0,0:P1$=PM$:POKE 53249,255:POKE 53278,1:GOTO 1005
1150 FOR Q=0 TO 10:SOUND 0,100,8,10-Q:IF X1<57 OR X1>191 THEN 1165
1160 X1=X1-(ST=10)+(ST=6)
1165 Y1=Y1-1:IF ST=14 THEN P0$(Y1)=L2$
1170 IF ST>8 AND ST<12 THEN P0$(Y1)=R1$
1175 IF ST<8 THEN P0$(Y1)=L1$
1180 POKE 53278,1:GOSUB 100:IF PEEK(53260)>=4 THEN GOSUB 1200
1185 POKE 53248,X1:NEXT Q:GOTO 1000
1200 FOR T=15 TO 0 STEP -1:SOUND 1,PEEK(53770),10,T:NEXT T
1205 PWR=PWR-1:IF PWR<-1 THEN 1250
1210 COLOR 32:PLOT 11+PWR,11:RETURN
1250 POP :FOR I=0 TO 3:SOUND I,0,0,0:NEXT I
1255 FOR T=0 TO 15:SOUND 0,PEEK(53770),8,T:SOUND 1,PEEK(53770),12,T:NEXT T
1260 FOR T=15 TO 0 STEP -1:SOUND 0,PEEK(53770),8,T
1270 SOUND 1,PEEK(53770),12,T:FOR I=704 TO 711:POKE I,T:NEXT I:NEXT T
1275 FOR T=0 TO 300:NEXT T:P0$=PM$:P1$=P0$:P2$=PM$:P3$=PM$:GOTO 8000
1300 FOR T=140 TO 126 STEP -0.3:SOUND 0,T,8,2:SOUND 1,T,12,2:POKE 704,T
1305 NEXT T:P0$=PM$:P1$=PM$:P2$=PM$:P3$=PM$:FOR T=0 TO 3:SOUND T,0,0,0
1310 POKE 53248+T,0:NEXT T:POKE 559,0:POKE 711,146:POSITION 0,0
1315 ? #6;"{inv}!!!!{/inv}############{inv}!!!!{/inv}";
1320 ? #6;"#  {inv}!!!!!!!!!!!{/inv}#{inv}!!{/inv}  {inv}!{/inv}";
1325 ? #6;"#            {inv}!!!{/inv}   {CTRL-E}";
1330 ? #6;"##                 {CTRL-E}";
1335 ? #6;"###                {CTRL-E}";
1340 ? #6;"{inv}!!!!!!!!!!!!!!!!!!!!{/inv}";
1345 P3$(36)=H$:P0$(39)=R1$:POKE 53251,80:POKE 53248,120:POKE 559,46
1350 POKE 707,255:FOR T=0 TO 400:NEXT T:TMR=0
1355 IF TMR<60 THEN POSITION 0,11:? #6;"YOU HAVE EARNED "
1360 IF TMR>60 AND TMR<120 THEN POSITION 0,11:? #6;"YOUR FREEDOM    "
1365 IF TMR>120 AND TMR<200 THEN POSITION 0,11:? #6;"{inv}FREEDOM???{/inv}      "
1370 IF TMR>200 AND TMR<250 THEN POSITION 0,11:? #6;"I WAS INNOCENT  "
1375 IF TMR>250 AND TMR<280 THEN POSITION 0,11:? #6;"TO BEGIN WITH   "
1380 IF TMR>280 THEN POSITION 0,11:? #6;"HA HA HA HA HA"
1385 TMR=TMR+1:POKE 707,248+4*(RND(0)*1):IF TMR<310 THEN 1355
1390 GOTO 1260
5500 POKE 559,0:DIM F$(1),F2$((INT(ADR(F$)/1024)+1)*1024-ADR(F$)-1),PM$(384),M$(128)
5505 DIM P0$(128),P1$(128),P2$(128),P3$(128)
5510 PM$="{CTRL-,}":PM$(384)="{CTRL-,}":PM$(2)=PM$:M$=PM$:P0$=M$:P1$=P0$:P2$=P1$:P3$=P2$
5515 POKE 54279,ADR(PM$)/256:POKE 53277,3:POKE 623,24:POKE 53257,1
5520 DIM L1$(18),L2$(18),R1$(18),R2$(18),BL$(12),BR$(12),H$(10)
5530 L1$="{CTRL-,}{CTRL-N}{UP}{LEFT}{CTRL-N}0lr<Lp<{CTRL-N}{inv}vf{/inv}{CTRL-L}{CTRL-L}{CTRL-,}"
5540 L2$="{CTRL-,}{CTRL-N}{UP}{LEFT}{CTRL-N}0|n{inv}^^\{/inv}>7cc{inv}CC{/inv}{CTRL-,}"
5545 R1$="{CTRL-,}p8xp{CTRL-L}6N<2{CTRL-N}<pog00{CTRL-,}"
5550 R2$="{CTRL-,}p8xp{CTRL-L}>v{CTRL-;}{CTRL-;};|{inv}lFFCC{/inv}{CTRL-,}"
5555 BL$="{CTRL-,}{CTRL-,}<{BACK S}{inv}]I{/inv}{INS CHAR}{INS CHAR}{BACK S}<{CTRL-,}{CTRL-,}"
5560 BR$="{CTRL-,}{CTRL-,}<{BACK S}{inv};{CTRL-S}{/inv}{INS CHAR}{INS CHAR}{BACK S}<{CTRL-,}{CTRL-,}"
5565 H$="{CTRL-,}<{BACK S}{inv}{CTRL-;}|{/inv}{INS CHAR}{TAB}?{RIGHT}{CTRL-,}":RETURN
8000 POKE 559,46:GOSUB 40:POSITION 0,0:POKE 711,146:POKE 53248,120
8005 ? #6;"{inv}!!!!{/inv}############{inv}!!!!{/inv}";
8010 ? #6;"#  {inv}!!!!!!!!!!!!!!{/inv}  {inv}!{/inv}";
8015 ? #6;"#                  {CTRL-E}";
8020 ? #6;"##                 {CTRL-E}";
8025 ? #6;"###                {CTRL-E}";
8030 ? #6;"{inv}!!!!!!!!!!!!!!!!!!!!{/inv}";
8035 POKE 53251,80:P3$(36)=H$:P0$(39)=R1$:SOUND 0,121,10,4:SOUND 1,162,10,4
8040 SOUND 2,64,12,3:FOR T=0 TO 50:NEXT T:POKE 559,46:FOR T=0 TO 50:NEXT T
8045 FOR T=128 TO 140 STEP 0.5:POKE 704,T:SOUND 3,T,8,T-128:NEXT T
8050 FOR T=252 TO 255 STEP 0.5:POKE 707,T:SOUND 3,T,6,T-252:NEXT T
8055 FOR T=4 TO 0 STEP -0.3:SOUND 0,182,10,T:SOUND 1,144,10,T:SOUND 2,64,12,T
8060 NEXT T:SOUND 3,0,0,0:TMR=0
8065 POKE 707,248+6*((RND(0)*2)>1):TMR=TMR+1
8070 IF TMR>210 THEN POSITION 0,11:? #6;"{inv}press FIRE to start{/inv}";:GOTO 8100
8075 IF TMR>60 AND TMR<90 THEN POSITION 0,11:? #6;"GUILTY AS CHARGED"
8080 IF TMR>90 AND TMR<120 THEN POSITION 0,11:? #6;"{inv}but i am innocent{/inv}"
8085 IF TMR>120 AND TMR<160 THEN POSITION 0,11:? #6;"     GUILTY      "
8090 IF TMR>160 THEN POSITION 0,11:? #6;"TO THE DOOM CHAMBER"
8092 IF PEEK(644)=0 THEN TMR=210
8095 GOTO 8065
8100 FOR T=140 TO 128 STEP -0.3:POKE 704,T:SOUND 3,T,6,T-128:NEXT T:POKE 704,0
8110 POKE 707,248+6*((RND(0)*2)>1):IF PEEK(644) THEN 8110
8115 SC=0:PWR=9:TMR=0:Y1=39:X2=0:X3=0:LVL=1:P0$(Y1)=L2$
8120 POKE 704,170:POKE 559,0:POKE 53251,0:POKE 53248,0:POSITION 0,0
8125 ? #6;"{inv}!!!!{/inv}##{inv}!!!!!!!!{/inv}##{inv}!!!!{/inv}";
8130 ? #6;"{CTRL-E}  {inv}!!!!{/inv}      {inv}!!!!{/inv}  {inv}!{/inv}";
8135 ? #6;"{CTRL-E}                  #";
8140 ? #6;"{CTRL-E}                  {inv}!{/inv}";
8145 ? #6;"{CTRL-E}                  #";
8150 ? #6;"{inv}!!{/inv}##{inv}!{/inv}#{inv}!!{/inv}###{inv}!!!{/inv}##{inv}!!{/inv}#{inv}!{/inv}":POSITION 0,11:? #6;"0        ":POKE 559,46
8155 COLOR 192:PLOT 9,11:DRAWTO 19,11:FOR T=4 TO 1 STEP -1:COLOR 32
8160 PLOT 0,T:FOR I=15 TO 6 STEP -0.5:SOUND 0,237,10,I:SOUND 1,192,12,I
8165 NEXT I:NEXT T:FOR X1=48 TO 64 STEP 0.5:SOUND 2,X1,10,2:POKE 53248,X1
8170 NEXT X1:FOR T=1 TO 4:COLOR 5:PLOT 0,T:FOR I=6 TO 0 STEP -0.3
8175 SOUND 0,237,10,I:SOUND 1,192,12,I:NEXT I:NEXT T:SOUND 2,0,0,0
8180 POKE 711,32:GOTO 1000
10000 RESTORE 11100:READ DNUM
10010 D=PEEK(560)+256*PEEK(561)
10020 FOR I=1 TO DNUM:READ B:POKE D+B,PEEK(D+B)+128:NEXT I
10030 B=INT(ADR(DLI$)/256):A=ADR(DLI$)-B*256:POKE 512,A:POKE 513,B
10040 POKE 54286,192:POKE 256,Z:RETURN
11000 DIM DLI$(55):DLI$="H{inv}-{/inv}{CTRL-,}{CTRL-A}{inv}n{/inv}{CTRL-,}{CTRL-A}{inv}{CTRL-M}{/inv}{CTRL-J}{inv}TI{/inv}{CTRL-,}{inv}P{/inv}{CTRL-G}{inv}){/inv}){inv}{CTRL-M}{/inv}{CTRL-V}{inv}P{/inv}h@{inv}I{/inv}{CTRL-A}{inv}P{/inv}{CTRL-G}{inv}){/inv}'{inv}{CTRL-M}{/inv}{CTRL-V}{inv}P{/inv}h@{inv}){/inv}{CTRL-,}{inv}{CTRL-M}{/inv}{CTRL-,}{CTRL-A}{inv})>{CTRL-M}{/inv}"
11010 DLI$(41)="{CTRL-V}{inv}P-{/inv}{CTRL-T}{CTRL-,}{inv}{CTRL-M}{/inv}{CTRL-X}{inv}P){/inv} {inv}{CTRL-M}{/inv}{CTRL-Z}{inv}P{/inv}h@":RETURN
11100 DATA 3,10,11,12
20000 POKE 559,0:CHR=38912:I=256*224:POKE 756,152
20005 DIM C$(126)
20006 C$(1,63)="{CTRL-A}{inv}{CTRL-;}{/inv}{INS CHAR}{inv}?{/inv}{INS CHAR}{inv}{CTRL-;}{/inv}{INS CHAR}{inv}_{/inv}{DEL CHAR}{CTRL-B}{inv}{CTRL-A}A{/inv}{TAB}{INS CHAR}{inv}o{/inv}{INS CHAR}{DEL CHAR}{inv}w{/inv}{CTRL-C}{inv}___{/inv}{CTRL-,}{inv}{CTRL-;}{CTRL-;}{CTRL-;}{/inv}{CTRL-,}{CTRL-D}{CTRL-,}{CTRL-,}{CTRL-,}{inv}as{/inv}{INS CHAR}{INS CHAR}{INS CHAR}{CTRL-E}{inv}zrbC{CTRL-F}{CTRL-N}{/inv}{CTRL-TAB}{inv}?{/inv}{CTRL-F}{TAB}?<{LEFT}{CTRL-N}{RIGHT}?{TAB}{CTRL-G}{inv}px{/inv}<<{LEFT}{LEFT}{CTRL-O}{inv}{CTRL-O}{/inv}"
20007 C$(64,126)="{CTRL-H}N{CTRL-N}{LEFT}<<{inv}>{/inv}{INS CHAR}{TAB}{CTRL-I}{inv}{CTRL-G}{/inv}{CTRL-G}{CTRL-O}{CTRL-O}{LEFT}{BACK S}{inv}|x{/inv}{CTRL-J}{CTRL-,}0d{inv}f{/inv}s{inv}c{/inv}w>{CTRL-K}{CTRL-,}{inv}Z{/inv}{TAB}k{inv}C{/inv}ff{inv}C{/inv}{CTRL-L}{CTRL-,}>c{inv}r{/inv}h{inv}{CTRL-.}{/inv}{CTRL-;}6{CTRL-M}{CTRL-,}{inv}x{/inv}n{inv}C{/inv}g3{CTRL-;}{inv}^{/inv} {CTRL-,} 08<80 "
20010 MOV=ADR("hh{inv}{CTRL-E}q{/inv}h{inv}{CTRL-E}p{/inv}h{inv}{CTRL-E}U{/inv}h{inv}{CTRL-E}T{/inv}h{inv}{CTRL-E}o{/inv}h{inv}{CTRL-E}n {/inv}{CTRL-,}{inv}1p{CTRL-Q}TfTP{/inv}{CTRL-B}{inv}fUfpP{/inv}{CTRL-B}{inv}fqFnPjFo{/inv}{CTRL-P}{inv}f{/inv}{CTRL-.}")
20015 I=USR(MOV,57344,38912,1024)
20020 FOR X=1 TO LEN(C$) STEP 9
20030 OFFSET=ASC(C$(X,X))
20035 Z=USR(MOV,ADR(C$(X+1)),CHR+OFFSET*8,8):NEXT X
20040 Z=7:RETURN

Download

The original program from the Antic disk, to LOAD or ENTER instead of typing it: DOOMED.BAS.

Credits