10 ' 20 ' SKUNK.BAS 30 ' 40 ' v 1.6e - 1/19/18 - added Ansi support 50 ' 60 ' v 1.6d - 11/22/2016 - tuned up delay logic a bit - had to 70 ' reassemble Z3HDR.MAC - added "Altair" environment address 80 ' renumbered 90 ' 100 ' v 1.6c - 4/2-4/2006 - changed comments on how to compile 110 ' "re-fixed" speed (overrode 2/4/2000 adjustment to DL setting) 120 ' removed leading blank in program name - get name from External 130 ' FCB if available - renumbered under MBASIC 140 ' 150 ' v 1.6a - 4/12/93 - Lee Bradley 160 ' 170 ' works under MBASIC now. 180 ' {/}o command tail support for Kaypro and Royal under CP/M 2.2 190 ' 200 ' v 1.6 - 3/12/93 - Lee Bradley 210 ' 220 ' added character graphics, external luminary file, etc. 230 ' 240 ' Original author unknown. Z-ified by Lee Bradley. 6/7/90 250 ' 260 ' Skunk is a dice game. The dice are rolled and the total added to 270 ' the player's score (unless a skunk appears, which blows that turn, 280 ' or a double skunk, which blows the cumulative score.) 290 ' 300 ' To compile, link and go ... 310 ' 320 ' BASCOM =SKUNK/Z/O 330 ' L80 Z3HDR,CMD,SKUNK,SKUNK/N/E 340 ' SKUNK {/}o 350 ' 360 ' Z3HDR.REL is the Microsoft REL file derived from the following: 370 ' 380 ' CSEG ! DEFB 'Z3ENV' ! DEFB 1 ! DEFW 0 ! END 390 ' 400 ' CMD.REL is a command tail grabbing routine by Pete Motyl 410 ' 420 ' MBASIC$="NO" ' set to "NO" if compiling, to "ON" if using MBASIC 430 MBASIC$="ON" 440 PNAME$="SKUNK" 450 GOSUB 3490 ' Get Z3 environment address 460 ' 470 IF ENV<>0 THEN 540 480 IF MBASIC$="NO" THEN 510 490 INPUT "(K)aypro, (R)oyal, or (A)nsi (K/R/A) ";KRA$ 500 GOTO 540 510 CALL CMD(TAIL$) 520 IF LEN(TAIL$)=0 THEN 640 530 KRA$=MID$(TAIL$,INSTR(TAIL$,"/")+1,1) 540 VER$="1.6e" 550 DEFSTR S:DEFINT I-N 560 DIM SPLAY(4),PSCORE(4),GAMESW(4),BOWTIE$(64),G$(13) 570 DEF FNIVAL=INT(6*RND)+1 580 OPEN "I", #1,"SKUNK.DAT" 590 FOR I=1 TO 64:INPUT #1,BOWTIE$(I):NEXT ' Load luminaries 600 CLOSE #1 610 ' 620 ' Set up default terminal strings 630 ' Change these for your terminal if running under MBASIC or non-Z-System 640 ' 650 IF ENV<>0 THEN 1030 ' Use Z-System if available 660 IF KRA$="" THEN 680 670 IF INSTR("KRA",KRA$) <> 0 THEN 720 680 PRINT : PRINT "Usage: SKUNK {/}o" 690 PRINT "o may be K, R, or A for Kaypro, Royal, or Ansi" 700 SYSTEM 710 ' 720 IF KRA$="K" THEN 840 730 IF KRA$="R" THEN 760 740 GOTO 920 750 ' 760 TID$="Royal-PC" 770 CL$=CHR$(27)+"T17" 780 CM$=CHR$(27)+"Y%+ %+ " 790 CE$=CHR$(27)+"K" 800 SO$=CHR$(28) 810 SE$=CHR$(18) 820 GOTO 980 830 ' 840 TID$="Kaypro" 850 CL$=CHR$(26) 860 CM$=CHR$(27)+"=%+ %+ " 870 CE$=CHR$(24) 880 SO$="" 890 SE$="" 900 GOTO 980 910 ' 920 TID$="Ansi" 930 CL$=CHR$(27)+"[2J" 940 CM$=CHR$(27)+"[%i%d;%dH" 950 CE$=CHR$(27)+"[K" 960 SO$=CHR$(27)+"[1m" 970 SE$=CHR$(27)+"[m" 980 ' 990 MHZ=4 1000 UL$="+":UR$="+":LL$="+":LR$="+":VL$="|":HL$="-" 1010 ' 1020 GOTO 1300 ' branch around Z-System stuff 1030 ' 1040 IF MBASIC$="ON" THEN 1070 1050 GOSUB 4570 ' Get name of .COM file 1060 PNAME$=EFCB$ 1070 GOSUB 4650 ' Get speed in MHz 1080 TINDEX=0:GOSUB 3810:TID$=MID$(X$,1,INSTR(X$," ")-1) ' Terminal Id 1090 TINDEX=1:GOSUB 3810:CL$=X$ ' Clear screen 1100 TINDEX=2:GOSUB 3810:CM$=X$ ' Cursor motion macro 1110 TINDEX=3:GOSUB 3810:CE$=X$ ' Clear to end of line 1120 TINDEX=4:GOSUB 3810:SO$=X$ ' Standout 1130 TINDEX=5:GOSUB 3810:SE$=X$ ' Standout end 1140 TINDEX=6:GOSUB 3810:TI$=X$ ' Terminal init 1150 TINDEX=7:GOSUB 3810:TE$=X$ ' Terminal deinit 1160 ' 1170 ' Get graphic strings and characters 1180 ' 1190 IF NOT (EXTCAPSW$="ON") THEN 1300 1200 GSW$="ON" ' Turn on graphics switch 1210 ' 1220 TINDEX=1:GOSUB 3810:GO$=X$ ' Graphics on 1230 TINDEX=2:GOSUB 3810:GE$=X$ ' Graphics off 1240 TINDEX=3:GOSUB 3810:CDO$=X$ ' Cursor off 1250 TINDEX=4:GOSUB 3810:CDE$=X$ ' Cursor on 1260 ' Note: MUST collect cursor on for graphic char. collection to work 1270 FOR I=1 TO 13:G$(I)=CHR$(PEEK(ENV+EOFF+I)):NEXT ' Graphic characters 1280 UL$=G$(1):UR$=G$(2):LL$=G$(3):LR$=G$(4):HL$=G$(5):VL$=G$(6) 1290 ' 1300 GOSUB 2680 ' Build dice strings 1310 PRINT CL$ ' Clear screen 1320 PRINT SO$;PNAME$;" Version ";VER$;" ";SE$:PRINT 1330 PRINT "Terminal Id: ";SO$;" ";TID$;" ";SE$:PRINT 1340 PRINT "Speed: ";SO$;MHZ;"MHz ";SE$:PRINT 1350 ' 1360 PRINT "Welcome to Skunk! The object of the game is to amass 100 points" 1370 PRINT "first. You may roll the dice as many times as you wish each turn" 1380 PRINT "until a skunk or double skunk is rolled. A single skunk wipes" 1390 PRINT "out points acquired for that turn. A double skunk wipes out points" 1400 PRINT "for that turn and all other points." 1410 ' 1420 GOSUB 3230 ' Establish upper limit and delay 1430 ' Entry point for player name entry 1440 FOR P=1 TO 4:GAMESW(P)=0:NEXT 1450 PRINT CL$:PRINT:PRINT:PRINT "How many players ( 1 .. 4 ) "; 1460 S=INPUT$(1):IF NOT (S>"0" AND S<"5") THEN PRINT CL$:GOTO 1450 1470 NP=VAL(S):PRINT:PRINT 1480 FOR P=1 TO NP:PRINT "Player";P;"'s name ";:INPUT SPLAY(P): PRINT:NEXT 1490 IF NP>1 THEN 1540 1500 ' Only one player, other will be computer 1510 NP=2 1520 SPLAY(2)="Computer" 1530 ' Initialize screen 1540 PRINT CDO$ ' kill cursor 1550 GOSUB 2470 1560 R=1:C=0:GOSUB 4130 ' Position cursor 1570 PRINT CMO$; 1580 PRINT " ";SO$;" Score ";SE$;" ";SO$;" Player ";SE$; 1590 PRINT " ";SO$;" Games ";SE$ 1600 R=22:C=60:GOSUB 4130:PRINT CMO$;SO$;" SKUNK ";VER$;" ";SE$ 1610 GOSUB 2330 ' Print scores and names 1620 R=22:C=0:GOSUB 4130 1630 PRINT CMO$+"Any key = roll, = end turn, ESC = abort game "; 1640 ' Play the game 1650 P=0 1660 P=P+1 1670 GOSUB 1890 ' Play 1680 PSCORE(P)=PSCORE(P)+ITOT 1690 GOSUB 2330 ' Print scores and names 1700 IF PSCORE(P)>UL THEN 1750 1710 FOR DL1=1 TO 100*DL 1720 NEXT 1730 IF P=NP THEN 1650 1740 GOTO 1660 1750 ' Winner - Play again? 1760 FOR P1=1 TO 4:PSCORE(P1)=0:NEXT 1770 GAMESW(P)=GAMESW(P)+1 1780 R=22:C=0:GOSUB 4130 1790 PRINT CMO$+CE$+CMO$;CDE$; ' clear line, turn cursor on 1800 PRINT "(S)ame / (N)ew players, (C)hange limit/delay, (Q)uit "; 1810 KK$=INPUT$(1):PRINT CL$ 1820 PRINT "" 1830 IF INSTR("Ss",KK$)<>0 THEN 1530 1840 IF INSTR("Nn",KK$)<>0 THEN 1430 1850 IF INSTR("Cc",KK$)<>0 THEN GOSUB 3230:GOTO 1530 1860 IF INSTR("Qq",KK$)<>0 THEN 1880 1870 PRINT CL$:PRINT:GOTO 1800 1880 PRINT CL$;CDE$:SYSTEM 1890 ' Play individual turn subroutine 1900 R=14:C=42:GOSUB 4130 1910 PRINT CMO$+CE$+CMO$+"Your turn, "+SPLAY(P)+" "; 1920 ITOT=0:NOSKU=0 1930 ' Just in case, remove last player's junk from Zilog SIO 1940 FOR II=1 TO 4:SS=INKEY$:NEXT 1950 GOTO 2010 1960 ' Display and turn loop 1970 R=14:C=42:GOSUB 4130 1980 FOR DL1=1 TO 100*DL 1990 NEXT 2000 PRINT CMO$+CE$+CMO$+SPLAY(P)+" "; 2010 IF SPLAY(P) = "Computer" THEN 2090 2020 ' Human input 2030 PRINT CDE$; 2040 SEL=INKEY$:X=RND:IF LEN(SEL)=0 THEN 2040 ' RND omize on user input 2050 PRINT CDO$; 2060 IF SEL=CHR$(13) THEN 2270 2070 IF SEL=CHR$(27) THEN 1880 ' quit 2080 GOTO 2140 2090 ' Computer input 2100 IF ITOT+PSCORE(2)>UL THEN 2270 2110 IF ITOT>20 THEN 2270 ' Quit 2120 IF NOSKU>4 THEN 2270 ' Quit 2130 ' Roll tally & check 2140 GOSUB 2720 ' Roll 'em 2150 ITOT=ITOT+JTOT 2160 IF NUM=1 THEN 2210 2170 IF NUMA=1 THEN 2210 2180 R=17:C=42:GOSUB 4130:PRINT CMO$+"Total so far ";ITOT 2190 GOTO 1960 ' End turn loop 2200 ' A Skunk 2210 ITOT=0 2220 NOSKU=0 2230 IF NUMA=NUM THEN PSCORE(P)=0 2240 FOR DL1=1 TO 100*DL 2250 NEXT 2260 ' End of turn, clear board 2270 C=42 2280 FOR R=14 TO 17 STEP 3:GOSUB 4130:PRINT CMO$+CE$:NEXT 2290 NUM=7 2300 GOSUB 2810 ' Clear upper di 2310 GOSUB 2820 ' Clear lower di 2320 RETURN 2330 ' Print scores and names subroutine 2340 FOR P1=1 TO NP 2350 C=0 2360 R=(P1*2)+2 2370 GOSUB 4130:PRINT CMO$; 2380 PRINT USING "#####";PSCORE(P1) 2390 C=11:GOSUB 4130 2400 PRINT CMO$; 2410 PRINT SPLAY(P1) 2420 C=25:GOSUB 4130 2430 PRINT CMO$; 2440 PRINT GAMESW(P1) 2450 NEXT 2460 RETURN 2470 ' Print dice subroutine 2480 PRINT CL$ 2490 C=41 2500 FOR R=3 TO 11 2510 GOSUB 4130:PRINT CMO$; 2520 IF R = 3 THEN PRINT SL1:GOTO 2550 2530 IF R = 11 THEN PRINT SL3:GOTO 2550 2540 PRINT SL2 2550 NEXT R 2560 PRINT ' A cr for MBASIC 2570 C=21 2580 FOR R=12 TO 20 2590 GOSUB 4130:PRINT CMO$; 2600 IF R = 12 THEN PRINT SL1:GOTO 2630 2610 IF R = 20 THEN PRINT SL3:GOTO 2630 2620 PRINT SL2 2630 NEXT R 2640 PRINT ' A cr for MBASIC 2650 NUM=1 2660 RETURN 2670 ' Dice outline data subroutine 2680 SL1=GO$+UL$+STRING$(17,HL$)+UR$+GE$ 2690 SL2=GO$+VL$+GE$+STRING$(17," ")+GO$+VL$+GE$ 2700 SL3=GO$+LL$+STRING$(17,HL$)+LR$+GE$ 2710 RETURN 2720 ' Roll 'em subroutine 2730 NOSKU=NOSKU+1:NUM=FNIVAL:JTOT=NUM:NUMA=NUM 2740 GOSUB 2810:GOSUB 2780 2750 NUM=FNIVAL:JTOT=JTOT+NUM:GOSUB 2820 2760 GOTO 2780 ' Use its return 2770 ' Further randomize 2780 FOR I=1 TO 4:X=RND:NEXT 2790 RETURN 2800 ' Dice values; upper right, lower left 2810 R=4:C=45:GOTO 2830 2820 R=13:C=25 2830 IF NUM = 1 THEN RESTORE 3020 2840 IF NUM = 2 THEN RESTORE 3050 2850 IF NUM = 3 THEN RESTORE 3080 2860 IF NUM = 4 THEN RESTORE 3110 2870 IF NUM = 5 THEN RESTORE 3140 2880 IF NUM = 6 THEN RESTORE 3170 2890 IF NUM = 7 THEN RESTORE 3200 2900 ' Print the value 2910 FOR ILIN=1 TO 7 2920 READ SLIN:GOSUB 4130 2930 IF NOT(ILIN=4 AND NUM=1) THEN 2960 2940 FOR X=1 TO RND*10:NEXT 2950 SLIN=SO$+BOWTIE$(INT(64*RND)+1)+SE$ 2960 PRINT CMO$+SLIN; 2970 R=R+1 2980 NEXT 2990 PRINT 3000 RETURN 3010 ' Dice value data 3020 DATA " /---\ "," | @ @ | "," \ ~ / ","CP/M LIVES!" 3030 DATA " / *** \ "," / *** \ "," \==---==/ " 3040 ' ----- 2 3050 DATA " ","** "," "," " 3060 DATA " "," **"," " 3070 ' ----- 3 3080 DATA " ","** "," "," *** " 3090 DATA " "," **"," " 3100 ' ----- 4 3110 DATA " ","** **"," "," " 3120 DATA " ","** **"," " 3130 ' ----- 5 3140 DATA " ","** **"," "," *** " 3150 DATA " ","** **"," " 3160 ' ----- 6 3170 DATA " ","** **"," ","** **" 3180 DATA " ","** **"," " 3190 ' ----- 7 spaces 3200 DATA " "," "," "," " 3210 DATA " "," "," " 3220 ' 3230 ' Establish upper limit and delay subroutine 3240 ' 3250 UL=100:S1="" 3260 PRINT:PRINT "Enter upper limit ( 20 .. 300 ) ( for 100 ) "; 3270 S=INKEY$:IF LEN(S)=0 THEN 3270 3280 IF S=CHR$(13) THEN 3300 3290 PRINT S;:S1=S1+S:GOTO 3270 3300 IF LEN(S1)<>0 THEN UL=VAL(S1) 3310 UL=UL-1 3320 DL=250*MHZ/4 3330 PRINT:PRINT:PRINT "Enter delay factor ( 1 .. 9 ) ( for 1 ) "; 3340 S=INKEY$:IF LEN(S)=0 THEN 3340 3350 IF S=CHR$(13) THEN 3370 3360 PRINT S;:DL=VAL(S)*DL 3370 PRINT:PRINT 3380 PRINT "Strike Any Key ... " 3390 SS=INKEY$ 3400 X=RND ' Re-seed based on human's delay 3410 IF LEN(SS)=0 THEN 3390 ELSE RETURN 3420 ' 3430 ' Exerpted from Z3BAS.LIB 3440 ' 3450 ' --- 3460 ' Load ENV with environment address. 3470 ' --- 3480 ' 3490 Z3$=CHR$(PEEK(&H103))+CHR$(PEEK(&H104)) 3500 IF Z3$="Z3" THEN 3640 3510 ' ==> NOTE! Edit &H value below. Will be used under MBASIC. 3520 ' ENV=&HD380+65536! ' Note need to make positive by adding 2^16 3530 ENV=&HEF80+65536! ' Altair simulator 3540 ' ENV=&HF700+65536! ' MYZ80's env. address 3550 ' ENV=&HFE00+65536! ' ON!'s env. address 3560 ENV1=PEEK(ENV+&H1B)+256*PEEK(ENV+&H1C) 3570 IF ENV1=ENV THEN 3710 3580 ENV=0 3590 PRINT:PRINT "If running ZCPR3, change statement" 3600 PRINT "ENV=&H ... " 3610 PRINT "Strike Any Key ... " 3620 IF LEN(INKEY$)=0 THEN 3620 3630 GOTO 3710 3640 IF PEEK(&H10A)<> 0 THEN 3670 3650 PRINT "If not ZCPR3 version ZCPR33+ you must use Z3INS " 3660 PRINT "ZCPR33+ was not found.":ENV=0:GOTO 3610 3670 ENV=PEEK(&H109)+256*PEEK(&H10A) 3680 ENV1=PEEK(ENV+&H1B)+256*PEEK(ENV+&H1C) 3690 IF ENV1=ENV THEN 3710 3700 PRINT:PRINT "Environment self-reference error detected":END 3710 RETURN 3720 ' 3730 ' --- 3740 ' Load X$ with tcap string based on TINDEX, a tcap string "index" 3750 ' and ENV, the environment address. 3760 ' X$ will hold terminal id string if TINDEX is 0 3770 ' X$ will hold clear screen string if TINDEX is 1. Etc. 3780 ' Support for character graphics. 3790 ' --- 3800 ' 3810 EOFF=128 ' Start at beginning of tcap segment 3820 IF GSW$="" THEN 3840 ' non graphic? 3830 EOFF=128+GOF+1 ' Start just past graphics delay 3840 IF TINDEX=0 THEN 3930 ' No need to skip anything if looking for id 3850 IF GSW$="" THEN EOFF=128+16+4+3 ' Get past id, arrow and delay bytes 3860 IF TINDEX=1 THEN 3930 ' No need to skip any more if clear scr wanted 3870 FOR TSKIP=1 TO TINDEX-1 ' Skip the strings we don't want 3880 IF CHR$(PEEK(ENV+EOFF))<>"\" THEN 3900 ' Catch literals 3890 EOFF=EOFF+2 ' advance to next character 3900 IF PEEK(ENV+EOFF)<>0 THEN EOFF=EOFF+1:GOTO 3880 ' Loop till null found 3910 EOFF=EOFF+1 ' Advance and move to next string 3920 NEXT TSKIP 3930 ' Build tcap string 3940 X$="" ' Null out work string 3950 IF CHR$(PEEK(ENV+EOFF))<>"\" THEN 3970 ' Catch literals 3960 EOFF=EOFF+1:GOTO 4030 ' Advance to literal 3970 IF NOT (EOFF=128+13 AND TINDEX=0) THEN 4010 ' Get out if id complete 3980 GOF=PEEK(ENV+128+13) ' Save graphic offset 3990 IF PEEK(ENV+128+14)=&H80 THEN EXTCAPSW$="ON" 4000 RETURN 4010 IF PEEK(ENV+EOFF)<>0 OR TINDEX=0 THEN 4030 ' If null 4020 RETURN ' return 4030 X$=X$+CHR$(PEEK(ENV+EOFF)):EOFF=EOFF+1:GOTO 3950 ' else, grab it and loop 4040 ' 4050 ' --- 4060 ' Cursor motion macro interpreter 4070 ' Input: R,C,CM$ (row,col,cursor motion macro) 4080 ' Output: CMO$ (string to output to the terminal) 4090 ' Ref: ZCPR3 The Manual, Richard Conn, Ch 22. 4100 ' --- 4110 ' 4120 DIM OFFSET(2),PREINFIX$(2),RC(2),CMD$(2) 4130 WK$="":PCTR=0:I1=0:OFFSET(1)=0:OFFSET(2)=0 ' Initialize 4140 PREINFIX$(1) = "":PREINFIX$(2) = "":RC(1)=R:RC(2)=C ' Initialize 4150 I1=I1+1:IF I1>LEN(CM$) THEN 4460 ' Top of loop 4160 CMC$=MID$(CM$,I1,1) ' Load cursor motion macro char. 4170 IF CMC$<>"%" THEN 4430 ' If not a %, tack onto work string 4180 I1=I1+1:CMC$=MID$(CM$,I1,1) ' Advance 4190 RI=INSTR("RrIi",CMC$) 4200 IF RI=1 OR RI=2 THEN CB4R$="ON":GOTO 4150 ' Handle R,I commands 4210 IF RI=3 OR RI=4 THEN HOME=1:GOTO 4150 4220 PCTR=PCTR+1 ' Update % counter 4230 PREINFIX$(PCTR)=WK$ ' Save work string 4240 WK$="" ' Null out for future build 4250 IF CMC$<>"." THEN 4280 ' Binary ? 4260 CMD$(PCTR)=CHR$(RC(PCTR)+HOME) 4270 GOTO 4150 ' Loop 4280 D23=INSTR("D23d",CMC$):IF D23=0 THEN 4340 ' Ascii? 4290 CMD$(PCTR)=MID$(STR$(RC(PCTR)+HOME),2) 4300 IF LEN(CMD$(PCTR))=1 AND D23=2 THEN CMD$(PCTR)="0"+CMD$(PCTR) ' Fix 4310 IF LEN(CMD$(PCTR))=1 AND D23=3 THEN CMD$(PCTR)="00"+CMD$(PCTR) 4320 IF LEN(CMD$(PCTR))=2 AND D23=3 THEN CMD$(PCTR)="0"+CMD$(PCTR) 4330 GOTO 4150 ' Loop 4340 IF CMC$<>"+" THEN 4390 ' Offset? 4350 I1=I1+1:CMC$=MID$(CM$,I1,1) 4360 OFFSET(PCTR)=ASC(CMC$) 4370 CMD$(PCTR)=CHR$(RC(PCTR)+HOME+OFFSET(PCTR)) 4380 GOTO 4150 ' Loop 4390 IF CMC$<>">" THEN PRINT "Error in cursor motion macro ... ":END 4400 I1=I1+1:CMC1$=MID$(CM$,I1,1):I1=I1+1:CMC$=MID$(CM$,I1,1) 4410 IF CHR$(RC(PCTR))>CMC1$ THEN 4360 ELSE 4370 4420 ' Compute conditional offset, then use "+" code 4430 ' We have a character that's not part of a % command. Just add it 4440 WK$=WK$+CMC$ 4450 GOTO 4150 ' Loop 4460 ' All done. Anything left (in WK$) is the postfix part. 4470 IF CB4R$="ON" THEN SWAP CMD$(1),CMD$(2) ' If col before row, swap 4480 CMO$=PREINFIX$(1)+CMD$(1)+PREINFIX$(2)+CMD$(2)+WK$ ' Build CMO$ 4490 RETURN 4500 ' 4510 ' --- 4520 ' Load variables (QUIET, WHEEL etc.) based on ENV, 4530 ' the environment address. 4540 ' --- 4550 ' 4560 ' External File Control Block stuff 4570 EFCBA=PEEK(ENV+&H24)+256*PEEK(ENV+&H25)+1 4580 EFCB$="" 4590 IF CHR$(PEEK(EFCBA))<>" " AND LEN(EFCB$)<8 THEN EFCB$=EFCB$+CHR$(PEEK(EFCBA)):EFCBA=EFCBA+1:GOTO 4590 4600 RETURN 4610 ' Other stuff 4620 QUIET=PEEK(ENV+&H28):RETURN 4630 WHLA=PEEK(ENV+&H29)+256*PEEK(ENV+&H2A):RETURN 4640 WHEEL=PEEK(WHLA):RETURN 4650 MHZ=PEEK(ENV+&H2B):RETURN 4660 MAXD=PEEK(ENV+&H2C):RETURN 4670 MAXU=PEEK(ENV+&H2D):RETURN 4680 DUOK=PEEK(ENV+&H2E):RETURN 4690 '