10	data 300,1200,2400,4800,9600,19200,38400,57600,115200,230400
20	poke 787,peek(186) : if peek(6)=255 and (peek(2)<1 or peek(2)>2) then poke 45,peek(174) : poke 46,peek(175) : clr
30	if peek(787)<>1 and (peek(787)<8 or peek(787))>30 then poke 787,8
40	if peek(2)<1 or peek(2)>2 then poke 2,1 : load"nova9.6-1.ml",peek(787),1
50	if peek(2)=1 then poke 2,2 : load"nova9.6-2.ml",peek(787),1
60	poke 2,0 : poke 55,0 : poke 56,124 : poke 643,0 : poke 644,124 : clr : sys 38436
70	ml=38400 : sl=ml+93 : dt=usr(ml+87) : sa=usr(4) : pt=49161 : op=ml+15 : \
	xm=1024 : rv=xm+256 : sr=32000 : md=52992 : m1=md+18 : sn=peek(648)*256 : \
	q$=chr$(34) : dimms$(20),bd$(9) : lc$="" : of$="" : nc=0 : sc=0 : nu=0 : \
	nd=0 : nf=0 : for i=0 to 9 : readbd$(i) : next : mm$="&c1&d2e0m0v1x4s0=1"
80	sp$="                                       " : \
	dn$="\q\q\q\q\q\q\q\q\q\q\q\q\q\q\q\q\q\q\q\q\q\q\q\q"
120	poke sa,peek(sa) or 128 : poke sa+4,peek(sa+4) or 128 : poke 6,176
130	dp=peek(787) : if dp<>1 and (dp<8 or dp>30) then dp=8
140	open 15,dp,15 : dp$="0:" : d%(1)=dp : d$(1)=dp$ : dd=1 : sys sl+6 : ca=peek(780)
150	f1$="login.txt" : f2$="menu.txt" : f3$="logout.txt" : gosub 720
160	open 2,dp,2,dp$+"\\stats" : input#15,e : if e>19 then close 2 : goto 190
170	input#2,lc$,of$,nc,sc,nu,nd,nf : close 2
190	print "\S" tab(9) "Novaterm 9.6 BBS mode" : gosub 4090
200	for i=3 to 0 step -1 : poke 56584+i,peek(56328+i) : next
210	mb=peek(sr+35) : if mb>peek(m1) then mb=peek(m1)
220	if bd>mb then bd=mb
230	poke 780,bd : sys ml+33 : sys md+3
250	p=1
260	print "\S" tab(9) "Novaterm 9.6 BBS mode\q"
270	print tab(15) "Setup menu" : print tab(15) "~T~T~T~T~T~T~T~T~T~T"
280	print "\s\q\q\q\q Sysop name_ : "sy$ : \
	print " BBS name_   : "bb$
290	print " System pswd_: "pw$ : \
	print " Sysop pswd_ : "ps$
295	print "\q Init_: at" mm$ : \
	print " Baud rate_: "bd$(bd)"   "
300	print "\q Opening msg_: "f1$ : \
	print " Main menu_  : "f2$
310	print " Logoff msg_ : "f3$
320	print "\q System drive_    :" str$(dp) "," left$(dp$,1) : \
	print " Available drives_"
330	print "\q Save configuration_" : \
	print " Load configuration_" : \
	print " Start BBS_"
