Dale’s Atari 800 Games › Stan Ockers

Tiger

By Stan Ockers, in the ACE newsletter of October 1982.

Play Tiger

Stan’s write-up

“Tiger” is a simulation which requires little more than luck to win (a small amount of thinking helps). It does however offer some useful programming items.

A machine language routine in SK$ (lines 100-120) replaces quite a few lines of Basic code and should prove of value anytime you need a cursor to run over a character mode screen. “Listing 2” gives the code which updates two zero page locations (208 & 209) according to the position of joystick (0). The advantage mainly in smoothness and speed over the equivalent Basic code. Calling is by: A=USR(ADR(SK$)) as shown in lines 300-320. Limits of X and Y movement are built in (VHILIM, VLOLIM, HHILIM & HLOLIM).

Certain screen locations are allowable next “rooms” in the parlance of adventure programs. I use strings to hold coordinates of these rooms rather than arrays because the strings use a lot less memory! If the program didn’t have to be printed, a lot more room could have been saved by initializing the strings by defining them (A$= STRING ). Control and graphic characters cause most printers fits, however, so I’ve initialized the strings from data statements (also slow!).

Graphics 1 is used, (GR. 17 actually for full screen), again for memory conservation. If you have images which are repeated a lot you can cover a lot of screen using little memory by redefining the character set. This is done in lines 1000-1120. Again, if the program were not for publication, I could have put the new data in a string and mapped it into the new character set area.

There are 5 colors available in GR. 1; for example a lower case character will be printed the same as the upper case one but in a different color. There are 64 characters available, the first 64 in the character set in our case. Table 9.6 (page 55) in the Basic Reference Manual gives the characters in their character set order. Columns 1 and 2 give our basic set, some have been changed of course. Columns 3 and 4 give the corresponding characters in another color. Imagine another table using the inverse characters of those in table 9.6. This provides two more colors of the four color character set. Background provides a fifth color.

The associated color registers are:

COLOR  POKE  TABLE
  0    708   Columns 1 & 2
  1    709   Columns 3 & 4
  2    710   Inv. of col. 1 & 2
  3    711   Inv. of col. 3 & 4
  4    712   Background

I find the character set modes very useful for making large drawings fast. One annoyance is not being able to have many colors in one character. Atari has provided a way around this in mode 4 (not available from Basic). In mode 4 you can have three different colors and background in your characters at once. The characters are the size of GR. 0 characters and the pixels are the height of GR. 8 pixels and the width of GR. 7 pixels. That’s quite a bit of resolution with relatively small memory requirements. It will have to wait for another time though.

—Stan Ockers

The start of Stan Ockers' Tiger article in the October 1982 ACE newsletter
As printed: page 9 of the October 1982 issue.

The program

The listing, “TIGER by Stan Ockers”, is on pages 8, 5 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 (Tiger.zip), proofread against the October 1982 scan (the listing starts on page 8 and its last lines, 2020-2030, are on page 5). The program text matched, and the typist had decoded the invisible control characters in the screen drawing (lines 2010-2029) correctly. But the copy left out almost all of Stan's comments: the header, about twenty REM lines and the notes on lines 310, 320 and 2012-2025 explaining which characters are which. They are restored from the scan.

