A.N.A.L.O.G. ISSUE 11 / MAY 1983 / PAGE 90
Adventure is an entertainment ideally suited to the home computer. No arcade game can offer the logical challenge and intellectual involvement of a good adventure program.
Unfortunately, most of the adventures available for the ATARI require more than 16K of memory to run. This prevents many owners of the ATARI 400 System from enjoying the excitement of adventure. And very few text adventures take advantage of the ATARI’s unique hardware capabilities to produce a clear, easy-to-read display.
A.N.A.L.O.G.’s Adventure in the 5th Dimension addresses both of these problems. It’s a beginner’s-level text adventure with all the features you’d expect in a commercial product — a large vocabulary, blinking cursor, independent scrolling window and the ability to save and load games.
Don’t be fooled by the fact that The 5th Dimension is written in ATARI BASIC. The program uses machine-language subroutines to give you speed performance that rivals even the most expensive commercial adventures. Best of all, the whole thing will fit (just barely) in a 16K cassette-based system!
Few of our national treasures are more secure than the original Declaration of Independence. It’s kept at the Library of Congress in a closely guarded display case, sealed in an atmosphere of inert gas to preserve its integrity. The entire display can be retracted deep into the earth at the touch of a button. Stored in this underground vault, the Declaration is capable of surviving the most vicious enemy assault, including a thermonuclear attack.
One afternoon, as a gaggle of tourists stood admiring the priceless document, a shining door of light appeared over the display case. The crowd watched in helpless amazement as alien beings reached their 5-dimensional fingers through the bulletproof glass, snatched the Declaration and vanished without a trace!
You are a top-notch private investigator, hired by the government to retrieve the Declaration. You must search the city of Washington for clues, find a way into the alien universe, locate the Declaration and return it to the police station.
In your search, you will encounter weird technologies and multi-dimensional terrors never before seen. It takes skill and insight to outwit the aliens — and plenty of patience to navigate the streets of Washington!
You will notice that our source listing for The 5th Dimension is un-encoded; that is, the code has not been scrambled to prevent you from seeing possible clues. We decided not to scramble our listing because encoded programs are very hard to type, and they make it nearly impossible to learn how the program works.
It is VERY IMPORTANT that you type each line of the program EXACTLY as you see it printed. Include all of the spaces and control characters; yes, even the REM statements! Save every few lines of new code in case your cat pulls out the power cord. Be especially careful with the DATA statements at the end of the program. And don’t try to RUN anything until you have used D:CHECK or C:CHECK to guarantee the accuracy of your work.
After your copy of The 5th Dimension has passed the CHECK routine without errors, SAVE a perfect copy into a disk or tape. Now you can type RUN. The title screen will appear along with the message “Initializing.” After about five seconds, you’ll see the following prompt:
Press the START key. Your screen should now look like this:
Your Location: Street Corner. You can go: N S W You see: Morning paperOkay. >>>>> What next?
The screen is divided into five imaginary text areas or “windows.” The black response window at the bottom accepts commands from the user, and displays descriptions of objects and the results of your actions. A blinking cursor in the response window indicates that the program is waiting for new commands.
The location window at the top of the screen gives you a brief description of your immediate surroundings. Underneath it is the compass window, which indicates all of the possible exits from that location.
The objects window shows a list of all objects visible at the current location. The bottom of the blue screen area is the inventory window, which lists whatever items you may be carrying.
Like most text adventures. The 5th Dimension understands two-word sentences in the form VERB-(space)-NOUN. Try typing the sentence TAKE PAPER on the starting screen. The “Morning paper” will vanish from the objects window and reappear in your inventory window.
You can interact with objects on the screen just like you can in real life. Watch the response window as you type the sentences EXAMINE PAPER and READ PAPER. When you’re done, the sentence DROP PAPER will return it to the object window. Part of the fun of adventuring is finding out which verbs and nouns the program will understand. If you type an illegal or misspelled word, you’ll see the message “I don’t understand — try again” in the response window.
The 5th Dimension also understands a limited number of single-character commands. These are used to control your movement, and to perform other special functions.
The movement commands let you go in any of the directions indicated in the compass window. The “I” command updates the inventory window so you can see what you’re carrying. The inventory window is also updated whenever you TAKE, DROP or THROW anything.
The “H” command will give you a brief hint appropriate for that location. “Q” is used to exit the program, and to save games.
The 5th Dimension allows you to save your current game status on disk or tape. To use this feature, make sure your storage device is properly connected and loaded with a blank tape or formatted disk. Type the command Q (Quit) and answer Y to the “Save Game?” prompt. Then indicate whether you are saving to disk or tape.
Don’t be frightened when the screen goes black. The program turns off ANTIC during the game saving and loading functions to prevent the display from going crazy. When the save is complete, the screen will return in all its glory and you can continue the game. I/O errors will cause the console to squawk with irritation, and the “Disk or Tape?” prompt will reappear.
To load a previously saved game, type Q/RETURN and then RETURN again to exit. RUN the program again and press the OPTION key after the initialization is complete. When the screen appears, the game will be restored to exactly the way it was when you last saved it.
Don’t try aborting the game with the BREAK key. The program disables it to prevent you from crashing the machine-language routine that blinks the cursor. Hit SYSTEM RESET and you will return safely to BASIC without erasing the program.
The easiest way to map an adventure maze is use the “Hansel and Gretel” technique. Drop an item to mark your place and move one step in each direction, noting where it brings you. Then retrieve the item, drop it somewhere else and repeat the procedure.
The method works even better if you have more than one item to drop. Be careful - some directions loop around in circles, while others bring you back to the location you just left! With careful and methodical mapping, you should be able to figure out the entire street niaze in less than 15 minutes.
10 CLR :GOTO 210 11 GRAPHICS C0:ST$=M$(401,405):Z=ASC(ST$(C5,C5)):OPEN #C2,C8,C0,"S:":GOSUB 1 5:POKE 703,C4 12 POSITION C0,19:? #C2;"_____________ ___________________________"; 13 Q=USR(ADR(DLI$),ADR(DLI$)+32):POKE 54286,192:POKE C16,112:POKE 53774,112: GOTO 66 14 POKE C710,C0:POKE C709,C14:RETURN 15 POKE C709,C14:POKE C710,148:RETURN :REM 16 FOR I=C0 TO C12 STEP C4:X1=USR(ADR( F$),I):NEXT I 17 X1=USR(ADR(F$),C15):RETURN 18 SOUND C0,25,C10,C15:FOR I=C1 TO C4: NEXT I:SOUND C0,C0,C0,C0:RETURN 19 ? "I don't understand. Try again." :GOTO 53 20 ? "That is impossible.":RETURN 21 ? "There isn't enough room here.":R ETURN 22 ? OK$:? "You hear a powerful blast. ":RETURN 23 ? "It isn't here.":RETURN 24 X=USR(LOOK,CL8,N,C8):RETURN 25 Y=USR(LOOK,ST,N,C4):RETURN 26 GOSUB 25:IF Y THEN RETURN 27 POP :POP :? DH$:GOTO 53 28 Q=C16*(ASC(ST$(C5,C5))−65)+C1:RETUR N :REM 29 POP :FLAG=C1:GOTO 72 30 ? #C2;"Street corner.":RETURN 31 ? #C2;"Lost in a maze of streets.": RETURN 32 ? #C2;"West of police station.":RET URN 33 ? #C2;"South of a store.":RETURN 34 ? #C2;"Lobby of police station.":? #C2;"Sergeant eyes you suspiciously.": RETURN 35 ? #C2;"Bathroom.":GOSUB 15:RETURN 36 ? #C2;"Inside store. Sign reads:": ? #C2;"GREEN BATTERIES ONLY $1.OO!":RE TURN 37 ? #C2;"Dead-end alley.":RETURN 38 ? #C2;"Fire escape.":RETURN 39 ? #C2;"Roof of building.":RETURN 40 ? #C2;"Bedroom.":RETURN 41 ? #C2;"Kitchen.":RETURN 42 ? #C2;"White void.":POKE C709,C0:PO KE C710,C14:RETURN 43 ? #C2;"Golden void.":POKE C709,C14: POKE C710,24:RETURN 44 ? #C2;"Green void.":POKE C709,C14:P OKE C710,212:RETURN 45 ? #C2;"Infinite void.":GOSUB 14:RET URN 46 ? #C2;"Lost in a crimson void.":POK E C709,C14:POKE C710,64:RETURN 47 ? #C2;"Dense forest.":GOSUB 15:RETU RN 48 ? #C2;"River bank.":RETURN 49 POP :CLOSE #C2:GRAPHICS C0 50 GOSUB 14:POSITION C12,C10:? "Congra tulations!":? "↓ You have saved the Declaration!↓↓↓↓":END 51 POP :GRAPHICS C0:GOSUB 14:POKE 752, C1:? "↓↓↓↓↓ An unearthly anti−matter blast" 52 ? ". OBLITERATES":? ". this entire area!":GOTO 223 53 POP :? ">>>>> What next";:GOSUB 18: TRAP 53:INPUT K$:TRAP 10000:L=LEN(K$): IF L=C0 THEN 19 54 IF L=C1 THEN V$=K$:GOTO 63 55 Q=USR(LOOK,ADR(K$),ADR(" "),L):IF Q <C4 THEN 19 56 V$=K$(C1,Q−C1):IF Q=C4 THEN V$(C4,C 4)="!" 57 N$=K$(Q+C1,L):IF LEN(N$)<C4 THEN 19 58 Z=USR(ADR(D$),ADR(VERB$)−C5,V):IF Z =C0 THEN 19 59 IF Z=76 THEN K$=K$(Q+C1,L) 60 Q=USR(ADR(D$),ADR(NOUN$)−C5,N):IF Q =C0 AND Z<>76 THEN 19 61 N$=CHR$(Q):IF N$="X" THEN ? "Refer to it by color.":GOTO 53 62 Z=Z−64:ON Z GOSUB 93,107,120,129,13 6,144,147,153,159,163,177,183,185,188, 203:GOTO 53 63 Q=USR(LOOK,ADR(C$),V,C9):IF Q=C0 TH EN 19 64 IF Q>C6 THEN Q=Q−C6:ON Q GOTO 77,82 ,88 65 Q=Q+C1:Z=ASC(CL$(Q,Q)):IF Z=63 THEN ? "You can't go that way.":GOTO 53 66 GOSUB 16:GOSUB 28:M$(Q,Q+C15)=CL$:S T$(C5,C5)=CHR$(Z):GOSUB 28:CL$=M$(Q,Q+ C15) 67 ? OK$:POSITION C2,C0:? #C2;"Your lo cation:";:POSITION C2,C1 68 Z=Z−64:ON Z GOSUB 30,31,31,32,31,31 ,31,33,34,35,36,37,38,39,40,41,42,43,4 4,45,46,46,46,47,48 69 REM * SHOW LEGAL EXITS 70 POSITION C2,C4:? #C2;"You can go: " ;:FOR I=C1 TO C6:IF CL$(I+C1,I+C1)<>"? " THEN ? #C2;C$(I,I);" "; 71 NEXT I 72 X1=USR(ADR(F$),C6):X1=USR(ADR(F$),C 10):POSITION C2,C6:? #C2;"You see: ";: X=C6 73 FOR I=C1 TO C8:Q=ASC(CL$(I+C8,I+C8) )−64:IF Q<>−C1 THEN RESTORE 245+Q:READ K$:POSITION 11,X:? #C2;K$:X=X+C1 74 NEXT I:IF X=C6 THEN POSITION 11,X:? #C2;"Nothing interesting" 75 IF FLAG=C1 THEN FLAG=C0:GOTO 78 76 GOTO 53 77 REM * I 78 ? OK$:GOSUB 17:POSITION C2,C15:? #C 2;"You have: "; 79 X=C15:FOR I=C1 TO C4:Q=ASC(ST$(I,I) )−64:IF Q<>−C1 THEN RESTORE 245+Q:READ K$:POSITION C12,X:? #C2;K$:X=X+C1 80 NEXT I:IF X=C15 THEN POSITION 12,X: ? #C2;"Nothing" 81 GOTO 53 82 REM * Q 83 ? "Type Y to save, RETURN to quit↰" ;:INPUT K$:IF K$<>"Y" THEN CLOSE #C2:G RAPHICS C0:END 84 CLOSE #C1:POKE 559,34:? "Position S ave: Disk or Tape↰";:INPUT N$:IF N$<>" D" AND N$<>"T" THEN 53 85 TRAP 84:K$="D1:SAVE.DAT":IF N$="T" THEN K$="C:" 86 POKE 559,C0:POKE 54272,C0:OPEN #C1, C8,C0,K$:M$(401,405)=ST$:GOSUB 28:M$(Q ,Q+C15)=CL$ 87 FOR I=325 TO C1 STEP −81:? #C1;M$(I ,I+80):NEXT I:? #C1;NOUN$:CLOSE #C1:PO KE 559,34:POKE 54286,192:GOTO 53 88 REM * H 89 IF USR(LOOK,ADR("ABCDEGHUVW"),CL,C1 0) THEN ? "A map is essential.":GOTO 5 3 90 IF USR(LOOK,ADR("JNORSY"),CL,C6) TH EN ? "Examine everything.":GOTO 53 91 IF CL$(C1,C1)="T" THEN ? "No earthl y power can help you.":GOTO 53 92 ? "How's your pitching arm lately?" :GOTO 53 93 REM * VERB A 94 Q=Q−64:GOSUB 24:IF X=C0 THEN GOSUB 25:IF Y=C0 THEN 23 95 ON Q GOTO 96,96,96,96,96,97,96,96,9 8,96,98,96,99,100,101,99,102,103,96,96 ,104,96,106 96 ? "Seems ordinary.":RETURN 97 ? "There's a battery inside!":RETUR N 98 ? "Has a battery attachment.":RETUR N 99 ? "Looks dangerous.":RETURN 100 ? "Looks like this: ^^^":RETURN 101 ? "They shimmer eerily.":RETURN 102 ? "Looks thirsty.":RETURN 103 ? "Stock is dated 1775!":RETURN 104 N$="V":GOSUB 24:IF X=C0 THEN GOTO 96 105 ? "It's protected by a powerful":? "force field.":RETURN 106 ? "Looks like a shining door.":RET URN 107 REM * VERB B 108 GOSUB 25:IF Y THEN ? "You already have that.":RETURN 109 Z=USR(LOOK,ST,ADR("?"),C4):IF Z=C0 THEN ? "You can't carry any more.":RE TURN 110 GOSUB 24:IF X=C0 THEN 23 111 IF USR(LOOK,ADR("NPQSTVW"),N,7) TH EN 20 112 IF N$="U" AND USR(LOOK,CL8,ADR("V" ),C8) THEN ? "Force field won't let yo u.":RETURN 113 IF N$="K" AND USR(LOOK,CL8,ADR("P" ),C8) THEN ? "Beast would rather you d idn't.":RETURN 114 IF N$="R" AND USR(LOOK,CL8,ADR("Q" ),C8) THEN ? "Soldier won't cooperate. ":RETURN 115 IF N$="D" AND CL$(C1,C1)="K" THEN ? "Cashier says, '$1.OO, please.'":RET URN 116 IF N$="M" THEN 118 117 CL$(X+C8,X+C8)="?":ST$(Z,Z)=N$:GOT O 29 118 IF USR(LOOK,ST,ADR("O"),C4) THEN 1 17 119 GOTO 51 120 REM * VERB C 121 GOSUB 26:X=USR(LOOK,CL8,ADR("?"),C 8):IF X=C0 THEN 21 122 IF N$="L" AND CL$(C1,C1)="Y" THEN CL$(C9,C9)="?":N$="?":? "Soldier walks away with it." 123 IF USR(LOOK,ADR("NPQSTVW"),N,7) TH EN 20 124 IF N$="M" AND CL$(C1,C1)="T" THEN ? "It's up against the force field." 125 IF N$="U" AND CL$(C1,C1)="I" THEN 49 126 IF N$="D" AND CL$(C1,C1)="K" THEN ? "Cashier returns it to shelf." 127 IF USR(LOOK,CL8,ADR("M"),C8) THEN 51 128 ST$(Y,Y)="?":CL$(X+C8,X+C8)=N$:GOT O 29 129 REM * VERB D 130 GOSUB 25:IF Y=C0 THEN ? DH$:RETURN :REM 131 IF USR(LOOK,ADR("NPQV"),N,C4) THEN POP :GOTO 19 132 IF N$="I" OR N$="K" THEN ? "Needs a power source.":RETURN 133 IF N$="H" OR N$="J" THEN ? "It's a lready activated.":RETURN 134 IF N$="S" OR N$="T" THEN ? "Indica te a direction.":RETURN 135 ? "Be more specific.":RETURN 136 REM * VERB E 137 GOSUB 24:IF N$="S" AND X THEN 146 138 IF N$="T" THEN ? "It's already ope n.":RETURN 139 GOSUB 26:IF N$="A" OR N$="U" THEN ? OK$:RETURN 140 IF N$="F" AND Y THEN 142 141 GOTO 20 142 N$="?":GOSUB 24:IF X=C0 THEN 21 143 ST$(Y,Y)="G":NOUN$(30,30)="G":CL$( X+C8,X+C8)="E":GOSUB 97:? "It fell out on the floor.":GOTO 29 144 REM * VERB F 145 IF N$<>"S" THEN 20 146 ? "Lock is very secure.":RETURN 147 GOSUB 24:IF X=C0 THEN 23 148 Y=USR(LOOK,ST,ADR("C"),C4):IF N$=" S" AND Y THEN 151 149 IF N$="S" AND Y=C0 THEN ? "You hav e nothing to break it with.":RETURN 150 GOTO 20 151 CL$(C5,C5)="O":CL$(X+C8,X+C8)="T": M$(234,234)="C":ST$(Y,Y)="?":? "The st one broke the window!" 152 NOUN$(80,80)="T":POP :GOTO 70 153 REM * VERB H 154 GOSUB 25:IF Y THEN ? "You already have that.":RETURN 155 GOSUB 24:IF X=C0 THEN ? DH$:RETURN :REM 156 Y=USR(LOOK,ST,ADR("B"),C4):IF Y=C0 THEN ? "You don't have any money.":RE TURN 157 IF N$<>"D" THEN 20 158 ST$(Y,Y)="D":CL$(X+C8,X+C8)="?":? "Cashier takes your $1 bill.":GOTO 29 159 REM * VERB I 160 GOSUB 24:GOSUB 25:IF X=C0 AND Y=C0 THEN 23 161 IF N$="M" AND USR(LOOK,ST,ADR("O") ,C4)=C0 THEN 51 162 GOTO 96 163 REM * VERB J 164 GOSUB 26:IF USR(LOOK,ADR("MNPQSTVW "),N,C8) THEN 20 165 X=USR(LOOK,CL8,ADR("?"),C8):IF X=C 0 THEN 21 166 IF N$="C" THEN 168 167 ST$(Y,Y)="?":CL$(X+C8,X+C8)=N$:? " Didn't go far.":GOTO 29 168 ? "Indicate a direction (N/S/E/W)" ;:GOSUB 18:INPUT K$:IF LEN(K$)<>C1 THE N POP :GOTO 19 169 Q=USR(LOOK,ADR(C$),ADR(K$),C4):IF Q=C0 THEN POP :GOTO 19 170 IF CL$(Q+C1,Q+C1)="?" THEN 176 171 IF CL$(Q+C1,Q+C1)=CL$(C1,C1) THEN 167 172 Z=C16*(ASC(CL$(Q+C1,Q+C1))−65)+C9: I=USR(LOOK,ADR(M$(Z)),ADR("?"),C8):X=U SR(LOOK,ADR(M$(Z)),ADR("M"),C8) 173 IF X AND CL$(C1,C1)="Q" AND Q=C4 T HEN M$(313,320)="???????U":ST$(Y,Y)="? ":GOTO 22 174 IF X THEN M$(Z,Z+7)="????????":ST$ (Y,Y)="?":GOTO 22 175 IF I THEN M$(Z+I−C1,Z+I−C1)="C":ST $(Y,Y)="?":? "Gone!":GOTO 29 176 ? "You can't throw it that way.":R ETURN 177 REM * VERB K 178 GOSUB 24:IF X=C0 THEN 23 179 IF N$="P" OR N$="Q" THEN 181 180 GOTO 20 181 IF USR(LOOK,ST,ADR("R"),C4)=C0 THE N ? "Not without a weapon.":RETURN 182 ? "Bayonet scared it away!":CL$(X+ C8,X+C8)="?":GOTO 29 183 REM * VERB L 184 ? K$:RETURN 185 REM * VERB M 186 GOSUB 26:IF N$<>"O" THEN 20 187 ? "You're already wearing them.":R ETURN 188 REM * VERB N 189 GOSUB 26:X=USR(LOOK,ST,ADR("I"),C4 ):Z=USR(LOOK,ST,ADR("K"),C4) 190 IF X=C0 AND Z=C0 THEN ? "You have nothing to attach it to.":RETURN 191 IF N$="D" THEN 194 192 IF N$="E" THEN 196 193 GOTO 20 194 IF Z THEN ? "Cube absorbs the batt ery and hums.":GOTO 199 195 IF X THEN ? "Green battery doesn't fit.":RETURN 196 IF X THEN ? "Spheroid absorbs the battery and":? "displays a symbol: ^^^ ":GOTO 198 197 IF Z THEN ? "Blue battery doesn't fit.":RETURN 198 ST$(X,X)="H":M$(150,150)="Q":M$(15 3,153)="W":NOUN$(35,35)="H":GOTO 201 199 ST$(Z,Z)="J":M$(263,263)="J":M$(26 2,262)="?":NOUN$(40,40)="J" 200 IF CL$(C1,C1)="Q" THEN CL$(C6,C6)= "?":CL$(7,7)="J" 201 IF CL$(C1,C1)="J" THEN CL$(C9,C9)= "W":CL$(C6,C6)="Q" 202 ST$(Y,Y)="?":FLAG=C1:POP :GOTO 70: REM 203 REM * VERB O 204 GOSUB 24:GOSUB 25:IF Y=C0 AND N$<> "N" THEN ? DH$:RETURN 205 IF N$="N" AND X THEN 100 206 IF N$="A" AND Y THEN ? "HEADLINE: Declaration Stolen!":? "Police Anxious ly Await Recovery!":RETURN 207 IF N$="U" AND Y THEN ? "'We the pe ople ... '":RETURN 208 IF N$="W" AND Y THEN 106 209 GOTO 20 210 READ FLAG,C0,C1,C2,C4,C5,C6,C7,C8, C9,C10,C12,C14,C15,C16,C709,C710 211 GOSUB 14:POKE 752,C1:? "↰↓↓↓↓↓ Brian Moriarty's":? "↓ ADVENTU RE in the 5TH DIMENSION " 212 ? "↓ (C)1983 ANALOG Computing ":POSITION C12,C16:? " INITIALIZING ":REM 213 DIM M$(406),CL$(16),K$(24),N$(4),V $(4),LOOK$(43),VERB$(100),NOUN$(100),C $(9),ST$(5),DLI$(64),F$(42),D$(76) 214 DIM OK$(5),DH$(20):OK$="Okay.":DH$ ="You don't have that." 215 NOUN$="PAPEABILLBSTONCGREEDBLUEERA DIFSPHEICUBEKTEABLMASSMSYMBNGLOVOBEASP SOLDQBAYORWINDSDECLUFIELVDUCTWBATTX" 216 VERB$="EXAMALOOKATAKEBGET!BDROPCLE AVCGIVECUSE!DOPENEUNLOFBREAGSMASGBUY!H TOUCITHROJKILLKSAY!LWEARMATTANREADO" 217 C$="NSEWUDIQH":LOOK=ADR(LOOK$):CL= ADR(CL$):CL8=CL+C8:V=ADR(V$):N=ADR(N$) :ST=ADR(ST$) 218 M$(C1)="?":M$(406)="?":M$(C2)=M$:F OR I=C1 TO 385 STEP C16:READ CL$:M$(I, I+LEN(CL$))=CL$:NEXT I 219 M$(401,405)="????A":CL$=M$(C1,C16) :FOR I=C1 TO 76:READ Q:D$(I)=CHR$(Q):N EXT I 220 FOR I=C1 TO 43:READ Q:LOOK$(I)=CHR $(Q):NEXT I 221 FOR I=C1 TO 64:READ Q:DLI$(I)=CHR$ (Q):NEXT I 222 FOR I=C1 TO 42:READ Q:F$(I)=CHR$(Q ):NEXT I 223 POSITION C4,C16:? "Press START t o begin new game.":? ". Press OPTION to restore old game.↰" 224 IF PEEK(53279)=C6 THEN 11 225 IF PEEK(53279)=3 THEN 227 226 GOTO 224 227 CLOSE #C1:POKE 559,34:POSITION C8, 20:? "Load from Disk or Tape↰";:INPUT N$:IF N$<>"D" AND N$<>"T" THEN 227 228 POKE 559,C0:POKE 54272,C0:TRAP 227 :K$="D1:SAVE.DAT":IF N$="T" THEN K$="C :" 229 OPEN #C1,C4,C0,K$:TRAP 10000 230 FOR I=325 TO C1 STEP −81:INPUT #C1 ,M$:M$(I,I+80)=M$:NEXT I:M$(406,406)=" ":INPUT #C1,NOUN$:CLOSE #C1 231 ST$=M$(401,405):GOSUB 28:CL$=M$(Q, Q+C15):POKE 559,34:GOTO 11 232 DATA 0,0,1,2,4,5,6,7,8,9,10,12,14, 15,16,709,710 233 DATA AEB?G???A,BABCG,CDCEB,DFCID,E EAFC,FFDGE???C,GHBAF,HKG?L,I?J?D 234 DATA JI??????NB,K?H?????D,L??H?M,M ????NL?S,N?????M?I,O??MP???F,P??O????L ,QURSTX??W,RQU?????M 235 DATA S???Q???PK,T??Q????VU,URQVW,V WVWU???O,WWVUV,X??Y??Q?W,Y???X???QR 236 DATA 104,104,133,206,104,133,205,1 04,133,204,104,133,203,169,0,133,213,1 62,21,202,240,49,24,165,205 237 DATA 105,5,133,205,165,206,105,0,1 33,206,24,160,0,177,203,209,205,208,23 1,200,177,203,209,205,208 238 DATA 224,200,177,203,209,205,208,2 17,200,177,203,209,205,208,210,200,177 ,205,133,212,96,169,0,133,212,96 239 DATA 104,104,133,206,104,133,205,1 04,133,204,104,133,203,169,0,168,133,2 13,177,203,133,207,104,104,168 240 DATA 136,48,10,165,207,209,205,208 ,247,200,132,212,96,169,0,133,212,96 241 DATA 104,104,141,1,2,104,141,0,2,1 73,48,2,133,203,173,49,2,133,204,160,2 4,169,130,145,203 242 DATA 169,0,141,243,2,96,0,72,138,7 2,169,0,162,10,141,10,212,141,24,208,1 42,23,208,230,208 243 DATA 165,208,41,16,74,74,74,141,1, 212,104,170,104,64 244 DATA 104,104,104,170,165,88,133,20 3,165,89,133,204,216,24,202,48,15,165, 203,105,40,133,203,165,204 245 DATA 105,0,133,204,24,144,238,160, 159,169,0,145,203,136,208,251,96 246 DATA Morning paper 247 DATA $1 bill 248 DATA Stone 249 DATA Green battery 250 DATA Blue battery 251 DATA Broken portable radio 252 DATA Empty radio 253 DATA Spheroid with ^^^ symbol 254 DATA Alien spheroid 255 DATA Humming alien cube 256 DATA Alien cube 257 DATA Teabag 258 DATA Strange shimmering mass 259 DATA Alien symbol on wall 260 DATA Strange gloves 261 DATA 5-dimensional beast 262 DATA British soldier 263 DATA Bayonet 264 DATA Locked window 265 DATA Broken west window 266 DATA The Declaration 267 DATA Powerful force field 268 DATA Transdimensional duct
0100 ; NOUN/VERB DECODER 0105 ; 0110 ; Syntax: N=USR(ML,TL-5,NL) 0115 ; ML=addr of this routine 0120 ; TL=addr of lookup table 0125 ; NL=addr of current noun/verb 0130 ; 0135 ; Program equates 0140 ; 0145 NOUN=$CB ; noun addr pointer 0150 TABLE=$CD ; table addr pointer 0155 NRET=$D4 ; BASIC return addr 0160 ; 0165 PLA ; # arguments 0170 PLA ; msb of table addr 0175 STA TABLE+1 0180 PLA ; lsb 0185 STA TABLE 0190 PLA ; msb of noun addr 0195 STA NOUN+1 0200 PLA ; lsb 0205 STA NOUN 0210 LDA #$00 0215 STA NRET+1 ; zero msb 0220 LDX #$15 ; noun/verb count 0225 NEXT DEX 0230 BEQ NOPE ; illegal entry 0235 CLC 0240 LDA TABLE ; +5 to pointer 0245 ADC #$05 0250 STA TABLE 0255 LDA TABLE+1 0260 ADC #$00 0265 STA TABLE+1 0270 CLC 0275 LDY #$00 ; init index 0280 LDA (NOUN),Y ; get 1st char 0285 CMP (TABLE),Y ; equal? 0290 BNE NEXT ; no; next noun 0295 INY ; in-line for speed 0300 LDA (NOUN),Y ; try 2nd char 0305 CMP (TABLE),Y 0310 BNE NEXT 0315 INY 0320 LDA (NOUN),Y ; try 3rd char 0325 CMP (TABLE),Y 0330 BNE NEXT 0335 INY 0340 LDA (NOUN),Y ; last char! 0345 CMP (TABLE),Y 0350 BNE NEXT 0355 INY ; must be legal 0360 LDA (TABLE),Y ; get iden # 0365 STA NRET ; give to BASIC 0370 RTS ; and return 0375 NOPE LDA #$00 ; 0=illegal entry 0380 STA NRET ; give to BASIC 0385 RTS ; and return
0100 ; CHARCTER SEARCH ROUTINE 0105 ; 0110 ; Syntax: X=USR(ML,SVT,V,R) 0115 ; ML=addr of this routine 0120 ; SVT=addr of $ to be searched 0125 ; V=addr of search character 0130 ; R=# bytes to search 0135 ; 0140 ; Program equates 0145 ; 0150 CADR=$CB ; char addr pointer 0155 TABLE=$CD ; verb table pointer 0160 CHAR=$CF ; character buffer 0165 BRET=$D4 ; BASIC return addr 0170 ; 0175 PLA ; # arguments 0180 PLA ; msb of table addr 0185 STA TABLE+1 0190 PLA ; lsb 0195 STA TABLE 0200 PLA ; msb of verb addr 0205 STA CADR+1 0210 PLA ; lsb 0215 STA CADR 0220 LDA #$00 0225 TAY 0230 STA BRET+1 ; zero msb 0235 LDA (CADR),Y ; get the char 0240 STA CHAR ; save for later 0245 PLA ; msb of range (ignore) 0250 PLA ; lsb 0255 TAY ; use as the index 0260 NEXT DEY 0265 BMI NOPE ; must be illegal 0270 LDA CHAR ; get char 0275 CMP (TABLE),Y ; match? 0280 BNE NEXT ; no; try another 0285 INY ; yes; give position 0290 STY BRET ; to BASIC 0295 RTS ; and return 0300 NOPE LDA #$00 ; 0=char not found 0305 STA BRET ; give to BASIC 0310 RTS ; and return
0100 ; DLI/BLINK ROUTINE 0105 ; 0110 ; Syntax: USR(DLI,DLI+X) 0115 ; DLI=addr of this routine 0120 ; X=offset to DLI handler 0125 ; 0130 ; Program equates 0135 ; 0140 COLPF1=$D017 0145 COLPF2=$D018 0150 WSYNC=$D40A 0155 SDLSTL=$0230 0160 VDSLST=$0200 0165 CHACTL=$D401 0170 CHACT=$02F3 0175 BUFFER=$CB 0180 BLINCT=$D0 0185 ; 0190 ; First set up the DLI 0195 ; 0200 PLA ; # arguments 0205 PLA ; msb of DLI addr 0210 STA VDSLST+1 0215 PLA ; lsb 0220 STA VDSLST 0225 LDA SDLSTL ; find start of 0230 STA BUFFER ; display list 0235 LDA SDLSTL+1 0240 STA BUFFER+1 0245 LDY #$18 ; mode line 20 0250 LDA #$82 ; DL instruction 0255 STA (BUFFER),Y 0260 LDA #$00 ; turn off 0265 STA CHACT ; inverse video 0270 RTS 0275 BRK ; mark end of init 0280 ; 0285 ; This is the actual DLI handler 0290 ; 0295 PHA ; save accumulator 0300 TXA 0305 PHA ; save X 0310 LDA #$00 ; black bkgrnd 0315 LDX #$0A ; white chars 0320 STA WSYNC 0325 STA COLPF2 0330 STX COLPF1 0335 INC BLINCT ; Blink cursor 0340 LDA BLINCT 0345 AND #$10 0350 LSR A 0355 LSR A 0360 LSR A 0365 STA CHACTL 0370 PLA ; restore A and X 0375 TAX 0380 PLA 0385 RTI ; back to BASIC
0100 ; SCREEN ERASE SUBROUTINE 0105 ; CLEARS IN 4-LINE BLOCKS 0110 ; 0115 ; Syntax: X=USR(ML,ST) 0120 ; ML=addr of this routine 0125 ; ST=starting line number 0130 ; 0135 ; PROGRAM EQUATES 0140 ; 0145 BUFFER=$CB ; scr address buffer 0150 SAVMSC=$58 ; screentop pointer 0155 ; 0160 PLA ; # arguments 0165 PLA ; msb of line#; ignore 0170 PLA ; lsb 0175 TAX ; save in x-register 0180 LDA SAVMSC ; get screen 0185 STA BUFFER ; address 0190 LDA SAVMSC+1 0195 STA BUFFER+1 0200 CLD ; clear decimal mode 0205 CLC 0210 ADD40 DEX ; find window addr 0215 BMI CLEAR 0220 LDA BUFFER ; add 40 0225 ADC #$28 0230 STA BUFFER 0235 LDA BUFFER+1 0240 ADC #$00 0245 STA BUFFER+1 0250 CLC 0255 BCC ADD40 0260 CLEAR LDY #$9F ; clear 4 lines 0265 LDA #$00 ; space char 0270 SPACE STA (BUFFER),Y 0275 DEY 0280 BNE SPACE 0285 RTS
A.N.A.L.O.G. ISSUE 12 / JULY 1983 / PAGE 102
If you own an ATARI 1200XL and typed in Adventure in the 5th Dimension from our last issue, you were in for a rude shock. The 1200XL operating system contains an insidious little bug which crashes the adventure every time you try to RUN it.
Unlike the ATARI 400 and 800 systems, the 1200XL is very picky about PRINTing to an OPENed screen device, especially when you’re in a “forced” split-screen mode. The entire screen goes wacky if your PRINT statement makes the cursor enter the bottom text window. Try it yourself!
10 GRAPHICS 0 11 REM * Open the screen device (S:) 12 OPEN #2,8,0,"S:" 13 REM * Invoke forced split-screen 14 POKE 703,4 15 REM * Cursor to bottom of window 16 POSITION 39,19 17 REM * Print to the window 18 PRINT #2;"COMPATIBILITY"
Fortunately, the adventure program violates this undocumented restriction only once, in line 12. Since the purpose of line 12 is purely cosmetic (it puts a fancy white border across the top of the response window), the simplest way to deal with it is to eliminate it altogether.
We apologize for not discovering this problem before The 5th Dimension went to press. Please let us know about any other compatibility problems you may discover in the 1200XL systems.