home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 22
/
022.d81
/
communique
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
3KB
|
139 lines
0 zz$="":ifdl=1thendl=0:goto16020
1 rem "communique"
2 rem written by alan gardner
3 rem 2-21-86
4 rem
5 rem
6 iflf=0thenlf=1:load"unpacker",8,1
7 iflf=1thenlf=2:load"gallery.shps.lnk",8,1
8 iflf=2thenlf=3:load"textplot.8192.o",8,1
9 iflf=3thenlf=4:load"input.2.o",8,1
10 dimt$(300),vl$(30),vl%(30):open8,8,8,"gallery.text":lc=0:ll=0
11 sys828,8,80:zz$=zz$+""
12 ifleft$(zz$,2)="^@"thenll=ll+1:vl$(ll)=mid$(zz$,3):vl%(ll)=lc:goto11
13 ifzz$<>"[199]"thenlc=lc+1:t$(lc)=zz$:goto11
15 close8:close15:lc=lc-1
30 :
40 cl=1:re=0:dimlk$(20),ll$(20):c$="":z$=""
42 lm=0:rm=39:tm=0:bm=23:ty=0:text=8192
43 s$=" "
44 d$=""
50 :
55 gosub11000:sys51459:poke53280,0
56 :
60 rem
61 c$=t$(cl):ifc$=""thent$(cl)=" ":goto90
62 c$=left$(t$(cl),1):ifc$="'"thencl=cl+1:goto60
70 ifc$="^"thengosub1000:goto60
80 :
90 rem routine to print text here
91 z$=t$(cl):systext,z$,lm*8,(tm+ty)*8
92 printt$(cl)
93 ty=ty+1
99 cl=cl+1:goto60
100 rem *************************
110 end:rem * end of body *
120 rem *************************
130 :
1000 rem check options
1010 c$=mid$(t$(cl),2,1)
1020 :
1030 ifc$="l"thenlm=val(mid$(t$(cl),3)): goto2000
1032 ifc$="r"thenrm=val(mid$(t$(cl),3)): goto2000
1034 ifc$="t"thentm=val(mid$(t$(cl),3)): goto2000
1036 ifc$="b"thenbm=val(mid$(t$(cl),3)): goto2000
1040 :
1050 ifc$="c"thengosub10000:goto2000: rem clear
1060 ifc$="w"thengosub11000:goto2000: rem wipe
1070 ifc$="p"thengosub12000:goto2000: rem plot shp
1080 ifc$="k"thengosub13000:goto2000: rem wait
1090 ifc$="i"thengosub20000:goto2010: rem input
1100 ifc$="x"thenifre=0then60000: rem exit
1110 ifc$="x"thencl=re+1:re=0:goto2010: rem return from sub
1120 ifc$="g"thengosub14000:goto2010: rem goto
1130 ifc$="s"thengosub15000:goto2010: rem gosub
1140 ifc$="d"thengosub16000:goto2000: rem load a table
2000 rem return to line 70
2005 cl=cl+1
2010 return
3000 :
10000 rem clear current window
10010 op=val(right$(t$(cl),1))
10020 ifop=0then rem change eor to something else
10030 ifop=1then rem change something else to eor
10040 sp$=left$(s$,rm-lm+1)
10050 for t=tm to bm
10060 sys text,sp$,lm*8,t*8
10070 next t:ty=0
10080 return
10090 :
11000 rem clear entire screen
11010 shp=0:px=0:py=0:gosub12100:ty=0: return
11020 :
12000 rem plot a shape
12010 ch=1:c=4
12020 ifmid$(t$(cl),ch,1)=";"thenshp=val(mid$(t$(cl),c,ch-1)):goto12040
12030 ch=ch+1:goto12020
12040 c=c+ch-1
12050 ifmid$(t$(cl),ch,1)=";"thenpx=val(mid$(t$(cl),c,ch-1)):goto12070
12060 ch=ch+1:goto12050
12070 py=val(mid$(t$(cl),c+ch))
12100 rem *** plot a shape ***
12110 poke249,224:poke250,204
12120 poke251,0:poke252,64
12130 poke253,px:poke254,py
12140 poke255,shp
12150 sys51462
12170 return
12180 :
13000 rem wait for a keypress
13010 poke198,0:wait198,1:getk$:return
13020 :
14000 rem goto a label
14010 l$=mid$(t$(cl),4):l=0:gosub14500
14020 cl=l:return
14030 :
14500 rem find a label in the text
14510 for x=1 to ll
14520 ifvl$(x)=l$thenl=vl%(x):goto14550
14530 nextx
14540 print"unknown label --- "l$:stop
14550 return
14560 :
15000 rem gosub a label
15010 l$=mid$(t$(cl),4):l=0:gosub14500
15020 re=cl:cl=l:return
15030 :
16000 rem load a table
16005 f$=mid$(t$(cl),4)
16010 dl=1:loadf$,8,1
16020 rem come from line zero
16030 cl=cl+1:goto60
16040 :
20000 rem input certain keys and goto the designated label
20010 t$=t$(cl)
20020 nk=1:c=4
20030 vk$(nk)=mid$(t$,c,1)
20040 ifmid$(t$,c+1,1)=";"thennk=nk+1:c=c+2:goto20030
20050 rem nk=num of valid keys
20060 c=c+2:ch=c
20080 forx=1tonk-1
20090 ifmid$(t$,ch,1)=";"then20110
20100 ch=ch+1:goto20090
20110 vl$(x)=mid$(t$,c,ch-c)
20120 c=ch+1:ch=c
20130 nextx:vl$(nk)=mid$(t$,ch)
20140 rem labels in vl$(1-nk)
20150 :
20160 poke198,0:wait198,1:getk$
20170 forx=1tonk
20180 ifk$=vk$(x)then20200
20190 nextx:goto20160
20200 l$=vl$(x):gosub14500
20210 cl=l
20220 return
22000 :
60000 rem return to magazette
60005 sys 51459:print"[147]":poke928,0
60010 load"hello connect",8:end