20 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):VA$ = CHR$ (129):VN$ = CHR$ (142):VI$ = CHR$ (137):VP$ = CHR$ (144):VY$ = CHR$ (153):VV$ = CHR$ (150):VW$ = CHR$ (151):VK$ = CHR$ (139):VL$ = CHR$ (140) 35 CX(6) = 1 40 DEF FN RF(X) = ((3700 - X) / 3700) ^ 2.86: SCALE= 1: ROT= 0: PRINT VA$0VY$VN$VK$:K$(1) = "DETAS":K$(2) = "MILAS":K$(3) = "KAMAS": GOSUB 50000: GOSUB 10000 9999 GOTO 9999 ### main UI loop 10000 FOR Z = 1 TO 4:Z(Z) = 2 + Z * 2: NEXT Z:Y = 32:Z = 4: FOR Z = 1 TO 3: IF K(Z) = 0 THEN Z(Z) = - Z(Z) 10008 NEXT Z: GOSUB 41000: IF X = 4 THEN GOTO 16000 10030 SH = X: GOSUB 21000: GOTO 10000 ### return to main menu 16000 REM 16005 FOR Z = 1 TO 4:K$(Z) = "": NEXT Z: FOR Z = 1 TO 9:Z1$(Z) = "":Z$(Z) = "": NEXT Z:Z$ = "":Z1$ = "": PRINT VA$0VN$VK$: PRINT VY$: PRINT CHR$ (4)"BLOAD CHAIN,A520": CALL 520"MAIN MENU" 16050 GOTO 16050 20000 HCOLOR= 6: FOR Z = 10 TO 80: HPLOT Z,14 TO Z,126: NEXT Z: RETURN ### display ship info for ship SH 21000 REM 21010 GOSUB 38000: PRINT : PRINT TAB( 12)VA$4VK$VN$"SHIP:"; TAB( 18);K$(SH): PRINT : PRINT TAB( 12)"TYPE:" TAB( 18);:Z$ = "DESTROYER": IF KT(SH) > 1 THEN Z$ = "CRUISER": IF KT(SH) = 3 THEN Z$ = "DREADNAUGHT" 21070 PRINT Z$: PRINT : PRINT TAB( 12);"MAX SPEED:" TAB( 24) INT (MS(SH) * 100) / 100: PRINT TAB( 12)"MAX POWER:" TAB( 24) FN RD(MK(SH,0)): PRINT TAB( 12)"CREW:" TAB( 24) FN RD(KC(SH)): PRINT : PRINT TAB( 12)"DISTANCE:" TAB( 24) FN RD(DK(SH)) 21110 PRINT TAB( 12)"HEADING:" TAB( 24) FN RD(KH(SH)): PRINT TAB( 12)"SPEED:" TAB( 24) INT (KW(SH) * 100) / 100: PRINT : PRINT TAB( 12)"SHIELD:" TAB( 24) FN RD(YS(SH)): PRINT TAB( 12)"OFF SHIELD: "; FN RD(XS(SH)) 21115 GOSUB 20000: ON KT(SH) GOSUB 25000,24000,23000: PRINT : PRINT VA$1VL$;: PRINT "SYST. MX PW POWER 0 "VA$2"2 4 6 8 0", 21300 GOSUB 39000: HCOLOR= 6: HPLOT 8,132 TO 209,132: HPLOT 8,143 TO 209,143: FOR Z = 1 TO 4: PRINT "SHLD"Z; TAB( 7) FN RD(MK(SH,Z)) TAB( 13) FN RD(KP(SH,Z)): NEXT Z: PRINT "TOTAL"; TAB( 7) FN RD(MK(SH,0)) TAB( 13) FN RD(KP(SH,0));: HCOLOR= 4 21400 FOR Z = 19 TO 22:Z1 = 8 * Z - 1: HPLOT 8,Z1 TO 209,Z1: NEXT Z: FOR Z = 136 TO 206 STEP 14: HPLOT Z,144 TO Z,183: NEXT Z: HCOLOR= 5: FOR Z = 1 TO 4:Z1 = 136 + 70 * KP(SH,Z) / MK(SH,Z):Z2 = 136 + Z * 8 21480 FOR Z3 = Z2 TO Z2 + 6: HPLOT 136,Z3 TO Z1,Z3: NEXT Z3: NEXT Z: HCOLOR= 6:Z1 = 136 + 70 * KP(SH,0) / MK(SH,0): FOR Z3 = 176 TO 183: HPLOT 136,Z3 TO Z1,Z3: NEXT Z3: RETURN ### draw dreadnought 23000 REM 23005 HCOLOR= 4: HPLOT 46,16 TO 34,16 TO 34,24 TO 30,24 TO 30,32 TO 34,32 TO 38,36 TO 42,36 TO 46,32 TO 50,32 TO 50,24 TO 46,24 TO 46,16: HPLOT 38,36 TO 38,80 TO 42,80 TO 42,36: HPLOT 38,72 TO 26,72 TO 26,120 TO 54,120 TO 54,72 TO 42,72 23030 HPLOT 22,84 TO 22,116 TO 58,116 TO 58,84 TO 22,84: HPLOT 22,100 TO 16,100 TO 16,116 TO 22,116: HPLOT 58,100 TO 64,100 TO 64,116 TO 58,116: HPLOT 26,100 TO 54,100: HPLOT 34,72 TO 34,80: HPLOT 46,72 TO 46,80: HPLOT 30,84 TO 30,80 TO 50,80 TO 50,84: HPLOT 16,100 TO 16,72 TO 18,72 TO 18,100 23110 HPLOT 64,100 TO 64,72 TO 62,72 TO 62,100: HPLOT 26,84 TO 30,100: HPLOT 54,84 TO 50,100: RETURN ### draw cruiser 24000 REM 24010 HCOLOR= 4: HPLOT 42,38 TO 38,38 TO 38,24 TO 42,24 TO 42,16 TO 46,16 TO 46,24 TO 50,24 TO 50,38 TO 46,38: HPLOT 42,34 TO 42,68 TO 22,76 TO 18,76 TO 18,104 TO 26,104 TO 26,100: HPLOT 42,34 TO 46,34 TO 46,68 TO 66,76 TO 70,76 TO 70,104 TO 62,104 TO 62,100 24050 HPLOT 22,76 TO 22,100 TO 38,100: HPLOT 66,76 TO 66,100 TO 50,100: HPLOT 38,84 TO 38,104 TO 50,104 TO 50,84 TO 38,84: HPLOT 42,48 TO 38,48 TO 38,68: HPLOT 46,48 TO 50,48 TO 50,68: HPLOT 22,96 TO 38,92: HPLOT 50,92 TO 66,96: HPLOT 22,96 TO 38,96: HPLOT 50,96 TO 66,96 24190 RETURN ### draw destroyer 25000 REM 25010 HCOLOR= 4: HPLOT 32,20 TO 32,32 TO 44,32 TO 44,20 TO 32,20: HPLOT 36,88 TO 36,24 TO 40,24 TO 40,88: HPLOT 36,60 TO 16,80 TO 16,100 TO 32,100: HPLOT 40,60 TO 60,80 TO 60,100 TO 44,100: HPLOT 32,88 TO 32,108 TO 44,108 TO 44,88 TO 32,88: HPLOT 36,52 TO 24,52 TO 24,72: HPLOT 40,52 TO 52,52 TO 52,72 25100 HPLOT 16,92 TO 32,92: HPLOT 44,92 TO 60,92: HPLOT 28,80 TO 28,84 TO 20,84 TO 20,80 TO 20,92: HPLOT 48,80 TO 48,84 TO 56,84 TO 56,80 TO 56,92: RETURN ### set window to (2,2) - (30,23) 36000 PRINT VY$;: VTAB (23): HTAB (30): PRINT VW$;: VTAB (2): HTAB (2): PRINT VV$;: RETURN ### set window to (2,2) - (30,23) and clear it 38000 GOSUB 36000: PRINT VN$VP$;: RETURN ### set window to (2,19) - (30,23) and clear it 39000 PRINT VY$VA$4VK$;VI$;: VTAB (23): HTAB (30): PRINT VW$;: VTAB (19): HTAB (2): PRINT VV$VP$;: RETURN ### select menu item 41000 REM 41006 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 41016 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 ### chirp 45000 POKE 2048,30: POKE 2049,30: CALL 2050: POKE 2048,80: POKE 2049,50: CALL 2050: RETURN 47000 Z = LEN (Z1$):Z$ = Z1$: IF Z < 23 THEN GOSUB 47100: GOTO 47095 47010 FOR Z1 = 22 TO 1 STEP - 1:Z2 = ASC ( MID$ (Z1$,Z1,1)): IF Z2 = 32 THEN Z$ = LEFT$ (Z1$,Z1):Z1$ = RIGHT$ (Z1$,Z - Z1): GOSUB 47100: GOTO 47080 47040 NEXT Z1:Z$ = LEFT$ (Z1$,22):Z1$ = RIGHT$ (Z1$,Z - 22): GOSUB 47100 47080 GOTO 47000 47095 RETURN 47100 Z = LEN (Z$): PRINT VA$4VK$VI$;: FOR Z1 = 1 TO Z: PRINT MID$ (Z$,Z1,1);: POKE 2048,100: POKE 2049,15: CALL 2050: NEXT Z1: PRINT : RETURN ### draw frame 50000 POKE 2072,170: POKE 2073,213: CALL 2074:Z$ = VA$ + "1" + VK$ + VI$ + " E" + VA$ + "4":Z1$ = VI$ + " " 50001 PRINT VY$;: VTAB (1): HTAB (32): PRINT VV$;: VTAB (24): HTAB (8): PRINT VW$;: VTAB (2): HTAB (1): PRINT VA$3VK$;" SCAN ";: PRINT VA$4Z1$; 50040 PRINT Z$"DETAS ";: PRINT Z1$Z$"MILAS ";: PRINT Z1$Z$"KAMAS ";: PRINT Z1$Z$"RETURN";: PRINT VY$;: HTAB (12): VTAB (1): PRINT VA$3VK$VI$;"SCIENCE"VA$4;: GOSUB 38000: RETURN