home *** CD-ROM | disk | FTP | other *** search
/ 64'er Special 30 / 64er_Magazin_Sonderheft_30_19xx_Markt__Technik_de_Side_B.d64 / pisten-editor (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  7KB  |  261 lines

  1. 10 rem ***********************
  2. 20 rem ***  pisten-editor  ***
  3. 30 rem ***-----------------***
  4. 40 rem ***   (w) 1987 by   ***
  5. 50 rem ***   n.bergerhoff  ***
  6. 60 rem ***********************
  7. 70 :
  8. 80 poke51,0:poke52,96:poke55,0:poke56,96
  9. 85 zz=0:sz=0:rp=32:zp=24:sp=36864:sl=36877:fl=-1:pp=25057
  10. 90 dim t(13,1)
  11. 100 poke53280,0:poke53281,6:print"[147]"chr$(142)chr$(8)
  12. 105 printtab(7)"initializing dataspace ..."
  13. 110 na$="edit":ad=49152:gosub200
  14. 120 na$="char":ad=14336:gosub200
  15. 130 na$="start":ad=24576:gosub200:goto230
  16. 200 sys(57812)na$,8:poke782,int(ad/256):poke781,ad-peek(782)*256:poke780,0:sys65493
  17. 210 return
  18. 230 sys49643,25057,36863,32:sys49643,36864,40959,0
  19. 231 fori=1to13:reada,b:t(i,0)=a:t(i,1)=b:next
  20. 232 data 9,6,9,7,9,8,9,9,9,10,9,11,9,12,23,6,23,7,35,6,35,7,35,8,35,9
  21. 233 fori=0to12:reada:poke36864+i,a:next
  22. 234 data 1,1,1,1,1,1,2,1,2,1,2,2,2
  23. 249 poke53272,30
  24. 250 print"[147]":poke49556,5:poke49555,30:sys49454
  25. 260 fori=30to154:poke49555,i:fort=0to10:nextt,i
  26. 270 print"[147][158]----------------------------------------";
  27. 275 print"    'pisten-editor' by n.bergerhoff"
  28. 280 print"----------------------------------------"
  29. 285 print"   steigung    rundung    sonstiges"
  30. 290 print"     -45        [154]runter      [153]sprung  "
  31. 295 print"     [154]-25          [150]hoch       [153]tanne  "
  32. 300 print"     -15                      [153]haus  "
  33. 305 print"     [153]  0     pointer:         [153]ziel  "
  34. 310 print"      15        frei:"
  35. 315 print"     [150] 25     spalten:"
  36. 320 print"     [158] 45      zeilen:"
  37. 330 sys49425:poke49152,225:poke49153,97:poke56075,0:goto370
  38. 340 :
  39. 345 bp=peek(49152)+256*peek(49153):return
  40. 350 poke1024+40*y+x,31:return
  41. 360 poke1024+40*y+x,32:return
  42. 370 k=1:x=t(k,0):y=t(k,1):gosub350
  43. 400 poke53280,0:gosub345:print"[158]"tab(21);bp
  44. 410 i=36863-bp:ifi<1500then:ifco=0thenprint""tab(21)i;"[157]    ":co=1:goto421
  45. 420 printtab(21)i;"[157]    ":co=0
  46. 421 printtab(21)sz"[157]  "
  47. 422 printtab(21)zz"[157]  "
  48. 423 ifi<850then2240
  49. 425 geta$:ifa$=" "thengosub750
  50. 426 ifa$="[133]"thengosub2500
  51. 430 z=peek(56320)
  52. 440 if(zand1)=0thenr=k-1:goto480
  53. 450 if(zand2)=0thenr=k+1:goto480
  54. 460 if(zand16)=0then505
  55. 470 goto400
  56. 480 ifr<1thenr=1
  57. 490 ifr>13thenr=13
  58. 500 x=t(k,0):y=t(k,1):gosub360:k=r:x=t(k,0):y=t(k,1):gosub350:goto400
  59. 505 poke53280,11
  60. 510 onkgosub530,800,860,950,990,2000,2040,2080,2120,2170,2180,2200,2240
  61. 520 goto400
  62. 530 gosub600:fl=-1
  63. 535 rp=rp+1
  64. 540 if(peek(sl-1)and15)=1then550
  65. 545 zp=zp+1
  66. 550 gosub620
  67. 555 poke1024+40*zp+rp,64
  68. 560 gosub680
  69. 565 gosub930:return
  70. 600 iffl=-1thenpokesl,2:goto610
  71. 605 pokesl,1
  72. 610 sl=sl+1:return
  73. 620 ifrp<40andzp<25andzp>12thenreturn
  74. 625 x=(peek(sp)and15)
  75. 630 ifx<>1andx<>2andx<>3thenpoke53280,2:fort=0to50:next:return
  76. 635 onxgosub650,660,670
  77. 640 rp=rp-1:sp=sp+1:sz=sz+1:goto620
  78. 650 sys49192:pp=pp+12:return
  79. 660 sys49324:pp=pp+52:zp=zp-1:zz=zz+1:gosub1060:return
  80. 670 sys49359:pp=pp+12:zp=zp+1:return
  81. 680 ifrp<39orzp>23thenreturn
  82. 690 poke2023,160
  83. 699 br=0
  84. 701 fori=1983to1583step-40
  85. 705 ifpeek(i)<>32thenbr=1
  86. 710 ifbr=0thenpokei,160
  87. 715 nexti:return
  88. 720 fora=1583to2023step40
  89. 725 sys49560,a,pp:pp=pp+1:next:return
  90. 730 gosub720
  91. 735 fora=1984to2023
  92. 740 sys49560,a,pp:pp=pp+1:next:return
  93. 745 :
  94. 750 poke53280,11:ifsp<36866thenreturn
  95. 755 sys49425:x=6:gosub1090:poke49152,225:poke49153,97:fort=1to500:nextt
  96. 760 fori=36864tosp-1
  97. 765 poke53280,11:x=(peek(i)and15)
  98. 770 ifx<>1andx<>2andx<>3thenreturn
  99. 771 if(peek(i)and16)thenpoke53280,13
  100. 775 onxgosub785,790,795
  101. 780 next:x=1:gosub1090:return
  102. 785 sys49192:return
  103. 790 sys49324:return
  104. 795 sys49359:return
  105. 800 gosub600:fl=-1
  106. 805 rp=rp+1
  107. 810 if(peek(sl-1)and15)=1then820
  108. 815 zp=zp+1
  109. 820 gosub620:gosub920:pokex,66:gosub680:gosub930
  110. 825 rp=rp+1:gosub620:gosub920:pokex,67
  111. 830 gosub680:gosub930
  112. 835 pokesl,1:sl=sl+1:return
  113. 860 gosub600:fl=-1
  114. 865 rp=rp+1
  115. 870 if(peek(sl-1)and15)=1then880
  116. 875 zp=zp+1
  117. 880 gosub620:gosub920:pokex,70:gosub680:gosub930
  118. 885 rp=rp+1:gosub620:gosub920:pokex,71:gosub680:gosub930
  119. 890 rp=rp+1:gosub620:gosub920:pokex,72:gosub680:gosub930
  120. 895 rp=rp+1:gosub620:gosub920:pokex,73:gosub680:gosub930
  121. 900 fori=sltosl+2:pokei,1:next:sl=sl+3:return
  122. 920 x=1024+40*zp+rp:return
  123. 930 if(peek(sp-1)and15)=2then940
  124. 935 pp=pp-12:gosub720:return
  125. 940 pp=pp-52:gosub730:return
  126. 950 gosub600:fl=0
  127. 955 rp=rp+1
  128. 960 if(peek(sl-1)and15)=1then970
  129. 965 zp=zp+1
  130. 970 gosub620
  131. 975 gosub920:pokex,160
  132. 980 gosub680:gosub930:return
  133. 990 ifrp<38then2003
  134. 991 ifzp<14and(peek(sp)and15)<>3then2003
  135. 994 gosub1040:fl=1
  136. 995 rp=rp+1
  137. 1000 if(peek(sl-1)and15)=1then1010
  138. 1005 zp=zp-1
  139. 1010 gosub620:gosub920:pokex,74:gosub680:gosub930
  140. 1015 rp=rp+1:gosub620:gosub920:pokex,75:gosub680:gosub930
  141. 1020 rp=rp+1:gosub620:gosub920:pokex,76:gosub680:gosub930
  142. 1025 rp=rp+1:gosub620:gosub920:pokex,77:gosub680:gosub930
  143. 1030 fori=sltosl+2:pokei,1:next:sl=sl+3:return
  144. 1040 iffl=-1thenpokesl,1:goto1050
  145. 1045 pokesl,3
  146. 1050 sl=sl+1:return
  147. 1060 x=1983
  148. 1065 ifpeek(x)<>32then1075
  149. 1070 x=x-1:goto1065
  150. 1075 x=x+40
  151. 1080 fori=1984tox:pokei,160:next
  152. 1085 ifzp<25thenreturn
  153. 1086 i=x-1983:sl=sl+1-((zp-24)*(rp-i))/(zp-24):zp=24:rp=i+1:return
  154. 1090 fori=55855to56295step40
  155. 1095 pokei,x:next:return
  156. 2000 ifrp<38then2003
  157. 2001 ifzp<14and(peek(sp)and15)<>3then2003
  158. 2002 goto2005
  159. 2003 poke53280,2:fort=1to50:next:return
  160. 2005 gosub1040:fl=1
  161. 2010 rp=rp+1
  162. 2015 if(peek(sl-1)and15)=1then2025
  163. 2020 zp=zp-1
  164. 2025 gosub620:gosub920:pokex,68:gosub680:gosub930
  165. 2030 rp=rp+1:gosub620:gosub920:pokex,69:gosub680:gosub930
  166. 2035 pokesl,1:sl=sl+1:return
  167. 2040 ifrp<38then2003
  168. 2045 ifzp<14and(peek(sp)and15)<>3then2003
  169. 2050 gosub1040:fl=1
  170. 2055 rp=rp+1
  171. 2060 if(peek(sl-1)and15)=1then2070
  172. 2065 zp=zp-1
  173. 2070 gosub620:gosub920:pokex,65:gosub680:gosub930
  174. 2075 return
  175. 2080 gosub600:fl=-1
  176. 2085 rp=rp+1
  177. 2090 if(peek(sl-1)and15)=1then2100
  178. 2095 zp=zp+1
  179. 2100 gosub620:gosub920:pokex,78:gosub680:gosub930
  180. 2105 rp=rp+1:gosub620:gosub920:pokex,79:gosub680:gosub930
  181. 2110 rp=rp+1:gosub620:gosub920:pokex,80:gosub680:gosub930
  182. 2115 pokesl,1:pokesl+1,1:sl=sl+2:return
  183. 2120 ifrp<38then2003
  184. 2125 ifzp<14and(peek(sp)and15)<>3then2003
  185. 2130 gosub1040:fl=1
  186. 2135 rp=rp+1
  187. 2140 if(peek(sl-1)and15)=1then2150
  188. 2145 zp=zp-1
  189. 2150 gosub620:gosub920:pokex,81:gosub680:gosub930
  190. 2155 rp=rp+1:gosub620:gosub920:pokex,82:gosub680:gosub930
  191. 2160 rp=rp+1:gosub620:gosub920:pokex,83:gosub680:gosub930
  192. 2165 pokesl,1:pokesl+1,1:sl=sl+2:return
  193. 2170 pokesl-1,(peek(sl-1)or16):fort=0to100:next:return
  194. 2180 ifrp<38then2003
  195. 2181 ifzp>16andfl=-1then2185
  196. 2182 ifzp<18then2003
  197. 2185 gosub950:gosub920:pokex-80,85:pokex-120,88:gosub930
  198. 2190 gosub950:gosub920:pokex-40,84:pokex-80,86:pokex-120,89:pokex-160,91:gosub930
  199. 2195 gosub950:gosub920:pokex-80,87:pokex-120,90:gosub930:return
  200. 2200 ifrp<38then2003
  201. 2205 ifzp>16andfl=-1then2215
  202. 2210 ifzp<18then2003
  203. 2215 gosub950:gosub920:pokex-40,104:pokex-80,100:pokex-120,95:pokex-160,92:gosub930
  204. 2220 gosub950:gosub920:pokex-40,105:pokex-80,101:pokex-120,96:pokex-160,93:gosub930
  205. 2225 gosub950:gosub920:pokex-40,106:pokex-80,102:pokex-120,97:pokex-160,94:gosub930
  206. 2230 gosub950:gosub920:pokex-40,107:pokex-80,103:pokex-120,98:gosub930
  207. 2235 gosub950:gosub920:pokex-120,99:gosub930:return
  208. 2240 forn=1to21:gosub950:next:pokesl,1:pokesl+1,4:sl=sl+2
  209. 2245 gosub920:pokex-40,122:pokex-80,122:pokex-120,122:pokex-160,119
  210. 2250 pokex-200,116:pokex-240,113:gosub930
  211. 2255 gosub950:gosub920:pokex-160,120:pokex-200,117:pokex-240,114:gosub930
  212. 2260 gosub950:gosub920:pokex-160,121:pokex-200,118:pokex-240,115:gosub930
  213. 2265 forn=1to5:gosub950:next
  214. 2270 gosub920:pokex-40,110:gosub930:gosub950:gosub920:pokex-40,111
  215. 2275 pokex-80,109:gosub930:gosub950:gosub920:pokex-40,112:gosub930
  216. 2280 forn=1to4:gosub950:next:gosub2200
  217. 2285 forn=1to3:gosub950:next
  218. 2290 fori=1to1000:next:gosub750:fori=1to1000:next:sys49486
  219. 2295 poke53280,0:poke53281,6:print"[147]"
  220. 2300 print"piste abspeichern <j/n> ? ";
  221. 2305 geta$:ifa$<>"j"anda$<>"n"then2305
  222. 2310 printa$:print"sicher ?"
  223. 2315 getb$:ifb$<>"j"andb$<>"n"then2315
  224. 2320 ifb$="n"then2295
  225. 2325 ifa$="n"thenpoke53272,20:run
  226. 2330 print:input"name:";a$:na$=left$(a$,13)+".pi"
  227. 2335 sys(57812)na$,8:poke193,0:poke194,96
  228. 2336 poke174,peek(49152):poke175,peek(49153):sys62957:goto2400
  229. 2340 open15,8,15:input#15,a,b$,c,d:close15:return
  230. 2350 print"fehler !!!":printa,b$,c,d:fori=1to2000:next:return
  231. 2400 gosub2340:ifa<>0thengosub2350:goto2295
  232. 2410 na$=left$(a$,13)+".sl":sys(57812)na$,8:poke193,0:poke194,144
  233. 2420 poke175,(sp+1)/256:poke174,sp+1-peek(175)*256:sys62957
  234. 2430 gosub2340:ifa<>0thengosub2350:goto2295
  235. 2440 print"[147]":end
  236. 2500 poke53280,11:ifsp<36866thenreturn
  237. 2501 zz=0:sz=0:pp=25057
  238. 2505 sys49425:x=1:gosub1090:poke49152,225:poke49153,97
  239. 2510 fori=36864tosp-1
  240. 2511 fort=0to10:nextt
  241. 2515 poke53280,11:x=(peek(i)and15)
  242. 2525 if(peek(i)and16)thenpoke53280,13
  243. 2530 onxgosub2560,2565,2570
  244. 2531 sz=sz+1
  245. 2535 if(peek(56320)and16)=16then2545
  246. 2540 x=i+1:i=sp:sp=x:goto2550
  247. 2545 if(peek(56320)and8)<>0then2535
  248. 2550 nexti
  249. 2555 x=1:gosub1090:gosub2580:return
  250. 2560 sys49192:pp=pp+12:return
  251. 2565 sys49324:pp=pp+52:zz=zz+1:return
  252. 2570 sys49359:pp=pp+12:return
  253. 2580 fort=1583to2023step40
  254. 2590 ifpeek(t)<>32thengosub2620:t=2024:goto2610
  255. 2595 nextt
  256. 2600 fort=2022to1984step-1
  257. 2605 ifpeek(t)<>32thengosub2620:t=1983
  258. 2610 nextt
  259. 2615 sys49643,pp,36863,32:sl=sp+rp-19:return
  260. 2620 t=t-1024:zp=int(t/40):rp=t-zp*40:return
  261.