SHARE
TWEET

SHPSYS.DO for NEC 8201A

D10d3 Apr 6th, 2020 1,352 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 10  REM SHIP SYSTEM MANAGER BY D10D3 2020
  2. 20  SCREEN 0,0:CLS:LOCATE 10,3:PRINT"INITIALIZING";
  3. 30  GOSUB 1590 'LOAD SYSTEM ARRAY
  4. 40  LCHK = PEEK(64082!)'REM CHECK LINE
  5. 50  IF LCHK=187 THEN GOTO 90
  6. 60  CLEAR256,62138!
  7. 70  FORX=62139!TO62335!:READA:POKEX,A:NEXTX
  8. 80  POKE 64082!,187:POKE 64083!,242
  9. 90  'FILL CARGO ARRAY  
  10. 100 OPEN "CARGO.DO" FOR INPUT AS #1
  11. 110 DIM CN$(30)
  12. 120 DIM CT%(30)
  13. 130 DIM CC%(30)
  14. 160 FOR I=1TO30
  15. 180 IF NOT EOF(1) THEN INPUT#1,A$ ELSE GOTO 500
  16. 190 CN$(I)=A$
  17. 191 IF NOT EOF(1) THEN INPUT#1,A$ ELSE GOTO 500
  18. 192 CT%(I)=VAL(A$)
  19. 193 IF NOT EOF(1) THEN INPUT#1,A$ ELSE GOTO 500
  20. 194 CC%(I)=VAL(A$)
  21. 210 NEXT I
  22. 220 CLOSE #1
  23. 230 FUEL% = CT%(1)
  24. 500  '*** MAIN MENU   ***
  25. 510  CLS
  26. 520  LINE (111,2)-(118,31),1,B
  27. 530  LINE (118,11)-(209,11)
  28. 540  LINE (209,2)-(216,31),1,B
  29. 550  LINE (118,24)-(133,33)
  30. 560  LINE (209,24)-(194,33)
  31. 570  LINE (133,33)-(150,51)
  32. 580  LINE (194,33)-(177,51)
  33. 590  LINE (148,11)-(148,49)
  34. 600  LINE (178,11)-(178,49)
  35. 610  LINE (150,51)-(157,51)
  36. 620  LINE (177,51)-(170,51)
  37. 630  LINE (157,51)-(159,54)
  38. 640  LINE (170,51)-(168,54)
  39. 650  LINE (159,7)-(168,62),1,B
  40. 660  LINE (133,11)-(133,33)
  41. 670  LINE (194,11)-(194,33)
  42. 680  LINE (161,52)-(166,58),1,B
  43. 690  LINE (159,22)-(168,31),1,B
  44. 700 LOCATE 0,0:PRINT"SYSTEMS ONLINE"
  45. 710 LOCATE 0,4:PRINT"N: NAVIGATION";
  46. 720 LOCATE 0,5:PRINT"C: CARGO MANAGER";
  47. 730 LOCATE 0,6:PRINT"Q: QUIT";
  48. 740 I$=INPUT$(1)
  49. 750 IF I$="N" THEN GOTO 1080
  50. 760 IF I$="C" THEN GOTO 2000
  51. 770 IF I$="Q" THEN GOTO 11000
  52. 780 GOTO 500
  53. 1080 ' ***   NAVIGATION SYSTEM   ***
  54. 1090 S$ = "A"
  55. 1100 GOSUB 1320 :REM SYSTEM LIST S$
  56. 1110 PRINT"A(SHOW A-L) M(SHOW M-Z) #(SELECTION)"
  57. 1120 INPUT"ENTER ORIGIN";B$
  58. 1130 GOSUB 1930 :REM SOUND
  59. 1140 IF B$ = "A" THEN S$ = "A"
  60. 1150 IF B$ = "M" THEN S$ = "M"
  61. 1160 IF B$ = "A" OR B$ = "M" THEN GOTO 1100
  62. 1170 ELSE
  63. 1180 GOSUB 1540 :REM SYSTEM COORDS
  64. 1190 OX=IX:OY=IY:OZ=IZ
  65. 1200 S$ = "A"
  66. 1210 GOSUB 1320 :REM SYSTEM LIST S$
  67. 1220 PRINT"A(SHOW A-L) M(SHOW M-Z) #(SELECTION)"
  68. 1230 INPUT"ENTER DESTINATION";B$
  69. 1240 GOSUB 1930 :REM SOUND
  70. 1250 IF B$ = "A" THEN S$ = "A"
  71. 1260 IF B$ = "M" THEN S$ = "M"
  72. 1270 IF B$ = "A" OR B$ = "M" THEN GOTO 1210
  73. 1280 ELSE
  74. 1290 GOSUB 1540 :REM SYSTEM COORDS
  75. 1300 DX=IX:DY=IY:DZ=IZ
  76. 1310 GOTO 1680 :REM TRAVEL CALC
  77. 1320 REM SYSTEM LIST S$
  78. 1330 IF S$ = "A" THEN GOSUB 1360
  79. 1340 IF S$ = "M" THEN GOSUB 1450
  80. 1350 RETURN
  81. 1360 PRINT  CHR$(12)
  82. 1370 LOCATE 0,0
  83. 1380 PRINT"1.Abbadon    7.Chelsea    13.Lungold"
  84. 1390 PRINT"2.Achamandra 8.Colossus"
  85. 1400 PRINT"3.Avatar     9.Cornwall"
  86. 1410 PRINT"4.Azrael     10.Enlas-Dhu"
  87. 1420 PRINT"5.Beehive    11.Estremerine"
  88. 1430 PRINT"6.Cenotaph   12.Fiobrachne"
  89. 1440 RETURN
  90. 1450 PRINT  CHR$(12)
  91. 1460 LOCATE 0,0
  92. 1470 PRINT"14.Medusa         20.Shiva"
  93. 1480 PRINT"15.Monolith       21.Sunrise"
  94. 1490 PRINT"16.Moonjam        22.Tara"
  95. 1500 PRINT"17.Phoenix Nebula 23.Timos"
  96. 1510 PRINT"18.Rhad           24.Videga"
  97. 1520 PRINT"19.Sheol          25.Winterjewel"
  98. 1530 RETURN
  99. 1540 REM SYSTEM COORDS
  100. 1550 IX=SYSTEMS%(VAL(B$),1)
  101. 1560 IY=SYSTEMS%(VAL(B$),2)
  102. 1570 IZ=SYSTEMS%(VAL(B$),3)
  103. 1580 RETURN
  104. 1590 REM LOAD SYSTEM ARRAY
  105. 1600 DIM SYSTEMS%(25,3)
  106. 1610 FOR I=1 TO 25:
  107. 1620 FOR J=1 TO 3
  108. 1630 READ D
  109. 1640 SYSTEMS%(I,J)=D
  110. 1650 NEXT J
  111. 1660 NEXT I
  112. 1670 RETURN
  113. 1680 REM TRAVEL CALC
  114. 1690 DIST = SQR(ABS(OX-DX)^2 + ABS(OY-DY)^2 + ABS(OZ-DZ)^2 )
  115. 1700 GOSUB 1800 :REM DISPLAY MAP
  116. 1710 A$ = "##.#"
  117. 1720 LOCATE 20,0:PRINT"DISTANCE:";
  118. 1730 PRINT USING A$; DIST;
  119. 1740 LOCATE 20,1:PRINT"DAYS:";:PRINT USING A$; DIST;
  120. 1750 GOSUB 1930 :REM Sound
  121. 1760 LOCATE 20,2:PRINT"FUEL USED:";:PRINT USING A$; DIST*2;
  122. 1762 LOCATE 20,4:PRINT"Execute Flight";:LOCATE 20,5:INPUT"Plan?(Y/N)";B$
  123. 1764 IF B$="Y" THEN GOSUB 2510
  124. 1770 LOCATE 20,5:INPUT"ANOTHER(Y/N)  ";B$
  125. 1780 IF B$="Y" THEN GOTO 1080
  126. 1790 GOTO 500 :REM END
  127. 1800 REM DISPLAY MAP
  128. 1810 PRINT CHR$(12)
  129. 1820 LINE(0,0)-(81,0)
  130. 1830 LINE(0,63)-(81,63)
  131. 1840 LINE(0,0)-(0,63)
  132. 1850 LINE(81,0)-(81,63)
  133. 1860 FOR I = 1 TO 25
  134. 1870 PSET(SYSTEMS%(I,1)*2,SYSTEMS%(I,2)*2)
  135. 1880 NEXT I
  136. 1890 P1=OX*2:P2=OY*2
  137. 1900 P3=DX*2:P4=DY*2
  138. 1910 LINE(P1,P2)-(P3,P4)
  139. 1920 RETURN
  140. 1930 REM SOUND
  141. 1940 FOR I=1TO4
  142. 1950 P=900+(RND(1)*10000)
  143. 1960 T=5
  144. 1970 SOUND P,T
  145. 1980 NEXT I
  146. 1990 RETURN
  147. 2000 '***  CARGO MANAGER   ***
  148. 2160 PG=1:RW=7:SE=1 'PAGE,ROW,SELECT
  149. 2170 L=1:NS=1 'LINE,NEW SCREEN
  150. 2180 'MAIN LOOP
  151. 2190 IF NS=0 THEN GOTO 2290
  152. 2200 CLS
  153. 2210 LOCATE 0,0:PRINT"NAME                          TON   COST"
  154. 2220 FOR I=PG TO PG+5
  155. 2230 LOCATE 1,L:PRINT CN$(I);:
  156. 2240 LOCATE 30,L:PRINT CT%(I);
  157. 2250 LOCATE 35,L:PRINT CC%(I);
  158. 2260 L=L+1:IF L>6 THEN L=1
  159. 2270 NEXT I
  160. 2280 LOCATE 0,7:PRINT"SELECT:U/D PAGE:L/R EDIT:ENT QUIT:ESC";
  161. 2290 LINE (0,0+RW)-(175,8+RW),1,B
  162. 2300 I$=INPUT$(1)
  163. 2310 LINE (0,0+RW)-(175,8+RW),C,B
  164. 2320 IF I$=CHR$(27) OR I$="Q" OR I$="q" THEN GOTO 2500'ESCAPE
  165. 2330 IF I$=CHR$(28) THEN PG=PG+6:SE=SE+6:NS=1'RIGHT
  166. 2340 IF I$=CHR$(29) THEN PG=PG-6:SE=SE-6:NS=1'LEFT
  167. 2350 IF I$=CHR$(30) THEN RW=RW-8:NS=0:SE=SE-1'UP
  168. 2360 IF I$=CHR$(31) THEN RW=RW+8:NS=0:SE=SE+1'DOWN
  169. 2370 'IF I$=CHR$(32) THEN 'SPACE
  170. 2380 IF I$<>CHR$(13) THEN GOTO 2430'ENTER
  171. 2390 NS=1: IF SE=1 THEN GOTO 2410
  172. 2400 GOSUB 2480:INPUT"NAME";A$:CN$(SE)=A$
  173. 2410 GOSUB 2480:INPUT"TONS:";A$:CT%(SE)=VAL(A$):FUEL%=VAL(A$)
  174. 2420 GOSUB 2480:INPUT"COST:";A$:CC%(SE)=VAL(A$)
  175. 2430 IF SE>30 THEN SE=30!SLE IF SE<1 THE SE=1
  176. 2440 IF PG>25 THEN PG=25 ELSE IF PG<1 THEN PG=1
  177. 2450 IF RW>47 THEN RW=47 ELSE IF RW<7 THEN RW=7
  178. 2460 IF SE>PG+5 THEN SE=PG+5
  179. 2470 GOTO 2180
  180. 2480 LOCATE 0,7:PRINT"                                     ";
  181. 2490 LOCATE 0,7:RETURN
  182. 2500 GOTO 500
  183. 2510 IF DIST*2 > FUEL% THEN LOCATE 20,4:PRINT"INSUFFICIENT FUEL";:LOCATE 20,5:INPUT"<PRESS A KEY>";B$
  184. 2520 IF DIST*2 < FUEL% THEN FUEL% = FUEL% - (DIST*2):CT%(1)=FUEL%
  185. 2530 RETURN
  186. 10000 REM SYSTEM COORDS
  187. 10010 DATA 21,20,17,13,18,10,15,24,15,12,5,8
  188. 10020 DATA 19,4,8,36,17,7,15,27,12,5,17,13
  189. 10030 DATA 4,25,6,32,15,11,22,6,10,21,1,14
  190. 10040 DATA 7,19,7,8,14,12,20,16,10,19,12,13
  191. 10050 DATA 24,17,20,18,20,13,5,4,6,20,29,9
  192. 10060 DATA 7,11,10,29,11,13,24,22,9,21,15,16,26,13,15
  193. 10070 REM LINE ROUTINE DATA
  194. 10080 DATA 193,254,244,235,42,250,243,235,196,118
  195. 10090 DATA 31,213,207,244,205,118,31,213,17,208
  196. 10100 DATA 116,202,234,242,213,207,44,254,44,209
  197. 10110 DATA 202,232,242,213,205,227,19,209,15,218
  198. 10120 DATA 232,242,17,209,116,43,215,235,34,102
  199. 10130 DATA 243,235,202,40,243,207,44,207,66,202
  200. 10140 DATA 18,243,207,70,209,227,123,149,210,5
  201. 10150 DATA 243,47,60,107,71,4,93,205,47,243
  202. 10160 DATA 44,5,194,7,243,225,201,209,227,213
  203. 10170 DATA 93,205,47,243,209,213,84,205,47,243
  204. 10180 DATA 209,229,98,205,47,243,225,107,1,209
  205. 10190 DATA 227,205,47,243,225,201,229,213,197,125
  206. 10200 DATA 147,210,58,243,235,47,60,71,14,20
  207. 10210 DATA 124,146,210,69,243,47,60,12,184,218
  208. 10220 DATA 80,243,103,104,62,28,195,85,243,111
  209. 10230 DATA 96,121,14,28,50,120,243,121,50,107
  210. 10240 DATA 243,68,4,124,167,31,79,229,213,197
  211. 10250 DATA 205,209,116,193,209,225,20,121,133,79
  212. 10260 DATA 218,118,243,188,218,121,243,148,79,28
  213. 10270 DATA 5,194,98,243,195,94,25
  214. 11000 CLS
  215. 11010 INPUT "SAVE? (Y/N)";A$
  216. 11020 IF A$<>"Y" AND A$<>"y" THEN GOTO 11110
  217. 11030 PRINT "SAVING..."
  218. 11040 OPEN "CARGO.DO" FOR OUTPUT AS #1
  219. 11050 FOR I=1TO30
  220. 11060 PRINT#1,CN$(I)
  221. 11070 PRINT#1,CT%(I)
  222. 11080 PRINT#1,CC%(I)
  223. 11090 NEXT I
  224. 11100 CLOSE
  225. 11110 END
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top