home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 186
/
186.d81
/
harbour
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
15KB
|
410 lines
1 rem ***** harbour *****
5 dv=peek(186):ifdv<8thendv=8
40 sys57812"f.harbour",dv,0:poke780,0:poke781,0:poke782,8:sys65493
45 sys57812"toolbox117 c000",dv,0:poke780,0:poke781,0:poke782,192:sys65493
50 sys57812"getword 1000",dv,0:poke780,0:poke781,0:poke782,16:sys65493
60 clr:dv=peek(186):ifdv<8thendv=8
100 rem **** set variables *****
105 ad=49152:ag=4096:s=54272:poke53272,19:printchr$(14):printchr$(8)
110 a$="":at=0:b$="":bh$="":bd=0:bk=0:bl=0:c$="":cd%=0
115 ch=0:cs=0:ct=0:d=0:df$="":dl$="":dr=0:ds=0:el%=0:ev%=0
120 f%=0:fl%=250:fu%=0:ft%=250:gl%=0:gt=0:gw=1:hf=0:k=0
130 ms$="":nm$="":pc%=0
135 q=0:q$=chr$(34):qf=0:rn%=0:se%=0:ra%=0
140 sd%=0:sn%=0:p%=0:sz=0:ts%=0:tv%=0:us%=0:vt=250:vt%=0
145 v=0:w$="":x=0:y=0:z=0:zs=0:x$=""
150 dima$(24),gl$(99),l1%(48),l2%(48),md$(2,20),sd$(5),sp$(5),zl(5)
155 dimst%(48),ub%(48),el$(11),hl$(5),fl$(5)
160 fl$(1)=".ex":fl$(2)=".fc":fl$(3)=".ag":hl$(1)="[197]xpert":hl$(2)="[211]enior"
165 hl$(3)="[202]unior":hl$(4)="[203][195][194]":hl$(5)="[214][195]":fl$(4)=".kcb":fl$(5)=".vc"
170 sh$(1)="[217]our have been rewarded as a [203][195][194]."
175 sh$(2)="[217]ou have been awarded a [214][195]."
800 rem ***** startup *****
805 df$="ac.game":dr=dv:gosub5115:ifpr<>3then1005
810 open3,dv,3,"l:"+df$:input#3,nm$,x$,a$:ra%=val(a$):close3:gosub5740
815 print"":gosub7705:ifqf<>1thenx$="1"
820 ifx$="2"thenls%=ra%:gf=1:goto8505
1000 rem ***** administration *****
1005 print"[147]":bd=1:bk=1:ch=0:gosub5005:gf=0
1010 ms$="[156]*** [200][197][193][196][209][213][193][210][212][197][210][211] [207][208][212][201][207][206][211] ***[144]":v=2:gosub5210
1015 a$(4)="[193]. [210]egistration.":a$(9)="[198]. [210]eview [194]ridge [208]lot."
1020 a$(5)="[194]. [211]tart [206]ew [195]onvoy.":a$(6)="[195]. [195]ontinue [195]onvoy."
1025 a$(7)="[196]. [210]eview [200]all [207]f [198]ame.":a$(12)="[216]. [197]xit ([204]oadstar/[194][193][211][201][195])"
1030 a$(8)="[197]. [210]eview [200][207][212] [203]eys.":a$(10)="[199]. [210]eview [211]ailing [201]nstructions."
1035 a$(11)="[200]. [210]eview [193]ttack [201]nstructions."
1040 h=2:tl=4:bl=12:gosub5065:gosub5085:sysad+54,0,39,1,13,8
1045 ifnm$<>""thena=2:goto1555
1050 gosub5034:ms$="[211]elect [193] to [200], [216], or ^.":gosub5205:gosub6165
1055 zs=1:ch$="abcdghe^xf":sysad+48,ch$
1060 gosub5034:iff%=10thengosub1205:goto1050
1062 iff%=9thengosub5220:onqfgoto1050,5505
1065 iff%=8thengosub6105:goto1050
1070 iff%=7thenzs=2:gosub6105:zs=1:goto1050
1072 iff%=5orf%=6thena=f%-4:gosub6905:goto1050
1075 iff%>1andnm$=""thengosub5240:goto1050
1080 r=0:onf%goto1505,1085,1090,1095
1085 gosub5485:gosub1155:gosub7805:onqfgoto5515,1050
1090 gosub1155:gosub7705:onqfgoto5515,1050
1095 gosub1155:ms$="[204]oad [199][193][205][197] file? (y/n)":cs=2:q=0:gosub5300:ifqf=2then1115
1100 gosub7705:ifqf<>2andts%<>0then1115
1105 ifqf=2then1050
1110 ms$="[199]ame [201]ncomplete. [193]ny key.":cs=4:q=0:gosub5300:goto1050
1115 goto8505
1150 rem ***** select rating *****
1155 gosub5034:a$(16)="[215]hat is your rating:-"
1160 a$(17)="[193]. [197]xperienced [195]onvoy commander."
1165 a$(18)="[194]. [197]xperienced [195]apt. [198]irst [195]onvoy."
1170 a$(19)="[195]. [202]ust out of [206]aval [193]cademy."
1175 h=1:tl=16:bl=19:gosub5065:gosub5085:sysad+48,"abc"
1180 ra%=f%:tl=15:gosub5035:return
1200 rem ***** bridge screen *****
1205 ss=6:ss$="s":gosub5405:print"[147]":poke53280,0
1210 sysad+3,0,39,1,1,160,0
1215 sysad+3,0,39,20,20,160,0
1220 a$(2)=". [199][210][201][196] [205][193][208] [211][212][193][212][213][211]"
1225 a$(3)=". ======== ======"
1230 a$(4)=". [193][194][195][196][197][198][199][200][201][202]"
1235 a$(5)=". 1\\\\\\\\\\"
1240 a$(6)=". 2\\\\\\\\\\ [212]ransports ="
1245 a$(7)=". 3\\\\\\\\\\ [197]scorts ="
1250 a$(8)=". 4\\\\\\\\\\ [195]ourse ="
1255 a$(9)=". 5\\\\\\\\\\ [211]peed ="
1260 a$(10)=". 6\\\\\\\\\\ [211]low ships ="
1265 a$(11)=". 7\\\\\\\\\\ [213]boat kills ="
1270 a$(12)=". 8\\\\\\\\\\"
1275 a$(13)=". 9\\\\\\\\\\"
1280 a$(14)=".10\\\\\\\\\\"
1285 ms$="[204]ocation ([211]ector,[199]rid) and [198]uel data.":gosub5208
1290 h=1:forv=2to14:ms$=a$(v):gosub5070:next
1295 v=18:ms$="[198]8 = [200][209] problem report.":gosub5210
1300 v=21:ms$="[212]his area is command and info area.":gosub5210
1305 v=22:ms$="[201]nfo = storms, uboats, sinkings, etc.":gosub5210
1310 v=23:ms$="[193]ny key returns to menu":cs=4:gosub5300
1315 print"[147]":ss=6:ss$="r":gosub5405:return
1500 rem ***** registration *****
1505 gosub5610:a=1:gosub5031:ms$="[200]ave we met before?(y/n)":cs=1:v=15
1510 gosub5305:ifqf=2thena=2:goto1530
1515 ms$="[200]ello, and welcome to convoy [200].[209].":v=15:gosub5210
1520 ms$="[208]lease register for duty.":v=16:gosub5210
1530 ms$="([204]imit = 10 characters)":v=19:gosub5210
1535 v=18:gosub5045:ms$="[217]our name please:":h=1:gosub5070:gosub5610
1540 h=20:gosub5015:ll=10:gosub5705:tl=15:bl=16:gosub5035
1545 nm$=w$:ifnm$=""thengosub6985:goto1535
1550 a$(1)="[193] pleasure to meet you "+nm$+"."
1555 a$(2)="[215]elcome back "+nm$+"."
1560 tl=18:bl=19:gosub5035:ms$=a$(a):v=15:gosub5210
1565 goto1050
5000 rem ***** colour setup *****
5005 poke53280,bd:poke53281,bk:poke646,ch:return
5010 rem ***** cursor locate *****
5015 poke211,h:poke214,v:sys58732
5020 return
5025 rem ***** delete line(s) *****
5030 tl=13:bl=19:goto5035 :rem * hi score
5031 tl=14:bl=24:goto5035 :rem * administration
5034 tl=21:bl=24:goto5035 :rem * window4
5035 forv=tltobl:gosub5045:next:return
5040 v=0:goto5045 :rem * line0
5042 v=22:goto5045 :rem * line22
5043 v=23:goto5045 :rem * line23
5044 v=24:goto5045 :rem * line24
5045 poke781,v:sys59903
5046 return
5060 rem ***** print data/at *****
5065 forv=tltobl:ms$=a$(v):gosub5070:next:return
5070 sysad+15,h,v,ms$
5075 return
5080 rem ***** delete data *****
5085 forx=tltobl:a$(x)="":next:return
5100 rem ***** check disk *****
5105 d=1:goto5120 :rem - load
5110 d=2:goto5120 :rem - save
5115 d=3 :rem - check
5120 gosub5258:open15,dr,15,"r:"+df$+"="+df$:input#15,er,a$,a,a:close15
5130 gosub5043:ifer=62thenondgoto5145,5145,5170
5135 ifer=63thenondgoto5175,5150,5175
5140 ifd=3then5180
5145 ms$="":gosub5300:onqfgoto5120,5180,5180
5150 ms$="":gosub5300:onqfgoto5160,5180,5180
5160 gosub5735:onqfgoto5135,5180
5165 pr=1:return
5170 pr=2:return
5175 pr=3:return
5180 pr=4:return
5200 rem ***** centre print *****
5205 v=23:goto5210
5206 v=22:goto5210
5207 v=24:goto5210
5208 v=0
5210 gosub5045
5211 gosub5370:return
5215 ms$="[205]enu? (y/n)":cs=1:q=0:goto5300
5220 sz=zs:ms$="[193]re you sure you want to quit?(y/n)":cs=1:q=0:goto5300
5222 sz=zs:ms$="[196]ata unavailable. [193]ny key.":cs=4:q=0:goto5300
5225 sz=zs:ms$="[193]ny key when ready.":cs=4:q=0:goto5300
5230 return
5235 ms$="[195]hange disk now. [193]ny key.":cs=4:q=0:goto5300
5240 sz=zs:ms$="[198]unction/file not available. [193]ny key.":cs=4:zs=4:q=8:goto5300
5250 sz=zs:ms$="[195]ontinue?(y/n)":cs=2:q=0:goto5300
5255 sz=zs:ms$="[193]re you [210][197][193][204][204][217] sure?(y/n)":cs=2:q=0:goto5300
5258 ms$="[195][193][213][212][201][207][206] - drive activity":q=0:goto5205
5260 sz=zs:q=0:ifer=26thenms$="[215]rite protect on! [210]emoved?(y/n)":cs=2:goto5370
5280 ifer=62thenms$="[198]ile not found. [206]ew disk?(y/n)":cs=5:goto5370
5285 ifer=63thenms$="[198]ile exists. [210]eplace?(y/n)":cs=2:goto5370
5290 ifer=74thenms$="[196]rive unready. [195]orrected?(y/n)":cs=2:goto5370
5295 ms$="[205]ajor drive/disk error. [193]ny key.":cs=4:qf=3:goto5370
5300 gosub5043:zz=v:b$=ms$:goto5306
5305 zz=v:b$=ms$:gosub5045
5306 ifq=8thengosub5044:gosub6165
5307 v=zz:ms$=b$:gosub5365
5310 poke198,0:wait198,15:geta$
5315 sysad+24,a$
5320 gosub5044:ifa$="^"andq=8thengosub6105:goto5306
5321 q=0:ifa$="^"thengosub6985:goto5306
5323 zs=sz:ifcs=6anda$<>" "thengosub6985:goto5306
5325 ifcs=4orcs=6thena$="":v=zz:goto5045
5330 ifcs=3thenv=zz:goto5045
5335 qf=1:ifa$<>"y"anda$<>"n"thengosub6985:goto5306
5350 ifcs=2anda$="n"thenqf=2
5355 ifcs=1anda$="y"thenqf=2
5360 a$="":v=zz:goto5045
5365 ifms$=""then5260
5370 sysad+18,v,ms$
5375 return
5400 rem ***** screen stash *****
5405 onssgoto5410,5415,5420,5425,5430,5435,54