340	d=3 : tb=1 : mx=18 : tu=32 : gosub 3920 : poke 211,15 : if p>12 then poke 211,20
341	if p=6 then poke 211,10
342	if p=7 then 350
345	p8=peek(211) : p9=-23*(p<5)-28*(p=6)-16*(p>8 and p<12)-5*(p=13) : if p9 then gosub 2410
350	on p goto 360,380,400,410,,420,425,,430,440,450,,470,760,,660,710,960
360	sy$=i$ : goto 460
380	bb$=i$ : goto 460
400	pw$=i$ : goto 460
410	ps$=i$ : goto 460
420	mm$=i$ : goto 460
425	bd=bd+1 : if bd>mb then bd=0
426	goto 280
430	f1$=i$ : goto 460
440	f2$=i$ : goto 460
450	f3$=i$
460	print "\s" left$(dn$,p+d) tab(p8) left$(i$+sp$,p9) : goto 280
470	if i$="" then 280
480	j=0 : for i=1 to 5 : if mid$(i$,i,1)="," then j=i : i=5
490	next : if j=0 then 520
500	a=val(mid$(i$,j+1)) : if a<0 or a>99 then 520
510	dp$=mid$(str$(a),2)+":"
520	a=val(i$) : if a<>1 and (a<8 or a>30) then 280
530	close 15 : open 15,a,15 : close 15 : if (128 and st)=0 then dp=a
540	open 15,dp,15 : goto 280
660	print#15,"s" dp$ "\\bbs config" : open 2,dp,2,dp$+"\\bbs config,s,w"
670	print#2,q$ sy$ : print#2,q$ bb$ : print#2,q$ pw$ : print#2,q$ ps$ : print#2,q$ f1$
680	print#2,q$ f2$ : print#2,q$ f3$ : print#2,dp : print#2,q$ dp$
690	print#2,dd : for i=1 to dd : print#2,q$dd$(i) : print#2,d%(i) : print#2,q$ d$(i) : next
700	print#2,q$ mm$ : print#2,bd : close 2 : goto 280
710	gosub 720 : goto 280
720	open 2,dp,2,dp$+"\\bbs config" : input#15,e : if e>19 then close 2 : return
730	input#2,sy$,bb$,pw$,ps$,f1$,f2$,f3$,dp,dp$,dd
740	for i=1 to dd : input#2,dd$(i),d%(i),d$(i) : next : if st=0 then input#2,mm$,bd
750	close 2 : return
760	print "\S" tab(9) "Novaterm 9.6 BBS mode\q" : pp=p : p=1
770	print tab(9)"Disk device setup menu" : print tab(9)"~T~T~T~T~T~T~T~T~T~T~T~T~T~T~T~T~T~T~T~T~T~T"
780	print "\s\q\q\q\q Directory category      Device  Drive\q" : for i=1 to dd
790	print " " dd$ "\k" tab(24) d%(i) "\k" tab(35) left$(d$(i),len(d$(i))-1) "\k";
800	print tab(38)"_" : next : print sp$ : print " Add a directory_   "
810	print " Delete a directory_" : \
	print " Quit_              " : \
	print sp$
820	d=5 : tb=1 : mx=dd+4 : tu=32 : gosub 3920 : if p=mx then p=pp : goto 260
830	sys ml+18 : if p=mx-1 and d>1 then print "\s\w\24\q Choose a directory to delete"; : dl=1 : goto 780
840	if p=mx-2 then dl=0 : p=p-1 : print "\Q"; : if dd=10 then 780
850	if dl=0 or dd=1 then 890
860	for i=p+1 to dd : dd$(i-1)=dd$(i) : d%(i-1)=d%(i) : d$(i-1)=d$(i) : next
870	dl=0 : print "\s\w\24\q\k"; : dd=dd-1 : if p>dd then p=dd
880	goto 780
890	poke 211,1 : p9=23 : gosub 2410 : if i$>"" then dd$(p)=i$
900	if i$="" and p=mx-1 then 780
910	print "\Q"; : poke 211,27 : p9=2 : gosub 2410 : a=val(i$) : d%(p)=8 : if (a>=8 and a<=30) or a=1 then d%(p)=a
920	print "\Q"; : poke 211,35 : p9=2 : gosub 2410 : a=val(i$)
930	if a>=0 and a<100 then d$(p)=mid$(str$(a),2)+":"
940	if p>dd then dd=p
950	goto 780
960	rn=8-(peek(56577) and 8) : if peek(m1+1) and 1 then 980
970	print "\S\qSet O-A switch to Answer and hit \rReturn\R" : wait 198,1 : get a$
980	print "\S\q\q\qLast caller: " lc$ : \
	print "Off at     : "of$
990	print "\qNumber of calls :" nc : \
	print "Sysop calls     :" sc
1000	print "Uploads         :" nu : \
	print "Downloads       :" nd
