10 HIMEM: 35070:ADRS = 35070: CALL ADRS: POKE 232,0: POKE 233,145: DEF FN DG(H) = (H / 360 - INT (H / 360)) * 360: DEF FN D(H) = FN DG( FN DG(H + 360)): DEF FN RD(X) = INT (X + .5): DEF FN RN(X) = INT ( RND (1) * X + 1): DEF FN CE(X) = PEEK (X) - 100 33 VA$ = CHR$ (129):VN$ = CHR$ (142):VI$ = CHR$ (137):VP$ = CHR$ (144):VY$ = CHR$ (153):VV$ = CHR$ (150):VW$ = CHR$ (151): DEF FN CN(X) = PEEK (X + 7909):VK$ = CHR$ (139):VL$ = CHR$ (140): DEF FN RF(X) = ((3700 - X) / 3700) ^ 2.86: SCALE= 1: ROT= 0: GOSUB 38000:X = 50:Y = (.84 - SC) * 80 + 41:K$(1) = "DETAS":K$(2) = "MILAS":K$(3) = "KAMAS": GOTO 14000 109 RC = INT (RC) ### draw scaled people outlines for chart 10000 FOR Z9 = 1 TO 3:X = 10 + Z9 * 50:SC = CE(W2,Z9) * .84:Y = (.84 - SC) * 80 + 41: GOSUB 21000: NEXT Z9: RETURN ### main UI loop 14000 FOR Z = 1 TO 7:Z(Z) = Z + 2: IF Z > 3 THEN Z(Z) = Z + 3 14003 NEXT Z: IF EN(12) < 20 OR AL(12) < 20 THEN Z(4) = - Z(4) 14010 IF EN(12) < 10 OR AL(12) < 10 THEN Z(5) = - Z(5) 14020 GOSUB 39000:Z = 7:Y = 30: GOSUB 41000:CO = X: GOSUB 38000: ON CO GOSUB 18000,20000,24000,18200,29000,19000,16000: IF CO = 5 OR CO = 7 THEN GOSUB 25000 14090 GOTO 14000 ### return to main menu 16000 FOR Z = 1 TO 4:K$(Z) = "": NEXT Z: FOR Z = 0 TO 32:Z$(Z) = "": NEXT Z: FOR Z = 1 TO 9:Z1$(Z) = "": NEXT Z: PRINT VN$VK$VA$0: PRINT CHR$ (4);"BLOAD CHAIN,A520": CALL 520"MAIN MENU" 16090 GOTO 16090 ### status/crew 18000 REM 18010 GOSUB 38000: GOSUB 47000: GOSUB 46000: GOSUB 26000:W5 = 0: GOSUB 26100: GOSUB 26400: RETURN ### change/crew # select station in W2, then 27600 18200 EN(12) = EN(12) - 20:AL(12) = AL(12) - 20:W5 = 1: GOSUB 38000: GOSUB 47000: GOSUB 27600: RETURN ### change/power 19000 REM 19002 W5 = 1: FOR Z = 1 TO 4:LS(Z) = 0: NEXT Z:X5 = 1: GOSUB 24000:C = 1: FOR W2 = 1 TO 3: GOSUB 39000: PRINT VA$1VL$;"ENTER % FOR ";: IF W2 = 1 THEN PRINT "WEAPONS"; 19080 IF W2 = 2 THEN PRINT "ENGINEERING"; 19090 IF W2 = 3 THEN PRINT "NAVIGATION"; 19110 PL = 0:PU = FN RD(X5 * 100):RT = 1: GOSUB 40000:X5 = X5 - LS(W2): IF X5 = < .005 THEN 19125 19120 NEXT W2 19125 LS(4) = X5: GOSUB 24500: RETURN ### status/station 20000 REM # clear screen, select station 20005 GOSUB 38000: GOSUB 47000: PRINT VA$4; # print team charts : HCOLOR= 7: GOSUB 38000: GOSUB 22000: GOSUB 23000: GOSUB 10000: RETURN ### draw scaled person outline 21000 REM 21005 HPLOT X,Y TO X,Y + 2 * SC TO X - 14 * SC,Y + 8 * SC TO X - 14 * SC,Y + 32 * SC TO X - 4 * SC,Y + 40 * SC: HPLOT X - 2 * SC,Y + 34 * SC TO X - 8 * SC,Y + 30 * SC TO X - 8 * SC,Y + 16 * SC TO X - 2 * SC,Y + 34 * SC TO X - 14 * SC,Y + 76 * SC TO X - 14 * SC,Y + 80 * SC TO X - 8 * SC,Y + 80 * SC TO X - 8 * SC,Y + 76 * SC TO X + 4 * SC,Y + 44 * SC 21020 HPLOT TO X + 14 * SC,Y + 76 * SC TO X + 14 * SC,Y + 80 * SC TO X + 20 * SC,Y + 80 * SC TO X + 20 * SC,Y + 76 * SC TO X + 10 * SC,Y + 34 * SC TO X + 14 * SC,Y + 16 * SC TO X + 14 * SC,Y + 30 * SC TO X + 10 * SC,Y + 34 * SC: HPLOT X + 12 * SC,Y + 40 * SC TO X + 20 * SC,Y + 32 * SC TO X + 20 * SC,Y + 8 * SC TO X + 8 * SC,Y + 2 * SC TO X + 8 * SC,Y:X1 = 6.5 * SC:Y1 = 8 * SC:X2 = X + 4 * SC 21120 Y2 = Y - 6 * SC: HPLOT X2 + X1,Y2: FOR X3 = 0 TO 360 STEP 20:X4 = COS (X3 * DR) * X1 + X2:Y4 = SIN (X3 * DR) * Y1 + Y2: HPLOT TO X4,Y4: NEXT X3: RETURN ### draw team chart frame 22000 GOSUB 38000:Z1$ = "WEAPONS": IF W2 > 1 THEN Z1$ = "ENGINES": IF W2 > 2 THEN Z1$ = "NAVIGATION": IF W2 > 3 THEN Z1$ = "DEFENSE" 22005 VTAB (3): HTAB (11): PRINT VN$VK$VA$4;Z1$;: PRINT VA$1VL$VN$;: PRINT : FOR Z = 100 TO 0 STEP - 10: PRINT Z"%": NEXT Z: HCOLOR= 6: FOR Z = 28 TO 108 STEP 8: HPLOT 35,Z TO 190,Z: NEXT Z: HCOLOR= 7: RETURN ### draw team charts 23000 REM 23010 PRINT VA$4VK$;: FOR Z = 1 TO 3: PRINT TAB( (Z - 1) * 8 + 5);"TEAM "Z;: NEXT Z: PRINT : FOR Z = 1 TO 3: PRINT TAB( (Z - 1) * 8 + 6) FN RD(CE(W2,Z) * 100)"%";: NEXT Z: PRINT : PRINT "CREW";: FOR Z = 1 TO 3: PRINT TAB( (Z - 1) * 8 + 7)CM(W2,Z);: NEXT Z: PRINT : FOR Z = 1 TO 3: PRINT TAB( (Z - 1) * 8 + 5);: IF CT(W2,Z) = 2 THEN PRINT "STBY"; 23226 IF CT(W2,Z) = 3 THEN PRINT "SLEEP"; 23227 IF CT(W2,Z) = 1 THEN PRINT "DUTY"; 23230 NEXT Z: RETURN ### status/power 24000 REM 24005 FOR Z = 1 TO 4:W(Z) = 40: NEXT Z: GOSUB 38000: VTAB (3): HCOLOR= 7: FOR Z = 11 TO 62: HPLOT Z,29 TO Z,89: NEXT Z: FOR Z = 41 TO 45: HCOLOR= 6: HPLOT 10,Z TO 63,Z: HPLOT 67,Z TO 89,Z: HCOLOR= 7: HPLOT 94,Z TO 118,Z: HCOLOR= 5: HPLOT 151,Z TO 182,Z: NEXT Z: HCOLOR= 7: HPLOT 123,41 TO 145,41 TO 145,45 TO 123,45 TO 123,41 24019 HCOLOR= 6: FOR Z = 58 TO 90 STEP 16: FOR Z1 = Z TO Z + 2: HPLOT 10,Z1 TO 184,Z1: NEXT Z1: NEXT Z: PRINT VA$4VN$VK$;" TOTAL POWER: ";VA$VL$; FN RD(EN(12) * 10) / 10: PRINT : HTAB (2): PRINT VA$4VK$VI$"STATION";VN$" WEP ENG NAV DEF": PRINT : HTAB (2): PRINT VI$"CONSUMP";VA$1;VL$;VN$; 24050 FOR Z = 1 TO 4: PRINT TAB( 6 + Z * 4); FN RD(PC(Z,1) + PC(Z,2) + PC(Z,3));: NEXT Z: VTAB (9): HTAB (2): PRINT VA$4VK$VI$"AMOUNT ": PRINT : HTAB (2): PRINT "PERCENT": VTAB (19): HTAB (1): PRINT " LIFE SUPPORT PERCENT CHART";: HCOLOR= 5: HPLOT 11,15 TO 185,15 TO 185,25 TO 11,25 TO 11,15: HCOLOR= 6 24110 HPLOT 10,28 TO 184,28 TO 184,89 TO 10,89 TO 10,28: HPLOT 64,29 TO 64,89: HPLOT 92,29 TO 92,89: HPLOT 120,29 TO 120,89: HPLOT 148,29 TO 148,89: HCOLOR= 7: HPLOT 13,113 TO 186,113 TO 186,121 TO 13,121 TO 13,113: GOSUB 24500: RETURN ### draw power chart 24500 GOSUB 36000: PRINT VA$1VL$: VTAB (9): FOR Z = 1 TO 4: HTAB (4 * Z + 6): PRINT " ";: HTAB (4 * Z + 6): PRINT FN RD(LS(Z) * EN(12));: NEXT Z : VTAB (11): HTAB (1):Z(0) = 14: FOR Z = 1 TO 4: HTAB (4 * Z + 6): PRINT " ";: HTAB (4 * Z + 6): PRINT FN RD(LS(Z) * 100);:Z(Z) = 171 * LS(Z) + Z(Z - 1): NEXT Z # configure colors in Z1(n) :Z1(1) = 6:Z1(2) = 7:Z1(3) = 4:Z1(4) = 5:Z(0) = 13 # draw bar chart : FOR Z = 1 TO 4: HCOLOR= Z1(Z):Z(4) = 185 24630 FOR Y = 114 TO 120: IF Z(Z - 1) = Z(Z) THEN 24650 24640 HPLOT Z(Z - 1) + 1,Y TO Z(Z),Y 24650 NEXT Y: NEXT Z : HCOLOR= 4: GOSUB 24700: FOR Z = 1 TO 4:W(Z) = (Z(Z) + Z(Z - 1)) / 2: IF LS(Z) < .005 THEN W(Z) = 0 24682 NEXT Z: HCOLOR= 7: GOSUB 24700: RETURN # draw lines to bar chart 24700 W(0) = 14: FOR Z = 1 TO 4: IF W(Z) < > 0 THEN HPLOT 56 + 28 * Z,93 TO W(Z),112 24720 NEXT Z: RETURN 24900 REM 24910 LS(W2) = RC / 100: GOSUB 24500: PRINT VY$;: RETURN ### computes crew efficiency in CE(W2,W3) ### where W2 is station (0-3), W3 is team (1-3) ### also computed in INFO2; need to recompute here after crew re-shuffle 25000 REM # compute PC(W2,W3) 25005 GOSUB 25500 # set Z to a value based on crew size : FOR W3 = 1 TO 3:Z = 1: IF CM(W2,W3) < 6 THEN Z = CM(W2,W3) / 6 25020 IF CM(W2,W3) > 8 THEN Z = 1 - (CM(W2,W3) - 8) / 25 # set Z1 from CO value 25030 Z1 = CO(W2,W3) / 27: IF Z1 > 1 THEN Z1 = 1 # set Z2 to sum of PC values for all teams 25040 Z2 = 0:Z5 = 0: FOR Z3 = 1 TO 3:Z2 = Z2 + PC(W2,Z3): NEXT Z3 # set Z4 to the amount of energy allocated to team W2, divided by Z2 :Z4 = 0: IF Z2 > 0 THEN Z4 = EN(12) * LS(W2) / Z2 25060 IF Z4 > 1 THEN Z4 = 1 # get the efficiency values for each team member # (negative values for dead crew?) # add to Z2, set Z5 to average 25065 Z2 = 0: FOR Z3 = 1 TO 10:Y = FN CE(7728 + W2 * 60 + Z3 * 2 + (W3 - 1) * 20): IF Y > 0 THEN Z2 = Z2 + Y / 100 25090 NEXT Z3: IF CM(W2,W3) > 0 THEN Z5 = Z2 / CM(W2,W3) 25105 IF Z5 > 1 THEN Z5 = 1 # set CE to average of (crew size multiplier + value based on CO + average efficiency x4 + energy allocation) 25110 CE(W2,W3) = (Z + Z1 + Z5 * 4 + Z4) / 7: NEXT W3: RETURN ### set PC(W2,n) to life support energy cost based on number of crew per team and team status 25500 REM # number of crew * 1, 0.5, or 0; if nonzero, add 2 25510 FOR W3 = 1 TO 3:PC(W2,W3) = CM(W2,W3) * (1 + (2 - CT(W2,W3)) * .5): IF PC(W2,W3) > 0 THEN PC(W2,W3) = PC(W2,W3) + 2 25530 NEXT W3: RETURN # for station W2, load crew names into Z$(n), crew index into Z(n), efficiency into Z1(n) 26000 REM 26005 W$(0) = "CR":W$(2) = "ENS":W$(3) = "LT.":W$(4) = "LT CMD":W$(5) = "CMD": VTAB (1): PRINT VA$0VK$VN$: PRINT CHR$ (4);"OPEN CREW,L12": FOR Z = 1 TO 30:Y = 7728 + W2 * 60 + Z * 2:W4 = PEEK (Y + 1): PRINT CHR$ (4);"READ CREW,R";W4: INPUT Z$,W1:Z$(Z) = W$(W1) + " " + Z$:Z(Z) = W4:Z1(Z) = FN CE(Y): NEXT Z: PRINT CHR$ (4);"CLOSE CREW": CALL 35070: RETURN ### crew info screen for station W2, team W3 # if W5 then skip efficiency / energy consumption 26100 REM 26110 GOSUB 38000: PRINT VA$4VN$VK$"STATION:";:Z$ = "WEAPONS": IF W2 > 1 THEN Z$ = "ENGINEERING": IF W2 > 2 THEN Z$ = "NAVIGATION": IF W2 > 3 THEN Z$ = "DEFENSE" 26130 PRINT Z$: PRINT ;"TEAM:";W3; TAB( 10);"STATUS:";:Z = CT(W2,W3):Z$ = "DUTY": IF Z > 1 THEN Z$ = "STANDBY":W6 = 1: IF Z > 2 THEN Z$ = "SLEEP":W6 = .5 26137 PRINT Z$: PRINT TAB( 12);"ROSTER": HTAB (8): PRINT VA$1VL$;"NAME";:: HTAB (23): PRINT "EFFC": IF W5 THEN 26200 # bug? W6 should not be forced to 2 here -- perhaps meant "W6 * CM(W2,W3) + 2", as in PC formula? 26160 VTAB (17): PRINT VA$4VN$VK$"TEAM EFFICENCY: "; FN RD(CE(W2,W3) * 100):W6 = 2: PRINT "ENGERGY CONSUMPTION: " FN RD(W6 * CM(W2,W3)) 26200 HCOLOR= 6: HPLOT 14,32 TO 189,32: HPLOT 14,39 TO 189,39: HPLOT 14,121 TO 189,121: HPLOT 12,32 TO 12,121: HPLOT 190,32 TO 190,121: HPLOT 156,32 TO 156,121: HPLOT 20,32 TO 20,121: RETURN ### print individual crew names, with efficiency; leaves W8 set to number of crew on team # names in Z(n), efficiency in Z1(n) 26400 REM 26405 PRINT VA$1VN$VL$;:W8 = 1: FOR Z = 1 TO 10:Y = (W3 - 1) * 10 + Z: IF Z1(Y) < = 0 THEN 26480 26420 VTAB (5 + W8): HTAB (4): PRINT Z$(Y);: HTAB (23): PRINT Z1(Y)"%":W8 = W8 + 1 26480 NEXT Z: RETURN # draw selection frame 26500 REM 26510 HCOLOR= 5: VTAB (17): HTAB (9): PRINT VA$1VL$VN$;"NAME";: HTAB (21): PRINT "EFFCY": VTAB (21): PRINT "ENTER NAME (RETURN TO END)";: VTAB (19): HTAB (2): PRINT VI$VK$"L";: PRINT VN$VL$;: HPLOT 13,124 TO 191,124: HPLOT 13,135 TO 191,135: HPLOT 13,161 TO 191,161: HPLOT 145,124 TO 145,161: HPLOT 11,124 TO 11,161: HPLOT 191,124 TO 191,161: RETURN ### sort by efficiency (Z1(n)); leaves W8 set to (number of crew + 1) 26700 REM 26710 Z2 = 32 26720 Z2 = INT ((Z2 - 1) / 2): IF Z2 = 0 THEN 26790 26730 POKE 2048,Z2 + 50: POKE 2049,20: CALL 2050:Z3 = 30 - Z2: FOR Z5 = 1 TO Z3:Z4 = Z5 26770 Z7 = Z4 + Z2: IF Z1(Z7) < = Z1(Z4) THEN 26780 # swap Z(Z4) with Z(Z7) through Z 26775 Z = Z(Z4):Z(Z4) = Z(Z7):Z(Z7) = Z # swap Z1(Z4) with Z1(Z7) through Z :Z = Z1(Z4):Z1(Z4) = Z1(Z7):Z1(Z7) = Z # swap Z$(Z4) with Z$(Z7) through Z$ :Z$ = Z$(Z4):Z$(Z4) = Z$(Z7):Z$(Z7) = Z$ :Z4 = Z4 - Z2: IF Z4 > 0 THEN 26770 26780 NEXT Z5: GOTO 26720 # set W8 to crew count+1 26790 REM 26800 FOR Z = 1 TO 30: IF Z1(Z) < = 0 THEN W8 = Z: GOTO 26830 26820 NEXT Z:W8 = 31 26830 RETURN 27300 REM 27305 Z$(W8) = "RETURN":Z1(W8) = 0:Z$(W8 + 1) = "":Z1(W8 + 1) = - 1:Z1(0) = - 1: IF Y2 < PL THEN Z$(W8) = "":Z1(W8) = - 1:W8 = W8 - 1 27310 Z1 = 220 / W8: PRINT VN$;:Z5 = 99 27330 Z2 = INT ( PDL (0) / Z1 + .5): IF Z2 < 1 THEN Z2 = 1 27340 IF Z2 > W8 THEN Z2 = W8 27342 Z0 = 0: IF PEEK ( - 16287) > 127 THEN Z0 = 1: GOTO 27346 27345 IF Z2 = Z5 THEN 27330 27346 Z9 = - 1: IF Z2 < Z5 THEN Z9 = 1 27347 Z5 = Z2: VTAB (19 - Z9): GOSUB 27500: HTAB (3): IF Z1(Z2 - Z9) > = 0 THEN PRINT Z$(Z2 - Z9);: HTAB (22): IF Z1(Z2 - Z9) > 0 THEN PRINT Z1(Z2 - Z9)"%"; 27370 VTAB (19): PRINT VI$;: GOSUB 27500: HTAB (3): PRINT Z$(Z2);: HTAB (22): IF Z1(Z2) > 0 THEN PRINT Z1(Z2)"%"; 27385 PRINT VN$;: VTAB (Z9 + 19): GOSUB 27500: HTAB (3): IF Z1(Z2 + Z9) > = 0 THEN PRINT Z$(Z2 + Z9);: HTAB (22): IF Z1(Z2 + Z9) > 0 THEN PRINT Z1(Z2 + Z9)"%"; 27395 IF Z0 = 0 THEN GOTO 27330 27396 GOSUB 45000: RETURN 27500 HTAB (3): PRINT " ";: HTAB (22): PRINT " ";: RETURN ### reassign the crew in station W2 27600 REM # reset crew efficiency thingy 27603 CO(W2,3) = 0 # set nav duty team to zero?? (bug) :DT(3) = 0 # load crew names into Z$(n), index into Z(n), efficiency into Z1(n) : GOSUB 26000 # sort : GOSUB 26700 # set W9 to number of crew in set :W9 = W8 - 1 # loop over first two teams, populate # set duty teams for weapons and engineering to zero?? (bug) : FOR Y1 = 1 TO 2:CO(W2,Y1) = 0:W1 = 0:DT(Y1) = 0:W3 = Y1 # draw roster : GOSUB 26100 # draw selection frame : GOSUB 26500 # Z is number of spots left to fill :Z = (4 - Y1) * 10 : IF W9 > = Z THEN PL = 11: GOTO 27670 # few crew left 27650 PL = W9 - Z + 11: IF PL < 0 THEN PL = 0 27670 FOR Y2 = 1 TO 10:W8 = W9 + 1: GOSUB 37000: PRINT VN$VA$1VL$"CREW LEFT TO ASSIGN:";W9" ";: GOSUB 36000: GOSUB 27300: IF Z2 = W8 AND Y2 > = PL THEN 27780 27690 W1 = W1 + 1:Y = 7728 + W2 * 60 + W1 * 2 + (Y1 - 1) * 20: POKE Y,Z1(Z2) + 100: POKE Y + 1,Z(Z2): VTAB (5 + W1): HTAB (4): PRINT VA$1VN$VL$Z$(Z2);: HTAB (23): PRINT Z1(Z2)"%":Z$ = Z$(Z2):W3 = Y1: GOSUB 28000: IF Z2 = W8 THEN 27760 27750 FOR Z = Z2 TO W8:Z$(Z) = Z$(Z + 1):Z1(Z) = Z1(Z + 1):Z(Z) = Z(Z + 1): NEXT Z 27760 Z1(W9) = - 1:W9 = W9 - 1:W8 = W8 - 1: NEXT Y2:CM(W2,Y1) = 10: GOTO 27820 27780 FOR Z = Y2 TO 10:Y = 7728 + W2 * 60 + Z * 2 + (Y1 - 1) * 20: POKE Y,0: NEXT Z 27820 CM(W2,Y1) = W1: NEXT Y1: FOR Z = 1 TO 10:Y = 7768 + Z * 2 + W2 * 60: IF Z > W9 THEN Z1(Z) = - 1 27860 POKE Y,Z1(Z) + 100: POKE Y + 1,Z(Z): NEXT Z:CM(W2,3) = W9: GOSUB 39000: GOSUB 36000: IF W9 < = 0 THEN 27990 27908 W3 = 3: GOSUB 26100: FOR Z = 1 TO W9: VTAB (5 + Z): HTAB (4): PRINT VA$1VN$VL$Z$(Z);: HTAB (23): PRINT Z1(Z)"%":Z$ = Z$(Z) # update CO(W2,W3) : GOSUB 28000: NEXT Z # recompute CE(W2,W3) 27990 GOSUB 25000: RETURN ### update CO(W2,W3) based on rank of person added to team 28000 Z1$ = LEFT$ (Z$,3):Z6 = 0: IF Z1$ = "CR " THEN Z6 = 3 28010 IF Z1$ = "ENS" THEN Z6 = 4 28020 IF Z1$ = "LT." THEN Z6 = 5 28025 IF Z1$ = "LT " THEN Z6 = 6 28030 IF Z1$ = "CMD" THEN Z6 = 7 28040 CO(W2,W3) = CO(W2,W3) + Z6: RETURN ### change/organiz. 29000 REM 29005 EN(12) = EN(12) - 10:AL(12) = AL(12) - 10 29010 Z$(1) = "DUTY ":Z$(2) = "STBY ":Z$(3) = "SLEEP": GOSUB 20000:Z(1) = 17:Z(2) = 18:Z(3) = 19:Y = 30:Z1(1) = 5:Z1(2) = 13:Z1(3) = 21: FOR Z4 = 1 TO 3: GOSUB 39000: PRINT VA$1VL$VN$"ENTER "Z$(Z4)" TEAM";:Z = 3: GOSUB 41000:CT(W2,X) = Z4:Z(X) = - Z(X): GOSUB 36000: VTAB (18): HTAB (Z1(X)): PRINT VA$4VK$Z$(Z4);: NEXT Z4: RETURN ### set window to (2,2) - (28,21) 36000 PRINT VN$VY$;: VTAB (21): HTAB (28): PRINT VW$;: VTAB (2): HTAB (2): PRINT VV$;: RETURN ### set window to (2,23) - (28,23) 37000 PRINT VN$VY$;: VTAB (23): HTAB (28): PRINT VW$;: VTAB (23): HTAB (2): PRINT VV$;: RETURN ### set window to (2,2) - (28,21) and clear screen 38000 GOSUB 36000: PRINT VP$;: RETURN ### set window to (2,23) - (28,23) and clear screen 39000 GOSUB 37000: PRINT VP$;: RETURN ### read value from paddle 40000 REM 40005 Z1$ = "": PRINT VY$;VA$1;VL$;VN$;:R = PU - PL:RC = PL + R / 2 40020 GOSUB 40100 40025 VTAB (23): HTAB (30): PRINT VA$1VI$;VK$;"Y";: HTAB (36): PRINT "X";VN$:X = 135: GOSUB 40100:RT = 1:R1 = 0:Z1 = 0 40040 X = PDL (0): IF PEEK ( - 16287) > 127 THEN 40080 40045 IF ZT > 5 THEN ZT = 5 40050 IF X > 20 AND X < 200 THEN R1 = 0:ZT = 0: HTAB (31): VTAB (22): PRINT VA$1VK$"L";: GOTO 40040 40055 Z1$ = "J":R = - 1: IF X > 199 THEN R = 1:Z1$ = "K" 40060 IF R < > R1 THEN ZT = 0 40065 R1 = R:RC = RC + RT * 2 ^ ZT * R:ZT = ZT + 1: GOSUB 40100: GOTO 40040 40080 PRINT VA$1;: VTAB (23): HTAB (30): PRINT VK$VI$"X";: HTAB (36): PRINT "Y";: POKE 2048,50: POKE 2049,30: CALL 2050: POKE 2048,60: POKE 2049,50: CALL 2050: VTAB (22): HTAB (31): PRINT VN$" ";: PRINT VA$4;: RETURN 40100 REM 40105 IF RC > PU THEN RC = PU 40107 IF RC < PL THEN RC = PL 40109 RC = INT (RC) 40110 IF X2 = RC THEN 40190 40112 X2 = RC:Z1 = RC:Z1 = FN RD(Z1): HTAB (31): VTAB (22): PRINT VA$;1;VK$;Z1$;" ";VL$;Z1;:Y3 = LEN ( STR$ (Z1)): IF Y3 > 6 THEN 40190 40124 Z = 6 - Y3: FOR Y2 = 1 TO Z: PRINT " ";: NEXT Y2:Z9 = 30: IF C THEN Z9 = 10 40125 POKE 2048,(PU - RC) / (ZT + 1) + 75: POKE 2049,Z9: CALL 2050: IF C = 1 THEN GOSUB 24900 40190 RETURN ### select item from menu 41000 PRINT VY$VA$1VK$VI$;:Z1$ = "J":Y3 = - 1: FOR Z2 = 1 TO Z: IF Z(Z2) > 0 AND Y3 > 0 THEN X1 = Z2: GOTO 41030 41010 IF Z(Z2) > 0 THEN Y3 = Z2 41020 NEXT Z2:X1 = Y3: GOTO 41180 41030 Z1 = 250 / Z: FOR Z2 = 1 TO Z: HTAB (Y + 1): VTAB ( ABS (Z(Z2))): PRINT "E";: NEXT Z2 41079 X = INT ( PDL (0) / Z1 + .5): IF X > Z THEN X = Z 41080 IF X < 1 THEN X = 1 41081 IF Z2 > 20 THEN HTAB (Y): VTAB ( ABS (Z(X1))): PRINT " ";: POKE 2048,X1 * 5 + 50: POKE 2049,15: CALL 2050:Z2 = 0: HTAB (Y): PRINT "L"; 41082 Z2 = Z2 + 1: IF X < 1 THEN X = 1 41085 IF PEEK ( - 16287) > 127 THEN 41180 41090 IF Z(X) < 1 THEN GOTO 41079 41100 IF X1 < > X THEN HTAB (Y): VTAB (Z(X1)): PRINT " "; 41105 X1 = X: HTAB (Y): VTAB (Z(X)): PRINT "L";: GOTO 41079 41180 IF X1 < 1 THEN 41185 41183 HTAB (Y): VTAB (Z(X1)): PRINT " F"; 41185 GOSUB 45000:X = X1: RETURN 43005 X2 = X2 + 1: IF X2 > 15 THEN VTAB (23): HTAB (6): PRINT VA$(1);VK$;"L";: HTAB (22): PRINT "M";:X2 = 0: POKE 2048,100: POKE 2049,30: CALL 2050 43010 IF X2 = 7 THEN VTAB (23): HTAB (6): PRINT " ";: HTAB (22): PRINT " "; 43020 IF PEEK ( - 16287) < 128 THEN 43005 43030 GOSUB 38000: GOSUB 45000: RETURN ### chirp 45000 POKE 2048,30: POKE 2049,30: CALL 2050: POKE 2048,80: POKE 2049,50: CALL 2050: RETURN ### select team number (1-3), return in W3 46000 REM 46003 GOSUB 39000: PRINT VA$1VL$VN$"ENTER TEAM #";:Z(1) = 17:Z(2) = 18:Z(3) = 19:Z = 3:Y = 30: GOSUB 41000:W3 = X: RETURN ### select station 1-4 (weapons, engines, navigation, defense), return in W2 47000 REM 47003 GOSUB 39000: PRINT VA$1VL$VN$"ENTER STATION";: FOR Z = 1 TO 4:Z(Z) = 11 + Z: NEXT Z:Z = 4:Y = 30: GOSUB 41000:W2 = X: RETURN