Show the listing
1 REM *****************
2 REM * ACE NEWSLETTER*
3 REM *3662 VINE MAPLE*
4 REM *  EUGENE, OR   *
5 REM *     $10 YR    *
6 REM * BULLETIN BOARD*
7 REM * (503)343-4352 *
8 REM * OCT 82 ISSUE  *
9 REM *****************
10 REM ***************
20 REM **    TIGER  **
30 REM **STAN OCKERS**
35 REM **   9/82    **
40 REM ***************
50 REM
90 GOSUB 1000:RESTORE 110
99 REM ** CURSOR MOVEMENT ROUTINE **
100 DIM SK$(51):FOR I=1 TO 51:READ A:SK$(I,I)=CHR$(A):NEXT I:SK=ADR(SK$)
110 DATA 104,173,120,2,133,207,165,208,70,207,176,6,201,0,240,2,198,208,70,207,176,6,201,19,176,2
120 DATA 230,208,165,209,70,207,176,6,201,0,240,2,198,209,70,207,176,6,201,19,176,2,230,209,96
129 REM ** X AND Y COORDINATES FOR 22 'ROOMS' **
130 DIM RC(21,1):FOR I=0 TO 21:READ A,B:RC(I,0)=A:RC(I,1)=B:NEXT I
140 DATA 17,12,11,15,13,13,14,17,17,15,15,12,15,9,17,7,14,2,12,5,12,9,9,9,8,15,2,11,5,12
150 DATA 6,9,9,5,6,2,5,4,3,2,2,5,2,8
159 REM ** AVAILABLE 'NEXT ROOMS' **
160 DIM NR(21,2):FOR I=0 TO 21:READ A,B,C:NR(I,0)=A:NR(I,1)=B:NR(I,2)=C:NEXT I
170 DATA 4,7,0,2,3,12,1,5,2,1,4,3,0,3,5,2,4,6,5,7,10,0,6,8,7,9,8,8,10,16,6,9,10,12,15,11,1,11,12
180 DATA 14,21,13,13,15,14,11,14,16,9,15,17,16,18,17,17,19,18,18,20,19,19,21,20,13,20,21
181 REM ** STRINGS FOR PITCH AND LOUDNESS OF ROAR **
182 DIM P$(20),L$(20):RESTORE 185:FOR I=1 TO 20:READ A:P$(I,I)=CHR$(A):NEXT I
184 RESTORE 186:FOR I=1 TO 20:READ A:L$(I,I)=CHR$(A):NEXT I
185 DATA 250,243,234,225,225,215,214,210,205,210,214,215,225,228,234,237,243,246,247,250
186 DATA 5,6,8,10,12,15,15,15,15,14,13,12,11,10,9,8,7,6,5,4
192 REM ** C$ HOLDS THE CHARACTERS PRINTED OVER BY 'ROAR' **
194 REM ** X AND Y ARRAYS HOLD COORD. OF AVAILABLE NEXT 'ROOMS' **
196 DIM C$(4),R$(4),X(2),Y(2):R$="roar":OPEN #1,4,0,"K:"
197 REM ** SET 'ROOM' TO ZERO . ZRM IS PRESENT ROOM CHAR. (DIFFERENT COLORS) **
198 RM=0:POKE 208,12:POKE 209,17:DOCFLG=0:ZRM=61
200 GRAPHICS 17:POKE 752,1:POKE 756,START/256:POKE 708,37:POKE 709,152:POKE 710,244:POKE 712,42
210 GOSUB 2010:POSITION 3,21:? #6;"INSTRUCTIONS?":GET #1,K:IF K<>89 THEN 275
220 POSITION 3,20:? #6;"YOU ARE GOING    DOWN THE CONGO RIVERWHEN A CREWMATE GETS VERY ILL press key":GOSUB 1220
224 GOSUB 1200:POSITION 2,20:? #6;"THERE IS A DOCTOR IN A VILLAGE [left]  QUITE FAR FROM THE    DOCK [right]"
226 GOSUB 1220:GOSUB 1200:POSITION 3,20:? #6;"YOU MUST GET THE DOCTOR AND BRING HIM BACK TO THE BOAT":GOSUB 1220
228 GOSUB 1200:POSITION 3,20:? #6;"THE PROBLEM IS A MAN EATING TIGER":GOSUB 1220
230 GOSUB 1200:POSITION 2,20:? #6;"YOU ONLY KNOW HIS   GENERAL LOCATION    FROM HIS ROAR":GOSUB 1220
232 GOSUB 1200:POSITION 2,20:? #6;"HE WILL ONLY CROSSTHE STREAM USING THE LOG IN THE CENTER     OF THE SCREEN"
234 GOSUB 1220:GOSUB 1200:POSITION 1,21:? #6;"YOU MAY USE EITHER   OF THE BRIDGES":GOSUB 1220
236 GOSUB 1200:POSITION 3,20:? #6;"TRY TO AVOID THE TIGER press any key when ready":GOSUB 1220
275 GOSUB 1200:POSITION 17,12:? #6;"!":REM FIRST POSITION IS THE DOCK
280 TP=INT(RND(0)*21):GOSUB 900:REM INIT. TIGER POS. IS RANDOM
300 A=USR(SK):Y=PEEK(208):X=PEEK(209):LOCATE X,Y,Z:POSITION X,Y:? #6;"x":FOR I=1 TO 10:NEXT I:REM CURSOR ON
310 POSITION X,Y:? #6;CHR$(Z):FOR I=1 TO 10:IF STRIG(0)=0 THEN 330:REM CURSOR OFF, CHECK FOR TRIGGER
320 NEXT I:GOTO 300:REM LOOP BACK
329 REM ** FILL NEXT ROOM COORDS.**
330 FOR I=0 TO 2:X(I)=RC(NR(RM,I),0):Y(I)=RC(NR(RM,I),1):NEXT I
339 REM ** CK IF PRESENT POS. IS A PERMITTED MOVE **
340 I=0
342 IF X(I)=X AND Y(I)=Y THEN 350
344 I=I+1:IF I=3 THEN 300
346 GOTO 342
349 REM ** PUT OLD ROOM BACK, UPDATE ROOM **
350 POSITION RC(RM,0),RC(RM,1):? #6;CHR$(ZRM):POKE 208,Y(I):POKE 209,X(I):RM=NR(RM,I)
360 LOCATE X(I),Y(I),ZRM:POSITION X(I),Y(I):? #6;"!"
369 REM ** CK FOR REACHING DOCTOR **
370 IF RM=21 AND DOCFLG=0 THEN DOCFLG=1:GOSUB 500
379 REM ** CK FOR BRINGING DOCTOR BACK **
380 IF RM=0 AND DOCFLG=1 THEN GOTO 700
399 REM ** DETERMINE TIGER'S MOVE **
400 R=INT(RND(0)*4):IF TP>RM THEN TP=TP-R
410 IF TP<RM THEN TP=TP+R
420 IF TP=RM THEN 800
430 IF TP<0 THEN R=INT(RND(0)*4):TP=TP+R:GOTO 420
440 GOSUB 900
450 GOTO 300
499 REM ** REACHED THE DOCTOR **
500 GOSUB 1200:POSITION 7,21:? #6;"you got":POSITION 5,22:? #6;"the doctor":FOR K=100 TO 50 STEP -2
510 SOUND 0,K,10,10:FOR L=1 TO 10:NEXT L:NEXT K:SOUND 0,0,0,0:RETURN 
599 REM ** TIGER'S ROAR **
600 FOR I=1 TO 4:LOCATE V,W,ZSV:C$(I,I)=CHR$(ZSV):POSITION V,W:? #6;R$(I,I):V=V+1:NEXT I
620 GOSUB 650:V=V-4:POSITION V,W:? #6;C$:RETURN 
650 FOR K=1 TO 20:SOUND 0,ASC(P$(K)),2,ASC(L$(K)):SOUND 1,ASC(P$(K))-75,12,ASC(L$(K)):FOR J=1 TO 10:NEXT J:NEXT K
660 SOUND 0,0,0,0:SOUND 1,0,0,0:RETURN 
699 REM ** SAVED CREWMAN **
700 GRAPHICS 18:POSITION 3,3:? #6;"THE DOCTOR WAS     ABLE TO SAVE THE        CREWMAN!"
705 POSITION 2,7:? #6;"congratulations!"
710 POSITION 5,9:? #6;"TRY AGAIN?":POSITION 5,10:? #6;"press start":GOTO 830
800 GOSUB 1200:FOR L=1 TO 3:POSITION X(I),Y(I):? #6;"t":GOSUB 650:POSITION X(I),Y(I):? #6;CHR$(ZRM):NEXT L
810 POSITION 3,20:? #6;"TIGER GOT YOU":POSITION 7,22:? #6;"again?":POSITION 4,23:? #6;"PRESS START"
830 IF PEEK(53279)<>6 THEN 830
840 GOTO 198
899 REM ** TIGER LOCATION **
900 TS=INT(TP/5+0.9):GOSUB 1200:POSITION 5,21:? #6;"TIGER IS":POSITION 3,23
910 IF TS=1 THEN ? #6;"IN THE SWAMP":V=13:W=15
920 IF TS=2 THEN ? #6;"IN THE FOREST":V=13:W=6
930 IF TS=3 THEN ? #6;"ON THE PLAIN":V=4:W=13
940 IF TS=4 THEN ? #6;"IN THE HILLS":V=4:W=5
950 IF TS=5 THEN ? #6;"IN THE VILLAGE":V=0:W=9
960 IF TS=0 THEN ? #6;"ON THE DOCK":V=16:W=11
990 GOSUB 600:RETURN 
999 REM ** CHANGE CHARACTER SET **
1000 DIM ZZ$(32):RESTORE 1010:FOR I=1 TO 32:READ A:ZZ$(I)=CHR$(A):NEXT I
1010 DATA 104,104,133,204,104,133,203,104,133,206,104,133,205,162,4,160,0
1012 DATA 177,203,145,205,136,208,249,230,204,230,206,202,208,240,96
1014 POKE 106,PEEK(106)-5:GRAPHICS 0:START=(PEEK(106)+1)*256:POKE 756,START/256:POKE 752,1:? "INITIALIZING ..."
1016 A=USR(ADR(ZZ$),57344,START):RESTORE 1020:FOR I=START+24 TO START+247:READ A:POKE I,A:NEXT I
1018 RESTORE 1120:FOR I=START+8 TO START+15:READ A:POKE I,A:NEXT I:RETURN 
1020 DATA 3,7,14,28,24,24,24,24,0,0,0,248,252,14,7,3,192,224,112,56,24,24,24,24
1030 DATA 24,24,24,24,28,14,7,3,3,7,14,252,248,0,0,0,192,224,112,63,31,0,0,0
1040 DATA 24,24,24,24,24,24,24,24,0,0,0,255,255,0,0,0,192,127,63,0,0,63,127,192
1050 DATA 3,254,252,0,0,252,254,3,0,123,0,221,0,123,0,246,0,0,0,0,0,24,24,0
1060 DATA 16,56,84,56,84,186,16,16,0,32,112,170,119,170,39,34,0,0,0,0,0,168,117,34
1070 DATA 0,0,0,24,60,126,231,195,3,7,14,28,24,0,0,0,3,7,14,28,56,112,224,192
1080 DATA 192,224,112,56,28,14,7,3,192,224,112,56,24,0,0,0,0,102,153,0,0,102,153,0
1090 DATA 1,3,7,15,31,63,127,255,128,192,224,240,248,252,254,255,15,15,15,15,15,15,15,15
1100 DATA 240,240,240,240,240,240,240,240,0,0,20,8,88,45,170,170,255,255,195,195,195,195,255,255
1110 DATA 255,255,255,255,255,255,255,255
1120 DATA 0,24,60,60,60,255,255,0
1199 REM ** CLEAR TEXT AREA **
1200 POSITION 0,20:? #6;"                                                                               ":RETURN 
1219 REM ** WAIT FOR KEY PRESS **
1220 FOR I=1 TO 100:NEXT I:IF PEEK(764)=255 THEN 1220
1222 POKE 764,255:RETURN 
2008 REM ** PRINT SCREEN **
2009 REM ** IN LINES 2010-2029 ALL Q'S ARE REALLY (CTRL W)'S **
2010 ? #6;"      22{23}{23}         {23}";
2011 ? #6;"     43  {23}{23}        {23}";
2012 ? #6;"   {29}  {29}$ {23}{23}   {inv}={/inv}$ {inv}/{/inv} {23}";:REM A IS (ESC CTRL =), = AND / ARE INVERSE
2013 ? #6;"36# 5#  5 {23}{23} 4  5  {23}";
2014 ? #6;"36)  {29} 2 %{23}{23}# {inv}/0{/inv} % {23}";:REM A IS (ESC CTRL =), / AND 0 ARE INVERSE
2015 ? #6;"  {29}   4  {29}{139}{140}{inv}={/inv}   {inv}0{/inv}) {23}";:REM A'S ARE (ESC CTRL =),B IS (INV CTRL K),C IS (INV CTRL L),= AND 0 IS INV
2016 ? #6;"  )454  4 {23}{23}) {inv}/{/inv}  ) {23}";:REM / IS INVERSE
2017 ? #6;"{152}{153}) 4  4  {23}{23}) {inv}0/{/inv} {inv}={/inv} {23}";:REM A IS (INV CTRL X),B IS (INV CTRL Y),0 / AND = ARE INVERSE
2018 ? #6;"{154}{27}=   # 1 {23}{23}){inv}0{/inv}  4) {23}";:REM A IS (INV CTRL Z), B IS (ESC ESC) 0 IS INV
2019 ? #6;"  )1  {157}**{157}--{inv}={/inv}**{inv}={/inv} ) {23}";:REM A'S ARE (INV ESC CTRL =), ='S ARE INVERSE
2020 ? #6;"1 ) 1#  # {23}{23} {inv}/{/inv} ) ) {23}";:REM / IS INVERSE
2021 ? #6;"  {157}$ ) 1) {23}{23}   ) ) {23}";:REM A IS (INV ESC CTRL =)
2022 ? #6;"   1({157}  ){23}{23} < <= ={139}{158}";:REM A IS (INV ESC CRTL =),B IS (INV CTRL K),C IS (ESC CTRL TAB)
2023 ? #6;" 1    1 ){23}{23}  ='& ) {23}";
2024 ? #6;"    {23}{23}  ){23}{23} 4 1 5) {23}";
2025 ? #6;"   {23}{23}{23}{23} {157}{139}{140}= <   = {23}";:REM A IS (INV CTRL =),B IS (INV CTRL K),C IS (INV CTRL L)
2026 ? #6;"  {23}{23}{23}{23}{23}  {23}{23} 5   4 <{23}";
2027 ? #6;"   {23}{23}{23}{23}{23}  {23}{23} (='   {23}";
2028 ? #6;"    {23}{23}{23}{23}{23}{23}{23}{23}{23}  <  {23}{23}";
2029 ? #6;"            {23}{23}{23}{23}{23}{23}{23} ";
2030 RETURN 

Play Tiger