1010	print "Feedback        :" nf
1020	print "\qInitializing modem..." : poke 780,bd : sys ml+33
1025	if peek(m1+1) and 1 then print#5,"atz" : for i=1 to 1000 : next : print#5,"at" mm$
1030	print "\QWaiting for call...  "
1040	print "\q\rF1\R:Quit  \rF3\R:Local mode  \rF7\R:Setup menu"
1050	poke sa+14,peek(sa+14) and 127 : lc=0 : xp=0 : sy=0 : cd=0
1060	dd$=dd$(1) : dv=d%(1) : dv$=d$(1) : close 14 : open 14,dv,15
1070	sys ml+9 : if (peek(56577) and 8)=rn then 1125
1080	sys sl+6 : if peek(780) then 1160
1090	get a$ : if a$="\E" then 2250
1100	if a$="\H" then 250
1110	if a$="\F" then print "\S\q\r Local mode " : poke sa+14,peek(sa+14) or 128 : sys md+3 : lc=1 : goto 1170
1120	goto 1070
1125	print "\qCall answered...waiting for carrier" : if (peek(m1+1) and 1)=0 then 1139
1126	i$="" : ti$="000000"
1127	if (peek(m1+1) and 8)=0 then 1132
1128	sys sl+6 : if peek(780) then 1150
1129	if val(ti$)<20 then 1128
1130	goto 980
1132	gosub 4000 : print chr$(a); : if val(ti$)=20 then 1140
1133	if a>=32 then i$=i$+chr$(a) : goto 1132
1134	if a<>13 then 1132
1135	if left$(i$,7)<>"connect" and left$(i$,7)<>"carrier" then i$="" : goto 1132
1136	if mid$(i$,9)="" then 1140
1137	for i=1 to 9 : if val(bd$(i))=val(mid$(i$,9)) then bd=i : i=8
1138	next : goto 1140
1139	sys md+6
1140	sys sl+6 : if peek(780)=0 then 980
1150	poke 780,bd : sys ml+33
1160	print "\S\q\r " bd$(bd) " baud connection " : for i=1 to 2000 : next : poke 668,peek(667)
1170	print "\r \R\157"; : if bb$="" then s$="\EWelcome to Novaterm 9.6\E" : goto 1180
1175	s$="\EWelcome to "+bb$+" on Novaterm 9.6\E"
1180	sys op : s$="\EEnter your name: " : sys op : p9=25 : gosub 2510 : if i$="" and cd=0 then 1180
1185	if cd then 980
1190	n$=i$ : tr=0 : if pw$="" then 1230
1200	s$="\EEnter system password: " : sys op : p9=25 : gosub 2510 : if i$=pw$ then 1230
1210	s$="\EInvalid password\E" : sys op : tr=tr+1 : if tr<3 then 1200
1220	s$="\EAccess denied!\E" : sys op : goto 1980
1230	gosub 3880 : t1$=tm$ : tr=0 : if n$<>sy$ then 1300
1240	s$="\EEnter sysop password: " : sys op : p9=25 : gosub 2510 : if i$=ps$ then 1270
1250	s$="\EInvalid password\E" : sys op : tr=tr+1 : if tr<2 then 1240
1260	goto 1220
1270	s$="\ESysop access granted\E" : sys op : sy=1
1280	open 2,dp,2,dp$+"feedback" : input#15,e : close 2
1290	if e=0 then s$="\EYou have messages waiting.\E" : sys op
1300	s$="\EWelcome "+n$+"!\E" : sys op : if f1$>"" then f$=f1$ : gosub 2690
1310	print "\r \R\157"; : if xp then 1420
1320	if f2$>"" then f$=f2$ : gosub 2690 : if e<20 then 1420
1330	if bb$>"" then s$="\E"+left$(sp$,(33-len(bb$))/2)+bb$+" menu\E" : sys op
1340	s$="\E[$]Directory          [R]ead textfile\E" : sys op
1350	s$="[#]Change drive       [T]erminate\E" : sys op
1360	s$="[C]hat request        [U]pload file\E" : sys op
1370	s$="[D]ownload file       [W]rite textfile\E" : sys op
1380	s$="[F]eedback to sysop   [X]pert toggle\E" : sys op
1390	s$="[P]rotocol\E" : sys op : if sy=0 then 1420
1400	s$="\E[@]Disk command       [Z]Read feedback\E" : sys op
1410	s$="[L]og of callers\E" : sys op
1420	s$="\E[$,#,C,D,F,P,R,T,U,W,X]: " : sys op
1430	gosub 2630 : if cd then 1990
1440	if a$="?" or a$="h" then s$="Menu\E" : sys op : goto 1320
1450	if a$="@" and sy then s$="Disk command\E" : sys op : goto 3830
1460	if a$="$" then s$="Directory\E" : sys op : goto 1610
1470	if a$="#" then s$="Change drive\E" : sys op : goto 2130
1480	if a$="c" then s$="Chat\E" : sys op : goto 1660
1490	if a$="d" then s$="Download\E" : sys op : goto 2730
1500	if a$="f" then s$="Feedback\E" : sys op : goto 3360
1510	if a$="l" and sy then s$="Log of callers\E" : sys op : goto 3800
1520	if a$="p" then s$="Protocol\E" : sys op : goto 1740
1530	if a$="r" then s$="Read textfile\E" : sys op : goto 1900
1540	if a$="t" then s$="Terminate\E" : sys op : goto 1950
1550	if a$="u" then s$="Upload\E" : sys op : goto 3090
1560	if a$="w" then s$="Write textfile\E" : sys op : goto 2050
1570	if a$="x" then s$="Expert toggle\E" : sys op : goto 2110
1580	if a$="z" and sy then s$="Read feedback\E" : sys op : goto 3770
1590	if a$=chr$(13) then 1310
1600	goto 1430
1610	if dd$>"" then s$="\EDirectory: "+dd$+"\E" : sys op
1620	s$="\E" : sys op : open 1,dv,0,"$"+left$(dv$,len(dv$)-1) : get#1,a$,a$
1630	sys ml+54 : if mid$(z$,7,1)="\\" and sy=0 then 1630
1640	s$=z$+"\E" : sys op : if right$(z$,1)<>"." and right$(z$,4)<>"free" then 1630
1650	close 1 : gosub 2240 : goto 1310
1660	s$="\EPaging sysop..." : sys op : j=0 : for i=1 to 5 : s$=".\g" : sys op
1670	for t=1 to 1500 : next : get a$ : if a$="\E" then j=1 : i=5
1680	next : if j=0 then s$="\E\E"+sy$+" is not available.\E" : goto 1310
1690	s$="\E\EEntering chat\E\E" : sys op : print "Press F1 to abort" : sys ml+6
1700	get a$ : gosub 4000 : if a$>"" then s$=a$ : sys op
1710	if a then s$=chr$(peek(rv+a)) : sys op
1720	if a$<>chr$(133) then 1700
1730	s$="\ELeaving chat\E" : sys op : goto 1310
1740	open 1,dp,0,"$"+dv$+"prt.*" : gosub 2340 : if er then close 1 : goto 1310
1750	get#1,a$,a$ : sys ml+54 : fl=0
1760	sys ml+54 : if right$(z$,1)="." or right$(z$,4)="free" then 1810
1770	f$="" : for i=11 to 22 : a$=mid$(z$,i,1) : if a$=chr$(34) then i=22 : goto 1790
1780	f$=f$+a$
1790	next : if f$="" then 1760
1800	fl=fl+1 : f$(fl)=f$ : goto 1760
1810	close 1 : if fl=0 then s$="\ENo protocol files\E" : goto 1310
1820	s$="\ESelect protocol:\E\E" : sys op
1830	for i=1 to fl : s$=chr$(i+192)+") "+f$(i)+"\E" : sys op : next : s$="\ESelect: " : sys op
1840	gosub 2630 : if cd then 1990
1850	if a$=chr$(13) then s$=a$ : sys op : goto 1310
1860	if a$<"a" or a$>chr$(fl+64) then 1840
1870	s$=chr$(asc(a$)+128)+"\E" : sys op : p=asc(a$)-64 : f$="prt."+f$(p)
1880	open 2,dp,0,dv$+f$ : gosub 2340 : close 2 : if er=0 then gosub 4340 : pt$=f$(p) : gosub 3070 : goto 1310
1890	s$="\EError loading protocol\E" : sys op : goto 1310
1900	s$="\EFile name: " : sys op : p9=16 : gosub 2510 : if i$="" then 1310
1905	if left$(i$,1)="\\" and sy=0 then i$=mid$(i$,2)
1910	s$="\E" : sys op : open 2,dv,2,dv$+i$+",s" : gosub 2340 : if er then 1940
1920	poke 781,2 : sys ml+60 : f=st : sys op : if f=0 then 1920
1930	gosub 2240
1940	close 2 : goto 1310
1950	gosub 2360 : if y=0 then 1310
1960	if f3$>"" then f$=f3$ : gosub 2690
1970	s$="\EGoodbye!\E" : sys op
1980	sys md : sys sl+6 : if peek(780) then for t=1 to 2500 : next : goto 1980
1990	gosub 3880 : print " " : print n$" logged out at "tm$
2000	open 2,dp,2,dp$+"\\caller log,s,a" : input#15,e
2010	if e>19 then close 2 : open 2,dp,2,dp$+"\\caller log,s,w"
2020	print#2,left$(n$+"...............................",23) t1$ "-" tm$ : close 2
2030	lc$=n$ : of$=tm$ : nc=nc+1 : if sy then sc=sc+1
2040	gosub 4090 : goto 980
2050	s$="\EFile name: " : sys op : p9=16 : gosub 2510 : if i$="" then 1310
2060	open 2,dv,2,dv$+i$+",s,w" : gosub 2340 : if er then 2100
2070	s$="\EEnter text one line at a time.\E" : sys op
2080	s$="Enter the @ symbol by itself to end.\E\E" : sys op
2090	p9=78 : gosub 2510 : if i$<>"@" then sys ml+24 : print#2,i$ : sys ml+21 : goto 2090
2100	close 2 : goto 1310
2110	xp=1-xp : if xp then s$="\EExpert mode ON\E" : sys op : goto 1310
2120	s$="\EExpert mode OFF\E" : sys op : goto 1310
2130	if dd=1 then s$="\EOnly one drive available\E" : sys op : goto 1310
2140	s$="\ESelect drive:\E\E" : sys op : for i=1 to dd : s$=chr$(i+192)+") " : sys op
2150	if dd$(i)>"" then s$=dd$(i)+"\E" : goto 2170
2160	s$="Device"+str$(d%(i))+", Drive "+left$(d$(i),len(d$(i))-1)+"\E"
2170	sys op : next : s$="\ESelect: " : sys op
2180	gosub 2630 : if cd then 1990
2190	if a$=chr$(13) then s$=a$ : sys op : goto 1310
2200	if a$<"a" or a$>chr$(dd+64) then 1840
2210	d=asc(a$)-64 : s$=chr$(d+192)+"\E" : sys op : dd$=dd$(d) : dv=d%(d) : dv$=d$(d)
2220	close 14 : open 14,dv,15 : close 14 : if 128 and st then 2140
2230	open 14,dv,15 : goto 1310
2240	if xp then return
2245	s$="\E* Hit a key *" : sys op : gosub 2630 : s$="\E" : sys op : return
2250	print "\qSave stats? \r \R\157";
2260	get a$ : if a$<>"y" and a$<>"n" then 2260
2270	if a$="n" then print "no" : goto 2300
2280	print "yes" : print#15,"s" dp$ "\\stats" : open 2,dp,2,dp$+"\\stats,s,w" : print#2,q$ lc$
2290	print#2,q$ of$ : print#2,nc : print#2,sc : print#2,nu : print#2,nd : print#2,nf : close 2
2300	poke 6,255 : open 2,dp,0,dp$+"prog menu" : input#15,e : close 2 : if e>19 then 2320
2310	load dp$+"prog menu",dp
2320	open 2,dp,0,dp$+"novaterm ?.?*" : input#15,e : close 2 : if e>19 then end
2330	loaddp$+"novaterm ?.?*",dp
2340	er=0 : input#14,e,e$ : if e>19 then er=1 : s$="\E"+e$+"\E" : sys op
2350	return
2360	s$="\EAre you sure? " : sys op
2370	gosub 2630 : if cd then y=0 : return
2380	if a$="y" then s$="yes\E" : sys op : y=1 : return
2390	if a$="n" then s$="no\E" : sys op : y=0 : return
2400	goto 2370
2410	poke 780,p9 : sys ml+39 : return
2510	i$="" : cd=0 : sys ml+21
2520	if lc=0 then gosub 4000 : if a then 2560
2530	if lc=0 then sys sl+6 : if peek(780)=0 then i$="" : cd=1 : return
2540	get a$ : if a$="" then 2520
2550	goto 2570
2560	a$=chr$(peek(rv+a))
2570	if (asc(a$) and 127)<32 then 2600
2580	if len(i$)=p9 then 2520
2590	i$=i$+a$ : s$=a$ : sys op : goto 2520
2600	if a$=chr$(20) and i$>"" then i$=left$(i$,len(i$)-1) : s$=a$ : sys op : goto 2520
2610	if a$=chr$(13) then s$=a$ : sys op : return
2620	goto 2520
2630	sys ml+21
2635	if lc=0 then gosub 4000 : if a then 2660
2640	if lc=0 then sys sl+6 : if peek(780)=0 then cd=1 : return
2650	geta$ : a=asc(a$+chr$(0)) : if a=0 then 2635
2660	a=peek(rv+a) : if a>=97 and a<=122 then a=a-32
2670	if a>=193 and a<=218 then a=a-128
2680	a$=chr$(a) : return
2690	open 2,dp,2,dp$+f$ : input#15,e : if e>19 then close 2 : return
2700	s$="\E" : sys op
2710	poke 781,2 : sys ml+60 : f=st : sys op : if f=0 then 2710
2720	close 2 : return
2730	if lc then s$="\ECan't download in local mode\E" : sys op : goto 1310
2735	s$="\EProtocol: "+pt$+"\E" : sys op : tt=0 : if (peek(pt+14) and 8) then 2890
2740	s$="\EFile name: " : sys op : p9=16 : gosub 2510 : if i$="" then 1310
2750	if left$(i$,1)="\\" and sy=0 then i$=mid$(i$,2)
2760	ts=0 : open 1,dv,0,"$"+dv$+i$ : gosub 2340 : if er then close 1 : goto 1310
2770	get#1,a$,a$ : sys ml+54 : sys ml+54 : close 1
2780	if right$(z$,1)="." or right$(z$,4)="free" then ts=1
2790	if ts then s$="\EFile not found\E" : sys op : goto 1310
2810	tt$=mid$(z$,25,3) : tp$=left$(tt$,1) : tt=-(tp$="p")-2*(tp$="s")-3*(tp$="u")
2820	s$="\EFile name: "+i$+"\EFile type: "+tt$+"\EFile blocks:"+str$(val(z$))+"\E"
2830	sys op : open 2,dv,2,dv$+i$ : gosub 2340 : if er then close 2 : goto 1310
2840	gosub 3355 : s$="\EBBS ready to send file\EPress Ctrl-X to abort\E" : sys op
2850	print " " : print "Bytes sent :           Retries:";
2860	poke pt+16,tt : sys pt-9 : print : nd=nd+1
2870	if peek(pt+15) then s$="\EDownload aborted\E" : sys op : nd=nd-1
2880	close 2 : goto 1310
2890	s$="\EEnter a blank file name to end.\E\E" : sys op : fl=0               
2900	s$="Name of file"+str$(fl+1)+": " : sys op : p9=16 : gosub 2510 : if i$="" then 2950
2910	if left$(i$,1)="\\" and sy=0 then i$=mid$(i$,2)
2920	open 2,dv,2,dv$+i$ : input#14,e : close 2 : if e>19 then 2900
2940	fl=fl+1 : f$(fl)=i$ : if fl<9 then 2900
2950	f$(fl+1)="" : if fl=0 then 1310
2960	s$="\EBBS ready to send files\EPress Ctrl-X to abort\E" : sys op
2970	sys pt-9 : ff=0 : for y=1 to fl+1 : i$=f$(y) : if i$="" then 3030
2980	open 1,dv,0,"$"+dv$+i$ : gosub 2340 : if er then close 1 : goto 1310
2990	get#1,a$,a$ : sys ml+54 : sys ml+54 : close 1
3000	tp$=mid$(z$,25,1) : tt=-(tp$="p")-2*(tp$="s")-3*(tp$="u")
3005	bl=val(z$) : s$=mid$(str$(bl*254),2)
3010	open 2,dv,2,dv$+i$ : gosub 2340 : if er then close 2 : goto 3050
3020	print " " : print "Sending " i$ : print "Bytes sent :           Retries:";
3030	poke pt+16,tt : sys pt-9 : close 2 : print
3040	if peek(pt+15) then y=fl+1
3050	ff=ff+1 : next : if peek(pt+15) then s$="\EDownload aborted\E" : sys op : ff=ff-1
3060	nd=nd+ff : goto 1310
3070	poke pt,1 : poke pt+18,dv : poke pt+21,0 : poke pt+23,sp : poke pt+24,val(dv$)
3080	poke pt+14,peek(pt+14) or 16 : return
3090	if lc then s$="\ECan't download in local mode\E" : sys op : goto 1310
3095 fl=0 : s$="\EProtocol: "+pt$+"\E" : sys op : if (peek(pt+14) and 10)=0 then 3130
3100	b$="" : if peek(pt+14) and 8 then b$="s"
3110	h$="" : s$="\EHide the file"+b$+"? " : sys op : gosub 2370 : if y then h$="\\"
3115	gosub 3355 : s$="\EBBS ready to receive file"+b$+"\EPress Ctrl-X to abort\E"
3120	sys op : print " \Q"; : goto 3300
3130	s$="\EFile name: " : sys op : p9=16 : gosub 2510 : if i$="" then 1310
3140	open 2,dv,2,dv$+i$ : input#14,e : close 2 : if e<20 then s$="\EFile exists\E" : sys op : goto 1310
3150	tp$="p" : tt$="" : if peek(pt+14) and 1 then 3220
3160	s$="\EFile type (prg,seq,usr): " : sys op
3170	gosub 2630 : if cd then 1990
3180	if a$=chr$(13) then s$=a$ : sys op : goto 1310
3190	if a$<>"p" and a$<>"s" and a$<>"u" then 3170
3200	tt=-(a$="p")-2*(a$="s")-3*(a$="u") : s$=mid$("prgsequsr",tt*3-2,3)+"\E" : sys op
3210	tp$=a$
3220	h$="" : s$="\EHide the file? " : sys op : gosub 2370 : if y then h$="\\"
3225	gosub 3355 : if peek(pt+14) and 1 then 3285
3230	tt$=","+tp$ : open 2,dv,2,dv$+h$+i$+tt$+",w" : gosub 2340 : fl=fl+1
3240	if er then close 2 : if (peek(pt+14) and 8)=0 then 1310
3250	if er and e=63 then i$=left$(i$,len(i$)-1)+chr$(asc(right$(i$,1))+1) : goto 3230
3260	if er then sys pt-3 : goto 3310
3270	a=peek(pt+14) and 11 : if a and a<8 then i$=""
3280	if i$="" then print "\Q"; : goto 3300
3285	if fl=0 or a=0 then s$="\EBBS ready to receive file\EPress Ctrl-X to abort\E" : sys op
3290	print " " : print "Receiving: " i$ tt$ : print "Bytes recv :           Retries:";
3300	poke pt+16,tt : sys pt-6 : close 2 : print  : nu=nu+1
3310	if peek(pt+15) then s$="\EUpload aborted!\E" : sys op : print#14,"s" dv$ i$ : nu=nu-1 : goto 1310
3320	if (peek(pt+14) and 11)=0 or i$="" then 1310
3330	tt=peek(pt+16) : tp$=mid$("psu",tt,1) : if tt=0 then tt=1 : tp$="p"
3340	if len(i$)>1 then if mid$(i$,len(i$)-1,1)="," then tp$=right$(i$,1) : i$=left$(i$,len(i$)-2)
3350	i$=left$(i$,16) : goto 3230
3355	s$="\EASCII translation during transfer? " : sys op : gosub 2370 : poke pt+22,y : return
3360	li=0 : gosub 3880                                      
3370	s$="\EFrom: "+n$+"\ETime: "+tm$+"\E\EEnter your message:\E\E" : sys op
3380	if li=20 then s$="\ENo more room\E" : goto 3440
3390	for i=li+1 to 20 : s$=right$(str$(i),2)+": " : sys op : p9=74 : gosub 2510 : if i$="" then li=i-1 : i=20
3400	if i$>"" then ms$(i)=i$
3410	next : if li=0 and ms$(20)>"" then li=20 : s$="\ENo more room\E" : sys op
3420	s$="\E[A]bort          [C]ontinue message\E[D]elete line    [E]dit line\E"
3430	sys op : s$="[I]nsert line    [L]ist message\E[S]ave message\E" : sys op
3440	s$="\E[A,C,D,E,I,L,S]: " : sys op
3450	gosub 2630 : if cd then 1990
3460	s$=a$+"\E" : if a$="?" then sys op : goto 3420
3470	if a$="a" then sys op : goto 3750
3480	if a$="c" then s$=s$+"\E" : sys op : goto 3380
3490	if a$="d" then sys op : goto 3580
3500	if a$="e" then sys op : goto 3610
3510	if a$="i" then sys op : goto 3650
3520	if a$="l" then sys op : goto 3680
3530	if a$="s" then sys op : goto 3700
3540	goto 3450
3550	l=0 : s$="\ELine number: " : sys op : p9=2 : gosub 2510 : if i$="" then return
3560	l=val(i$) : if l<1 or l>li then l=0
3570	return
3580	if li=0 then 3440
3590	gosub 3550 : if l=0 then 3440
3600	for i=l+1 to li : ms$(i-1)=ms$(i) : next : li=li-1 : goto 3440
3610	gosub 3550 : if l=0 then 3440
3620	s$="\E"+right$(str$(l),2)+": "+ms$(l)+"\E"+right$(str$(l),2)+": " : sys op
3630	p9=74 : gosub 2510 : if i$="" then 3440
3640	ms$(l)=i$ : goto 3440
3650	if li=20 then 3440
3660	gosub 3550 : if l=0 then 3440
3670	for i=li to l step -1 : ms$(i+1)=ms$(i) : next : li=li+1 : ms$(l)="" : goto 3440
3680	s$="\E" : sys op : for i=1 to li : s$=right$(str$(i),2)+": "+ms$(i)+"\E" : sys op : next
3690	goto 3440
3700	gosub 2360 : if y=0 then 3440
3710	s$="\ESaving...\E" : sys op : open 2,dp,2,dp$+"feedback,s,a" : input#15,e
3720	if e>19 then close 2 : open 2,dp,2,dp$+"feedback,s,w"
3730	print#2 : print#2,"From: "n$ : print#2,"Time: "tm$ : print#2
3740	for i=1 to li : print#2,ms$(i) : next : close 2 : nf=nf+1 : goto 1310
3750	gosub 2360 : if y=0 then 3440
3760	s$="\EAborted\E" : sys op : goto 1310
3770	f$="feedback" : gosub 2690 : if e>19 then s$="\ENo feedback\E" : sys op : goto 1310
3780	s$="\EDelete messages? " : sys op : gosub 2370 : if y then print#15,"s" dp$ "feedback" : nf=0
3790	goto 1310
3800	f$="\\caller log" : gosub 2690 : if e>19 then s$="\ENo caller log\E" : sys op : goto 1310
3810	s$="\EDelete caller log? " : sys op : gosub 2370 : if y then print#15,"s" dp$ "\\caller log"
3820	goto 1310
3830	s$="\EDevice"+str$(dv)+", drive "+left$(dv$,len(dv$)-1)+"\E" : sys op
3840	s$="\EDOS>" : sys op
3850	p9=50 : gosub 2510 : if i$="" then 1310
3860	print#15,i$ : input#15,e1$,e2$,e3$,e4$ : s$="\E"+e1$+","+e2$+","+e3$+","+e4$+"\E" : sys op
3870	goto 3840
3880	h=peek(56587) : m=peek(56586) : a=peek(56584)
3890	a$="am" : if h>127 then a$="pm" : h=h and 127
3900	h=h-int(h/16)*6 : m=m-int(m/16)*6 : m$=mid$(str$(m),2) : if m<10 then m$="0"+m$
3910	tm$=mid$(str$(h),2)+":"+m$+a$ : return
3920	poke 780,p : poke 781,d : poke 782,mx : poke dt+37,tu+tb : sys sl+27 : p=peek(780) : tu=0 : return
4000	sys ml+27 : a=peek(780) : if peek(783) and 1 then a=0
4010	return
4090	open 2,dp,2,dp$+"nova data 9.6" : input#15,e : if e>19 then close 2 : return
4100	input#2,v$ : if v$<>"9.6" then close 2 : return
4110	input#2,rm$,bd,di,cp$,d1,d2,d1$,c1$,d2$,c2$,d3,d3$,c3$,pn,ps,c1,c2,c3,c4
4130	input#2,b,re,c7,c8,c9,xo,xf,xp,zs,ld,c,d,e,f,pd,zr
4140	input#2,mi$,mo$,pt$,a$,a$,a$,a$,a$,sr$,a$,ts$ : close 2
4150	poke dt+25,b : poke dt+32,c and 2 : poke dt+8,d : poke 6,(peek(6) and 239) or (e and 16)
4160	poke dt+42,(e and 96)*2 : poke dt+9,c and 16
4180	if sr$>"" then f$="serial."+sr$ : gosub 4340
4185	if ts$>"" then f$="time."+ts$ : gosub 4340 : poke 780,0 : sys 49152
4190	if pt$>"" then f$="prt."+pt$ : gosub 4340 : gosub 3070 : if e>19 then pt$=a2$
4210	if mo$>"" then f$="modem."+mo$ : gosub 4340 : if e>19 then mo$=a1$
4230	f$="asc.standard" : gosub 4340
4240	poke 53280,c1 : poke 53281,c2 : poke 646,c3 : sys ml+57
4260	sys sl+51 : mb=peek(sr+35) : if peek(m1)<mb then mb=peek(m1)
4310	poke 780,bd : sys ml+33 : return
4340	sys ml+24 : poke 780,dp : poke 782,0 : f$=dp$+f$ : sys sl+21 : input#15,e : close 2 : sys ml+21 : return
