home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_07_1985_Transactor_Publishing.d64
/
terminal_vic.c1
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
2KB
|
59 lines
10 rem *** new protocol ***
20 rem release 1: jul 31 1984
30 rem by steve punter
40 rem converted to the vic-20
50 rem by david tingler & dave caruana
60 rem requires at least 8k expansion
70 ifpeek(12288)<>169thenload"term/vic.c1",8,1
80 poke56,48:poke644,48:clr:open5,2,0,chr$(6):poke665,75:get#5,a$:bs=255
90 open1,8,15,"ui-":dimt$(3):ml=12288:bf=ml+2048:printchr$(14);
100 ty$="psp":t$(1)="[208]rogram":t$(2)="[211][197][209]":t$(3)="[215]ord[208]ro"
110 print"[147][194]lock [211]ize ="bs
120 print"[207]ptions:"
130 print" 1 - [212]erminal [205]ode"
140 print" 2 - [212]ransmit a [198]ile"
150 print" 3 - [210]eceive a [198]ile"
160 print" 4 - [195]hange [194]lock [211]ize"
170 geta$:ifa$=""then170
180 ifa$="2"then1000
190 ifa$="3"then2000
200 ifa$="4"then3000
210 ifa$="1"thenprint"[212]erminal [205]ode:":goto4000
220 goto170
1000 print"[208]rogram [206]ame? ";:gosub5000:ifi$=""orfl=1then110
1010 print"[198]ile [212]ype ([208],[211],[215])?":print"> [146][157]";
1020 geta$:ifa$=""then1020
1030 ifa$="[133]"then110
1040 ifa$="p"thensa=0:t=1:goto1080
1050 ifa$="s"thensa=2:t=2:goto1080
1060 ifa$="w"thensa=0:t=3:goto1080
1070 goto1020
1080 printt$(t)"":open2,8,sa,i$:input#1,e$,em$,t$,s$
1090 ifval(e$)>0thenprint""e$","em$","t$","s$:close2:goto1000
1120 sysml+21:pokebf+27,t:sysml+12:ifpeek(512)=1thenclose2:goto4000
1130 sysml+21:pokebf+24,bs:sysml+6:close2:goto4000
2000 print"[211]ave [193]s? ";:gosub5000:ifi$=""orfl=1then110
2010 sysml+21:sysml+9:ifpeek(512)=1then4000
2020 t$=","+mid$(ty$,peek(bf+27),1)+",w"
2025 print"[198]ile [212]ype: "t$(peek(bf+27))
2030 open2,8,2,"0:"+i$+t$:forx=1to1300:nextx:print:sys61531
2040 sysml+21:sysml+3:close2:forx=1to1500:nextx:poke668,peek(667):goto4000
3000 print"[194]lock [211]ize? ";:gosub5000:ifi$=""then110
3010 bs=val(i$):ifbs<40thenbs=40
3020 ifbs>255thenbs=255
3030 goto110
4000 print
4010 sysml+21:sysml+15:goto110
5000 i$="":fl=0
5010 print" [146][157]";
5020 geta$:ifa$=""then5020
5030 ifa$=chr$(13)then5100
5040 ifa$=chr$(20)then5080
5045 ifa$="[133]"thenfl=1:goto5100
5050 iflen(a$)>20then5020
5060 if(asc(a$)and127)<32then5020
5070 printa$;:i$=i$+a$:goto5010
5080 iflen(i$)=0then5020
5090 print" [157][157]";:i$=left$(i$,len(i$)-1):goto5010
5100 print" ":return