home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 24
/
024.d81
/
communique
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
5KB
|
213 lines
0 z$=""
200 rem "communique"
300 rem written by alan gardner
400 rem 2-21-86
500 rem
600 rem
700 iflf=0thenlf=1:load"input.bload.o",8,1
900 sys831,50759,"text@50759.o"
925 sys831,51309,"scr/line.wp.o"
950 sys831,51456,"unpacker"
970 sys831,18176,"ctitle.shp"
1000 :
1100 poke55,0:poke56,90:clr
1200 :
1500 z$="":dimt$(350),vl$(30),vl%(30),s%(10),v%(20)
1550 x=49152:f$=""
1552 ifpeek(x)<>0thenf$=f$+chr$(peek(x)):x=x+1:goto1552
1600 ba=52224:te=50759:bl%=831:in%=828:mo%=1:sw=51309:lw=51312:s%(0)=0
1700 cl%=1:re%=0:c$=""
1800 lm%=0:rm%=39:tm%=0:bm%=23:ty%=0:fl%=0
1900 s$=" "
2000 d$=""
2050 :
2060 gosub15000:sys51456:sys51459: poke53280,0
2100 :
2102 gosub15000
2110 open8,8,8,f$:lc%=0:ll%=0:cl%=1
2120 sysin%,8,80:z$=z$+"":ifleft$(z$,2)="^ "then2120
2130 ifleft$(z$,2)="^@"thenll%=ll%+1:vl$(ll%)=mid$(z$,3):vl%(ll%)=lc%+1:goto2120
2140 ifz$<>"[199]"andz$<>"[196]"thenlc%=lc%+1:t$(lc%)=z$:goto2120
2150 close8:close15:lc%=lc%-1
2152 zz=fre(0):gosub15000
2200 :
2202 pf$(0)=chr$(171):pf$(1)=chr$(184):pf$(2)=chr$(177):pf=0
2300 :
2400 rem
2500 geta$:ifa$=pf$(pf)thenpf=pf+1:ifpf=3then60000
2510 c$=t$(cl%):ifc$=""thent$(cl%)=" ":goto2900
2600 c$=left$(t$(cl%),1):ifc$="'"thencl%=cl%+1:goto2500
2700 ifc$="^"thengosub3800:goto2400
2800 :
2900 rem routine to print text here
3000 z$=t$(cl%):syste,z$,lm%*8,(tm%+ty%)*8
3100 printt$(cl%):ifhf=1thenhf=0:lm%=ss
3200 ty%=ty%+1
3300 cl%=cl%+1:goto2400
3400 rem *************************
3500 end:rem * end of body *
3600 rem *************************
3700 :
3800 rem check options
3900 c$=mid$(t$(cl%),2,1)
4000 :
4500 :
4600 ifc$="g"thengosub9800:goto5800: rem goto
4700 ifc$="s"thengosub10900:goto5800: rem gosub
4800 ifc$="p"thengosub7300:goto5600: rem plot shp
4900 ifc$="#"then16000: rem massage variables
5000 ifc$="d"then11300: rem disk option
5100 ifc$="c"thengosub6000:goto5600: rem clear
5200 ifc$="w"thengosub7000:goto5600: rem wipe
5300 ifc$="x"thenifs%(0)=0then14300: rem exit program
5400 ifc$="x"thencl%=s%(s%(0))+1:s%(0)=s%(0)-1:goto5800:rem return from sub
5500 ifc$="k"then9500: rem wait
5550 ifc$="i"thengosub12000:goto5800: rem input
5551 ifc$="v"thengosub17000:goto5600: rem vtab
5552 ifc$="h"thengosub18000:goto5600: rem htab
5553 ifc$="l"theni%=3:gosub8800:lm%=n%-1:goto5600
5554 ifc$="r"theni%=3:gosub8800:rm%=n%-1:goto5600
5556 ifc$="t"theni%=3:gosub8800:tm%=n%-1:goto5600
5558 ifc$="b"theni%=3:gosub8800:bm%=n%-1:goto5600
5600 rem return to line 2500
5700 x=cl%:x=x+1:cl%=x
5800 return
5900 :
6000 rem clear current window
6100 i%=3:gosub8800:op=n%
6200 ifop=0thenx=16
6300 ifop=1thenx=1
6400 sp$=left$(s$,rm%-lm%+1)
6500 for t=tm% to bm%
6600 sys te,sp$,lm%*8,t*8: sys lw,ba+t*40+lm%,rm%-lm%,x
6700 next t:ty%=0
6800 return
6900 :
7000 rem clear entire screen
7100 i%=3:gosub8800:op=n%
7110 ifop=0thensyssw,16
7120 ifop=1thensyssw,1
7130 ty%=0
7140 return
7200 :
7300 rem plot a shape
7400 i%=3:gosub8800:sh%=n%:sh%=sh%-1
7500 gosub8800:mo%=n%
7600 gosub8800:px%=n%
7800 py%=val(mid$(t$(cl%),i%))
7900 :
8000 rem *** plot a shape ***
8100 poke249,224:poke250,204
8150 ad%=23296:ifmo%=2thenad%=28416
8200 poke251,0:poke252,ad%/256
8300 poke253,px%:poke254,py%
8400 poke255,sh%
8500 sys51462
8600 return
8700 :
8800 rem parse out a value
8900 rem i%=start posn in t$(cl%)
9000 rem returns n% as value parsed
9100 c%=0:e%=0:l%=len(t$(cl%))
9110 ifmid$(t$(cl%),i%,1)="#"thene%=1:i%=i%+1
9200 t$=mid$(t$(cl%),i%,1)
9210 if(t$>="0")and(t$<="9")theni%=i%+1:c%=c%+1:ifi%<=l%then9200
9300 i%=i%-c%:n%=val(mid$(t$(cl%),i%,c%))
9350 ife%=1thenn%=v%(n%)
9375 i%=i%+c%+1:return
9400 :
9500 rem wait for a keypress
9525 l$="":iflen(t$(cl%))<3then9600
9550 ifpeek(198)<>0thenl$=mid$(t$(cl%),5):gosub10200:cl%=l:poke198,0:goto5800
9560 goto5600
9600 poke198,0:wait198,1:getk$:goto5600
9700 :
9800 rem goto a label
9900 l$=mid$(t$(cl%),4):l=0:gosub10200
10000 cl%=l:return
10100 :
10200 rem find a label in the text
10300 for x=1 to ll%
10400 ifvl$(x)=l$thenl=vl%(x):goto10700
10500 nextx:t$="unknown label --- "+l$
10600 syssw,16:syste,t$,0,0:stop
10700 return
10800 :
10900 rem gosub a label
11000 l$=mid$(t$(cl%),4):l=0:gosub10200
11050 ifs%(0)=10thensyssw,16:syste,"stack overflow",0,0:stop
11100 s%(0)=s%(0)+1:s%(s%(0))=cl%:cl%=l: return
11200 :
11300 rem get something from disk
11400 ifmid$(t$(cl%),3,1)="t"thenf$=mid$(t$(cl%),5):goto2100
11410 :
11450 i%=5:c%=0
11460 ifmid$(t$(cl%),i%,1)<>","theni%=i%+1:c%=c%+1:goto11460
11470 i%=i%-c%:f$=mid$(t$(cl%),i%,c%)
11480 mo%=val(mid$(t$(cl%),i%+c%+1))
11485 ad%=23296:ifmo%=2thenad%=28416
11490 x=ad%:sysbl%,x,f$
11492 poke249,224:poke250,204
11495 goto 5600
11900 :
12000 rem input certain keys and goto the designated label
12100 t$=t$(cl%)
12200 nk=1:c=4
12300 vk$(nk)=mid$(t$,c,1)
12400 ifmid$(t$,c+1,1)=","thennk=nk+1:c=c+2:goto12300
12500 rem nk=num of valid keys
12600 c=c+2:ch%=c
12700 forx=1tonk-1
12800 ifmid$(t$,ch%,1)=","then13000
12900 ch%=ch%+1:goto12800
13000 ll$(x)=mid$(t$,c,ch%-c)
13100 c=ch%+1:ch%=c
13200 nextx:ll$(nk)=mid$(t$,ch%)
13300 rem labels in% vl$(1-nk)
13400 :
13500 poke198,0:wait198,1:getk$
13600 forx=1tonk
13700 ifk$=vk$(x)thenl$=ll$(x):goto13900
13800 nextx:goto13500
13900 gosub10200
14000 cl%=l
14100 return
14200 :
14300 rem re%turn to magazette
14400 sys 51459:print"[147]":poke56,160:clr
14500 load"hello connect",8:end
14502 end
14600 rem ***** end *****
15000 rem
15005 rem set parameters
15010 poke249,224:poke250,204
15015 poke251,0:poke252,71
15020 poke253,0:poke254,0
15025 poke255,0
15040 return
15050 :
16000 rem massage variables
16010 c$=t$(cl%)
16020 i%=3:gosub8800:vn%=n%
16025 op$=mid$(c$,i%-1,1)
16030 gosub8800:nu%=n%
16040 l$=mid$(c$,i%)
16060 ifop$="="thenv%(vn%)=nu%: goto5700
16070 ifop$="-"thenv%(vn%)=v%(vn%)-nu%: goto5700
16075 ifop$="+"thenv%(vn%)=v%(vn%)+nu%: goto5700
16080 ifop$="?"thenifv%(vn%)=nu%then gosub10200:cl%=l:goto5800
16490 goto5700
16499 :
17000 rem vtab
17010 i%=3:gosub8800:ty%=n%:return
17020 :
18000 rem htab
18010 i%=3:gosub8800:ss=lm%:lm%=n%:hf=1
18020 return
18030 :
60000 rem too bad!!!
60010 sys831,18176,"ctitle.shp"
60020 gosub15000:sys51456
60030 fordl=1to1000:next:print"[147]":sys51459:poke53280,0:poke53281,0:run1100
60040 :