home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 170 / 170.d81 / developer (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  11KB  |  294 lines

  1. 8 poke56,159
  2. 10 goto1000
  3. 20 poke53281,15:poke53280,15:print"[147]";:poke2,1:clr:run22
  4. 22 dimt$(2),ob$(64,16),iv(64,16),ip(16),aa$(32),al(32),rm$(96):a$=a$:el=7
  5. 23 debug=-1:p=fre(0):if(debug)thenprint"<[196]ebug mode on!"
  6. 25 dv=peek(186):ifdv<8thendv=8
  7. 29 fl=0:cl=6:sys57812"33c.ia.o",dv,1:sys62631:if(peek(828)=0)thenpoke43,1:end
  8. 30 open15,dv,15,"r0:config.parse=config.parse":input#15,en:close15
  9. 40 ifen<>63thenprint"[195]an't find config file.":poke43,1:goto1000
  10. 42 print"[144][147][212]he story is loading ...":bf$="":t$(1)="":t$(2)=""
  11. 50 open1,dv,2,"config.parse":sys828,1,80:t$(1)=a$+"":sys828,1,80:t$(2)=a$+""
  12. 60 sys828,1,80:bf$=a$+"":input#1,md:close1:tj=0:tr=0
  13. 70 z$=bf$+".obj"+right$("0"+mid$(str$(tj+1),2),2):open15,dv,15,"r0:"+z$+"="+z$
  14. 80 input#15,en:close15:ifen<>63goto130
  15. 90 open1,dv,2,z$:l=1
  16. 100 sys828,1,80:ob$(l,tj+1)=a$+"":if(st=0)thenl=l+1:goto100
  17. 110 ob$(l+1,tj+1)="**":if(debug)thenprint"<[204]oaded object"tj+1
  18. 120 close1:tj=tj+1:goto70
  19. 130 if(debug)and(tj=0)thenprint"<[215]arning: loaded no objects"
  20. 140 print:printt$(1)chr$(13)t$(2)
  21. 150 print"[208]rogrammed with [195]ameron [203]aiser's [215][207][210][204][196]"
  22. 160 print"[205][193][203][197][210] v1.5 ([195])1997 [202] & [198] [208]ublishing,"
  23. 170 print"[201]nc. [193]ll rights reserved."
  24. 180 open15,dv,15,"r0:"+bf$+".intro="+bf$+".intro":input#15,en:close15
  25. 190 if(en<>63)and(debug)thenprint"<[215]arning: no intro text":goto220
  26. 200 open1,dv,2,bf$+".intro"
  27. 210 sys828,1,80:printa$:if(st=0)goto210
  28. 220 print:close1:open15,dv,15,"r0:"+bf$+".sinv="+bf$+".sinv":input#15,en:close15
  29. 230 ifen=63thenopen1,dv,2,bf$+".sinv":gosub780:goto260
  30. 240 if(debug)thenprint"<[215]arning: no inventory configuration":print
  31. 250 cr=01
  32. 260 rem <<< main room loader loop >>>
  33. 270 z$=bf$+".room"+right$("0"+mid$(str$(cr),2),2):open15,dv,15,"r0:"+z$+"="+z$
  34. 280 input#15,en:close15:ifen=63goto310
  35. 290 er$="[198]ailed to load room.":gosub60001
  36. 300 if(cr>64)thener$="[207]ut of memory.":gosub60000:end
  37. 310 open1,dv,2,z$:i=1:p=828:z=1:c=95:aa=0
  38. 320 sysp,1,80:rm$(i)=a$+""
  39. 321 ifleft$(rm$(i),7)="action "thenaa=aa+z:aa$(aa)=mid$(rm$(i),8):al(aa)=i
  40. 322 ifleft$(rm$(i),6)="alias "thenaa=aa+z:aa$(aa)=mid$(rm$(i),7):al(aa)=i
  41. 325 if(st=nu)and(i<c)theni=i+z:goto320
  42. 330 close1:rm$(i+1)="**":ifi=95thener$="[210]oom too complex.":gosub60000
  43. 332 ifrnd(1)>.85thenprint"([205]emory maintenance -- one moment)":q=fre(0)
  44. 340 t=cr:vb$="look":if(notbm)goto356
  45. 342 printmid$(rm$(2),7)
  46. 350 vb$="":print"> [144]";:poke204,.
  47. 351 geta$:ifa$=""goto351
  48. 352 ifa$=chr$(20)andvb$<>""thenprinta$;:vb$=left$(vb$,len(vb$)-1):goto351
  49. 353 ifa$=chr$(13)andvb$<>""thenpoke204,1:print" ":goto356
  50. 354 if(len(vb$)>36)or(a$<" "ora$>"z")goto351
  51. 355 printa$" [157]";:vb$=vb$+a$:goto351
  52. 356 ga=0:gosub60008:ifcr<>tgoto260
  53. 357 iv(cr,0)=int(-(iv(cr,0)<16)*iv(cr,0)):ifiv(cr,0)=0orvb$<>"look"goto360
  54. 358 print:print"[201]n the room:":print:z=0
  55. 359 printmid$(ob$(2,iv(cr,z)),7):z=z+1:ifiv(cr,z)<>0goto359
  56. 360 ifvb$<>"quit"andga<>999goto369
  57. 361 print"[211]ession concluded -- play again? (y/n)"
  58. 362 geta$:ifa$<>"y"anda$<>"n"goto362
  59. 363 ifa$="y"thenrun22
  60. 364 print"[197]nd of session.":run1000
  61. 369 if(ba)goto350
  62. 370 ifvb$="i"orvb$="inventory"thengosub450:goto350
  63. 380 ifleft$(vb$,4)="get "thengosub560:goto350
  64. 390 ifleft$(vb$,5)="drop "thengosub620:goto350
  65. 400 ifleft$(vb$,4)="exa "thengosub530:goto350
  66. 401 ifleft$(vb$,5)="save "thengosub670:goto350
  67. 402 ifleft$(vb$,5)="load "thengosub750:goto260
  68. 403 ifvb$="brief"thenbm=notbm:print"[207]k.":goto350
  69. 404 ifvb$="version"thenprint"[215][207][210][204][196] [205][193][203][197][210] v1.5 by [195]ameron [203]aiser":goto350
  70. 410 if(debug)andleft$(vb$,6)="clone "thenp=0:p$=vb$:gosub60044:goto350
  71. 420 if(debug)andleft$(vb$,5)="dest "thenp=0:p$="x"+vb$:gosub60048:goto350
  72. 422 if(debug)andleft$(vb$,5)="goto "thencr=val(mid$(vb$,6)):goto260
  73. 430 if(debug)andvb$="debug"thenprint"<[196]ebug off.":debug=0:goto350
  74. 440 print"[200]uh?":goto350
  75. 450 z=0:ifip(0)=0thenprint"[217]ou have nothing.":return
  76. 452 print"[217]our inventory contains:":print
  77. 460 ifip(z)<>0thenprintmid$(ob$(2,ip(z)),7):z=z+1:goto460
  78. 470 return
  79. 480 f=-1:z=0:ifip(0)=0goto510
  80. 490 ifmid$(ob$(1,ip(z)),4)=id$thenf=z
  81. 500 z=z+1:ifip(z)<>0goto490
  82. 510 iff=-1thenprint"[217]ou don't see that here."
  83. 520 return
  84. 530 x=3:f=0:id$=mid$(vb$,5):ifiv(cr,0)=0goto550
  85. 531 ifmid$(ob$(1,iv(cr,f)),4)=id$goto540
  86. 532 f=f+1:ifiv(cr,f)<>0goto531
  87. 533 goto550
  88. 540 ifob$(x,iv(cr,f))<>"**"thenprintob$(x,iv(cr,f)):x=x+1:goto540
  89. 542 return
  90. 550 gosub480:iff=-1thenreturn
  91. 551 ifob$(x,ip(f))<>"**"thenprintob$(x,ip(f)):x=x+1:goto551
  92. 552 return
  93. 560 f=-1:z=0:ifiv(cr,0)=0thenprint"[212]here's nothing here to get.":return
  94. 570 ifmid$(ob$(1,iv(cr,z)),4)=mid$(vb$,5)thenf=z
  95. 580 z=z+1:ifiv(cr,z)<>0goto570
  96. 590 iff=-1thenprint"[212]here's none of that here.":return
  97. 600 o=iv(cr,f):fori=fto15:iv(cr,i)=iv(cr,i+1):next:iv(cr,15)=0
  98. 610 p=0:gosub60045:print"[212]aken.":return
  99. 620 id$=mid$(vb$,6):gosub480:iff=-1thenreturn
  100. 630 ifiv(cr,15)<>0thenprint"[212]here seems to be no space for it here.":return
  101. 640 o=ip(f):p=f:gosub60051:p=0
  102. 650 ifiv(cr,p)<>0thenp=p+1:goto650
  103. 660 iv(cr,p)=o:print"[196]ropped.":return
  104. 670 f$=mid$(vb$,6):open15,dv,15,"r0:sav."+f$+"=sav."+f$:input#15,en:close15
  105. 680 ifen<>62thenprint"[198]ile exists/disk error in save.":return
  106. 690 print"[211]aving game: "f$" ";
  107. 700 open1,dv,2,"0:sav."+f$+",s,w":print#1,fl:print#1,cr:forx=1to64:y=0
  108. 710 print#1,iv(x,y):ifiv(x,y)<>0theny=y+1:goto710
  109. 720 if(xand1)thenprint".";
  110. 722 next:y=0
  111. 730 print#1,ip(y):ifip(y)<>0theny=y+1:goto730
  112. 740 print" done.":close1:return
  113. 750 f$=mid$(vb$,6):open15,dv,15,"r0:sav."+f$+"=sav."+f$:input#15,en:close15
  114. 760 ifen=62thenprint"[206]o such file/disk error in load.":goto350
  115. 770 print"[207]ne moment please ...":open1,dv,2,"0:sav."+f$
  116. 780 input#1,fl:input#1,cr:forx=1to64:y=0
  117. 790 input#1,iv(x,y):ifiv(x,y)<>0andy<15theny=y+1:goto790
  118. 800 ify=16thenclose1:print"[197]rror in saved file (bad segmentation)":return
  119. 810 next:y=0
  120. 820 input#1,ip(y):ifip(y)<>0theny=y+1:goto820
  121. 830 close1:return
  122. 1000 poke53280,0:poke53281,0:print"[147][215][207][210][204][196][160][205][193][203][197][210] 1.5 [196]eveloper":clr:a$=""
  123. 1002 dv=peek(186):ifdv<8thendv=8
  124. 1004 dr=159*256
  125. 1010 print"[208]rogrammed by [195]ameron [203]aiser":print"([195])1997 [202]&[198] [208]ublishing, [201]nc."
  126. 1011 print" ** [208]ress [_] to create new project. **"
  127. 1012 ifpeek(828)<>32thensys57812"33c.ia.o",dv,1:poke780,0:sys65493
  128. 1013 ifpeek(828)<>32thenprint"[213][206][193][194][204][197][160][212][207][160][198][201][206][196][160][205][204] [207][194][202][197][195][212] [198][201][204][197][211]":end
  129. 1020 open15,dv,15,"r0:config.parse=config.parse":input#15,en:close15
  130. 1030 ifen<>63goto2110
  131. 1040 print"    [204]oading current configuration..."
  132. 1041 a=0:i=0
  133. 1042 reada:ifa<>-1thenpokedr+i,a:i=i+1:goto1042
  134. 1043 data169,36,133,251,169,251,133,187,169,0,133,188,169,1,133,183,169,8
  135. 1044 data133,186,169,96,133,185,32,213,243,165,186,32,180,255,165,185,32,150
  136. 1045 data255,169,0,133,144
  137. 1046 data160,3,132,251,32,165,255,133,252,164,144,208,47,32,165,255
  138. 1047 data164,144,208,40,164,251,136,208,233,166,252
  139. 1048 data32,205,189,169,32,32,210,255,32,165,255,166,144,208,18,170,240,6
  140. 1049 data32,210,255,184,80,240,169,13,32,210,255,160,2,208,198,32,66,246,96,-1
  141. 1058 open1,dv,2,"config.parse":y=0
  142. 1060 get#1,a$:ifa$=chr$(13)theny=y+1
  143. 1070 ify<2goto1060
  144. 1080 input#1,bf$:close1
  145. 1089 geta$:ifa$="_"goto2000
  146. 1090 poke53281,12:poke53280,12:print"[147][208]roject: "bf$
  147. 1100 pokedr+17,dv
  148. 1108 print"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  149. 1110 print""tab(10)"[144][198]1  [193]ppend/write file"
  150. 1120 printtab(10)"[144][198]3  [199]enerate object"
  151. 1130 printtab(10)"[144][198]5  [212]est run"
  152. 1140 printtab(10)"[144][198]7  [214]iew file"
  153. 1150 print"[208]ress [144][209] to quit."
  154. 1160 print"[208]ress [144]@ to execute a disk command."
  155. 1161 geta$:ifa$<>"q"anda$<>"@"anda$<>"[133]"anda$<>"[134]"anda$<>"[135]"anda$<>"[136]"goto1161
  156. 1170 ifa$="q"goto63000
  157. 1180 ifa$="[135]"thenrun20
  158. 1181 ifa$="[134]"goto1300
  159. 1182 ifa$="[136]"goto1480
  160. 1183 ifa$="[133]"