home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 147 / 147.d81 / hrs2.bas (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  20KB  |  500 lines

  1. 0 a=peek(j):f=a<=l:onaandugoto,,,,4,3,6,,1,2,5,,8,7:return
  2. 1 gosub8:goto5
  3. 2 gosub7:goto5
  4. 3 gosub7:goto6
  5. 4 gosub8:goto6
  6. 5 x=x+(x>.):return
  7. 6 x=x-(x<h):return
  8. 7 y=y+(y>.):return
  9. 8 y=y-(y<v):return
  10. 9 poker,dx:pokes,dy-1:syst:return
  11. 10 m1=a:m2=b:m3=c:m4=d:m5=e:m6=f:m7=x:m8=y:sysg:n$=x$+mid$(sp$,3):sysg:a=sl<2
  12. 11 k%(42)=a:k%(63)=a:a=3:c=dx:e=16:x=r:d=162:f=16:gosub9:fory=.toj:pokex,c:print"[146]"n$;
  13. 12 pokex,c+a:poked,.:forb=-1to.:getx$:b=x$="":print"[157]"c$(sgn(peek(d)andf)*-b)mid$(n$,a,1);:next
  14. 13 ifk%(asc(x$))thenn$=left$(n$,a-b)+x$+mid$(n$,a+b):a=a-(a<e):next
  15. 14 ifx$=""thena=a-(a<e):next
  16. 15 ifx$="[157]"thena=a+(a>b):next
  17. 16 ifx$=""thena=a+(a>b):n$=left$(n$,a-b)+mid$(n$,a+b)+" ":next
  18. 17 ifx$="[148]"thenn$=left$(n$,a-b)+" "+mid$(n$,a,e-a):next
  19. 18 x%=x$="_":y=-(x$=r$orx%)*j:next:pokex,c:print"[146]"n$;:forx=etobstep-b:ifmid$(n$,x,b)=" "thennext
  20. 19 n$=left$(n$,x):sysg:a=m1:b=m2:c=m3:d=m4:e=m5:f=m6:x=m7:y=m8:return
  21. 20 gosub9:x$="load":ifsl=2thenx$="'sav"
  22. 21 printx$"ing...      ":return
  23. 22 sysci:mz=peek(en):pokeen,.:x$="dd":onslgosub39,40:ifx%then26
  24. 24 gosub62:on-egoto25:gosub20:onslgosub27,28:gosub64
  25. 25 gosub66:gosub65
  26. 26 gosub459:pokeen,mz:return
  27. 27 get#1,x$,x$:y%=7168:x%=9024:sys50960:return
  28. 28 print#1,chr$(.)chr$(92);:y%=7168:x%=9216:sys50954:return
  29. 29 a=50037:b=51364:x%=64:y%=3584:sysa:sysb:x%=y%:y%=ry+(sp-1)*32+se*960:sysa
  30. 30 sysb+4:x%=rx:y%=sp-1:sysa:sysb+8:dx=22:dy=23:x$="s-":gosub10:ifx%then59
  31. 31 m0=peek(en):pokeen,.:sys6415:gosub422:gosub62:ifethen33
  32. 32 gosub20:onslgosub34,35:gosub64
  33. 33 gosub66:gosub422:gosub68:pokeen,m0:gosub65:goto59
  34. 34 get#1,x$,x$:sys51376:return
  35. 35 print#1,chr$(0)chr$(16);:sys51452:return
  36. 36 n$="load graphic":goto41
  37. 37 n$="load  window":goto41
  38. 38 n$="save  window":goto41
  39. 39 n$="load  doodle":goto41
  40. 40 n$="save  doodle"
  41. 41 gosub455:gosub454:print"[147]":a=160:b=fg:gosub450
  42. 42 print""spc(4)"type in file name and hit return":dx=11:dy=12:gosub9
  43. 43 print"[176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"spc(22)"[194]"sp$"[194]"spc(22)"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
  44. 44 printspc(12)"hit '_' to exit!";:dx=14:dy=10:gosub9:printn$:dx=12:dy=13:gosub456:goto10
  45. 45 se=.:dt=.:gosub329:sysci:pokeen,.:x$="g.":ifslthenx$="w."
  46. 46 onsl+1gosub36,37,38:f=.:on-x%goto49:gosub62:ifethen48
  47. 47 gosub20:tl=sl<2:onsl+1goto51,50:gosub54:gosub64
  48. 48 gosub66:gosub65
  49. 49 gosub459:wx=wx+(wx-39)*f:wy=wy+(wy-24)*f:x$="":m9=.:pokeen,240:f=.:return
  50. 50 y%=rx:sys52950:wx=peek(172)-1:wy=peek(173)-1:f=wx>39orwx<.orwy<.orwy>24:goto49
  51. 51 wx=10:wy=6:f=.:goto49
  52. 52 y%=rx:sys53006:goto66
  53. 53 y%=rx:sys49680:goto66
  54. 54 y%=rx:gosub333:sys52968:return
  55. 55 xy=hr+int(n/se)*1024:se=n/se:dx=22:dy=23:x$="f.":gosub10:ifx%then59
  56. 56 m0=peek(en):sys6415:pokeen,.:gosub62:ifethen58
  57. 57 gosub20:onslgosub60,61:z%(se)=a-(a>8ora<5)*(8-a):gosub64
  58. 58 gosub66:gosub67:pokeen,m0:gosub65
  59. 59 e=.:m1=.:m2=.:x$="":gosub9:printsp$:return
  60. 60 get#1,x$,x$:a=asc(x$+chr$(.)):y%=xy:x%=1024:sys50960:return
  61. 61 a=z%(se):print#1,chr$(.)chr$(a);:y%=xy:x%=1024:sys50954:return
  62. 62 open15,dv,15:close15:ifstthenx$="turn on drive"+str$(dv):e=-1:return
  63. 63 open15,dv,15,"i":open1,dv,4,n$+",p,"+mid$("rrw",sl+1,1)
  64. 64 input#15,e,x$:e=e>19:return
  65. 65 gosub9:printleft$(x$+sp$,16):fora=.to1e3-e*2e3:next:return
  66. 66 close1:close15:return
  67. 67 a=6364:sys6383:sysa:return
  68. 68 a=6258:sys6383:sysa:return
  69. 69 sys6400:return
  70. 70 sys6406:return
  71. 71 sys6391:return
  72. 72 pokeen,1:x=160:y=100
  73. 73 x=int(x):y=int(y):pokek,.
  74. 74 c=dm:v=199:h=319:fora=-1to.:gosub.:x%=x:y%=y:sysc-f*3:a=peek(k)=.:next:getx$
  75. 75 ifx$=" "thendm=dr-(dm=dr)*6:goto74
  76. 76 ifx$="[160]"thenifpeek(653)=2thengosub130
  77. 77 ifx$="f"thengosub125
  78. 78 ifx$=""thenx%=16136:y%=x%-8:b=49237:c=0:d=2:gosub124
  79. 79 ifx$="[157]"thenx%=7992:y%=8e3:b=49184:c=1:d=2:gosub124
  80. 80 ifx$=""thenx%=15680:y%=15360:b=49352:c=0:d=7:gosub124
  81. 81 ifx$="[145]"thenx%=8e3:y%=8320:b=49292:c=1:d=7:gosub124
  82. 82 ifx$=""thensysbf:sysi
  83. 83 ifx$="a"thenx1=x:y1=y:a=1:gosub122
  84. 84 ifx$="b"thenx2=x:y2=y:a=2:gosub122
  85. 85 ifx$="c"thenx3=x:y3=y:a=3:gosub122
  86. 86 a=peek(en):b=(aand6)=6:ifx$="h"then149
  87. 87 ifx$="[193]"thenpokeen,aand253
  88. 88 ifx$="[194]"thenpokeen,aand251
  89. 89 ifx$="[195]"thenpokeen,aand247
  90. 90 ifx$="[176]"thenifaand2thenx=x1:y=y1
  91. 91 ifx$="[191]"thenifaand4thenx=x2:y=y2
  92. 92 ifx$="[188]"thenifaand8thenx=x3:y=y3
  93. 93 ifx$="_"thenpokeen,1
  94. 94 ifx$="r"thenifbthengosub158
  95. 95 ifx$="p"thenifaand8andbthengosub161
  96. 96 ifx$="l"thenifbthengosub164
  97. 97 ifx$="o"thenifbthengosub170
  98. 98 ifx$="e"orx$="[197]"thenifbthengosub172
  99. 99 ifx$="m"then218
  100. 100 ifx$="[207]"thenifaand4thengosub237
  101. 101 ifx$="z"orx$="[218]"thengosub251
  102. 102 ifx$="u"thensyso
  103. 103 ifx$="t"thengosub334
  104. 104 ifx$="d"then151
  105. 105 ifx$="[204]"thensl=1:gosub22:sysi
  106. 106 ifx$="[211]"thensl=2:gosub22
  107. 107 a=x$="*":ifaorx$="[192]"thengosub426
  108. 108 ifx$="[144]"thengosub442
  109. 109 ifx$="[147]"thensysi:gosub451:goto72
  110. 110 ifx$=""thengosub351
  111. 111 ifx$=""thengosub385
  112. 112 ifx$="w"thensys7061:gosub298
  113. 113 ifx$="[175]"then141
  114. 114 ifx$=""thengosub469
  115. 115 ifx$=""thenfg=fg+1and15:gosub466
  116. 116 ifx$=""thenbg=bg+1and15:gosub466
  117. 117 ifx$=""thenpc=pc+1and15:gosub470
  118. 118 ifx$="x"thenifbthena=x1:x1=x2:x2=a:a=y1:y1=y2:y2=a:gosub462:gosub463
  119. 119 ifx$="$"thengosub133
  120. 120 ifx$="[209]"then490
  121. 121 goto73
  122. 122 poke780,a:sys50114:pokeen,peek(en)or2^a:return
  123. 123 y%=-6440*se-(wy*256+wx+257)*a
  124. 124 fora=-1to.:sysb:a=peek(653)=candpeek(197)=d:next:return
  125. 125 sysi:b=sa:e=q:d=53101:c=6984:v=199:h=319:rx=63:gosub441:sys7039:gosub462
  126. 126 pokeen,1:pokexa,13:pokeya,30:pokept,63:dt=1
  127. 127 fora=-1to.:gosub.:x%=x:y%=y:syse:iffthena=2+ti:sysd:forf=titoa:f=ti:next
  128. 128 a=peek(k)=.:next:gosub434:x%=rx*64:sys7039:ifx$<>r$then127
  129. 129 sa=b:mx=x:my=y:goto463
  130. 130 sysi:gosub462:gosub461:c=6496:v=192:h=312:x=x-(x>h)*(h-x):y=y-(y>v)*(v-y)
  131. 131 fora=-1to.:gosub.:x%=x:y%=y:sysc-f*3:a=peek(k)=.:next:getx$:mx=x:my=y
  132. 132 pokexa,15:pokeya,32:goto463
  133. 133 mz=peek(en):pokeen,.:sysci:gosub455:gosub454:gosub473:sys53191
  134. 134 print"[147][146]loading directory...":gosub456
  135. 135 sys57812"$",dv:poke43,1:poke44,8:poke768,174:poke769,167:sys47003,1
  136. 136 poke781,1:poke782,8:sys65493:sys42291:goto139
  137. 137 printr$"l[146]ist  e[146]xit  ctrl[146]/slow list";:pokek,.:waitk,1:getx$
  138. 138 on-(x$="$")-(x$="e")*2goto134,140:poke768,174:poke769,167
  139. 139 poke43,1:poke44,8:list:poke43,66:poke44,63:poke768,139:poke769,227:goto137
  140. 140 sys53196:gosub455:gosub472:gosub459:sysi:pokeen,mz:return
  141. 141 x$=" load printer program [y/n]":gosub499:ifx$<>"y"then148
  142. 142 n$="hrs2.prin*":f=-1:goto144
  143. 143 n$="hrs2.help":f=.
  144. 144 sl=1:gosub62:gosub66:ifethen148
  145. 145 poke646,bg:gosub455:gosub454:gosub473:print"[147]s[217]53200:";:iffthenprint"p[207]56,28:";
  146. 146 goto497
  147. 147 poke157,.:poke2,.:gosub472:gosub455:gosub471:sysco:gosub453:sysi:gosub456
  148. 148 pokeen,mz:goto73
  149. 149 x$=" load help? [y/n]:dir-[$]:quit-[shft q]":gosub499:ifx$="y"then143
  150. 150 pokeen,mz:goto119
  151. 151 sysci:gosub457:print" a(    ,    ) b(    ,    ) c(    ,    )";:poke173,3
  152. 152 z=6610:n=6503:v=199:h=319:d=780:f=.
  153. 153 b=x1:c=y1:gosub156:b=x2:c=y2:gosub156:b=x3:c=y3:gosub156:b=dm
  154. 154 fora=-1to.:gosub.:x%=x:y%=y:sysb:ifnotfthensysz
  155. 155 a=peek(k)=.:next:getx$:gosub458:goto75
  156. 156 f=f+1:if(aand2^f)=.thenb=.:c=.
  157. 157 x%=b:y%=c:poked,f:sysn:return
  158. 158 sysi:a=x1>x2or1:b=y1>y2or1:y%=y1:d=dm+3:forx=x1tox2stepa:x%=x:sysd:next
  159. 159 fory=y1toy2step+b:y%=y:sysd:next:forx=x2tox1step-a:x%=x:sysd:next
  160. 160 fory=y2toy1step-b:y%=y:sysd:next:x=x%:y=y%:return
  161. 161 sysi:x=x1:y=y1:x0=x2:y0=y2:gosub165:x=x2:y=y2:x0=x3:y0=y3:gosub165
  162. 162 x=x3:y=y3:x0=x3-x2+x1:y0=y3-y2+y1:gosub165:x=x0:y=y0:x0=x1:y0=y1:goto165
  163. 163 if(aand6)<6thenreturn
  164. 164 sysi:x=x1:y=y1:x0=x2:y0=y2
  165. 165 xd=x0-x:yd=y0-y:xd=xd+sgn(xd):yd=yd+sgn(yd):a=y0<yor1:b=x0<xor1:d=dm+3:sl=.
  166. 166 on-(yd=.)-(xd=.)*2goto167,168,169:sl=abs(yd/xd):ifint(sl)thensl=1/sl:goto168
  167. 167 c=sl*a:y=y-(y0<y)+c/2:forx=xtox+xd-bstepb:x%=x:y%=y:sysd:y=y+c:next:goto169
  168. 168 c=sl*b:x=x-(x0<x)+c/2:fory=ytoy+yd-astepa:x%=x:y%=y:sysd:x=x+c:next
  169. 169 x=x0:y=y0:return
  170. 170 sysi:a=sqr(((x1-x2)*w)^2+(y1-y2)^2)/w:b=int(w*a+.5):a=int(a+.5):c=dm+3
  171. 171 on1-(a<320andb<320)*sgn(a)*sgn(b)goto199,205
  172. 172 sysbf:mx=x2:my=y2:xd=(x1-x2)*w:yd=(y1-y2):ifxd=0thenz=(NULL)/2:dx=1:dy=0:goto175
  173. 173 sl=yd/xd:z=atn(sl):a=1e-06:v=200-a:h=320-a:a=abs(sl)<1:i