home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 1: Collection A / 17Bit_Collection_A.iso / files / 35.dms / 35.adf / ezterm.bas < prev    next >
BASIC Source File  |  1988-05-22  |  7KB  |  323 lines

  1. 0     screen 1,1,0:gosub 40000:print" F1 - Capture ON":Print " F2 - Capture OFF":print " F3 - Save Capture Buffer":print " F4 - Review Capture Buffer"
  2.  
  3. 2     print " F5 - Load Buffer for Uploading":print " F6 - Start Uploading Buffer":print " F7 - Duplex Toggle":print " F8 - Clear Buffer":print " HELP - Help!!!"
  4.  
  5. 3     print "ALT-Q - Quit Program"
  6.  
  7. 5     dim a$(6000)
  8.  
  9. 6     rem kelly kauffman, 3170 sprout way, sparks, nv, 89431:  CIS [70206,640]
  10.  
  11. 7     rgb 0,0,0,10:rgb 1,10,10,10
  12.  
  13. 10    print "A ""`"" acts as a CTRL-C at any time.":gosub 40
  14.  
  15. 12    print:print
  16.  
  17. 15    print "                           EZ-TERMINAL VER 1.17":print "                           )1985 Kelly Kauffman"
  18.  
  19. 16    ?   :?"                           FOR PUBLIC USE ONLY"
  20.  
  21. 17    ?:?:?" Put mouse in box -->     [ ]  and click LEFT button to initialize program"
  22.  
  23. 20    get char$
  24.  
  25.  
  26.  
  27. 23    if char$<>"" then if asc(char$)=155 then gosub 1000
  28.  
  29. 25    if char$="`" then char$=chr$(3)
  30.  
  31. 30    gosub 150:gosub 160:print char$;:goto 20
  32.  
  33.  
  34.  
  35. 40    'Serial I/O driver
  36.  
  37.  
  38.  
  39. 50    'config
  40.  
  41.  
  42.  
  43. 60    BAUD%=300
  44.  
  45. 70    iobase%=&hdff000
  46.  
  47.  
  48.  
  49. 80    serdatr%=&h18+iobase%
  50.  
  51.  
  52.  
  53. 90    serdat%=&h30+iobase%
  54.  
  55.  
  56.  
  57. 100   serper%=&h32+iobase%
  58.  
  59.  
  60.  
  61. 110   intreq%=&h9c+iobase%
  62.  
  63.  
  64.  
  65. 120   poke_w serper%,(1/baud%)/(.2794*1e-06)
  66.  
  67.  
  68.  
  69. 130   return
  70.  
  71.  
  72.  
  73. 140   'write
  74.  
  75.  
  76.  
  77. 150   if char$<>"" then if asc(char$)=241 then 42000
  78.  
  79. 151   if char$="" then return else poke_w serdat%,asc(char$)+256
  80.  
  81. 153   if plex=1 then print char$;
  82.  
  83. 154   if plex=1 and cap=1 then buff$=buff$+char$
  84.  
  85. 155   if plex=1 and asc(char$)=13 then print
  86.  
  87. 156   if len(buff$)>253 then gosub 20000
  88.  
  89. 157   return
  90.  
  91. 160   'read
  92.  
  93.  
  94.  
  95. 170   char%=peek_w(serdatr%)
  96.  
  97.  
  98.  
  99. 175   on error goto 0
  100.  
  101. 180   if (char% and 16384) = 0 then char$="":return
  102.  
  103.  
  104.  
  105. 185   if len(buff$)>253 then gosub 20000
  106.  
  107. 190   char$=chr$(char% and 127):poke intreq%,8:if cap=1 then buff$=buff$+char$
  108.  
  109.  
  110.  
  111. 191   return
  112.  
  113. 200   gosub 160: print char$;:goto 200
  114.  
  115. 1000  get char$
  116.  
  117. 1010  if char$="" then return
  118.  
  119. 1020  if asc(char$)<48 or asc(char$)>63 then return
  120.  
  121. 1030  if asc(char$)=48 then print "           C A P T U R E        O N ":cap=1:get char$:get char$:return
  122.  
  123. 1040  if asc(char$)=49 then print "           C A P T U R E        O F F ":cap=0:get char$:get char$:num=num+1:a$(num)=buff$:buff$="":return
  124.  
  125. 1050  if asc(char$)=50 then ?
  126.  
  127. 1060  if asc(char$)=50 and len(buff$)=0 and num=0 then print "   B U T   T H E R E'S    N O T H I N G   T O   S A V E ! ! !":get char$:get char$:return
  128.  
  129. 1065  if asc(char$)=50 then cap=0:num=num+1:a$(num)=buff$:buff$=""
  130.  
  131. 1070  if asc(char$)=50 then get char$:get char$:input "Save as ---->";file$:if file$="" then return else open "o",#4,file$:for q=0 to num:print #4,a$(q);:next q:close #4:print "   C A P T U R E   B U F F E R  S A V E D":return
  132.  
  133. 1072  if asc(char$)=51 then num=num+1:a$(num)=buff$:buff$=""
  134.  
  135. 1073  if asc(char$)=51 then scnclr:get char$:get char$:for q=0 to num:print a$(q);:get char$:if char$<>"" then print :?:?"REVIEW ABORTED":return else next q:?:?:?:?:?"Buffer Review Complete.":return
  136.  
  137. 1074  gosub 30000
  138.  
  139. 1075  get char$:get char$
  140.  
  141. 1080  return
  142.  
  143. 20000 a$(num)=buff$
  144.  
  145. 20010 num=num+1:buff$=""
  146.  
  147. 20020 return
  148.  
  149. 30000 on error goto 30999
  150.  
  151. 30001 if asc(char$)=53 then gosub 33000:return
  152.  
  153. 30010 if asc(char$)=52 then gosub 32000:return
  154.  
  155. 30020 if asc(char$)=54 then gosub 34000:return
  156.  
  157. 30030 if asc(char$)=63 then gosub 35000:return
  158.  
  159. 30040 if asc(char$)=55 then gosub 36000:return
  160.  
  161. 30999 return
  162.  
  163. 32000 scnclr
  164.  
  165. 32010 erase a$
  166.  
  167. 32020 dim a$(3000)
  168.  
  169. 32025 get char$:get char$
  170.  
  171. 32027 print at(0,0)
  172.  
  173. 32030 input "Load what Filename ------>";file$
  174.  
  175. 32035 if file$="" then print "Aborted.":goto 32512
  176.  
  177. 32036 x=instr(1,file$,".bas"):y=instr(1,file$,".BAS"):if x=0 or y=0 then bas=0 else bas=1
  178.  
  179. 32038 bas=1
  180.  
  181. 32040 close #4
  182.  
  183. 32045 num=0:erase a$:dim a$(6000)
  184.  
  185. 32050 open "i",#4,file$
  186.  
  187. 32075 on error goto 32510
  188.  
  189. 32080 if bas=1 then line input #4,buff$ else get #4,w$
  190.  
  191. 32085 if bas<>1 and w$="" then 32510
  192.  
  193. 32090 if bas=1 then a$(num)=buff$ else b=len(a$(num)):if b>253 then num=num+1:a$(num)=a$(num)+w$
  194.  
  195. 32095 if bas<>1 and b<=253 then a$(num)=a$(num)+w$
  196.  
  197. 32100 if bas=1 then num=num+1:buff$=""
  198.  
  199. 32110 if not eof(4) then 32080
  200.  
  201. 32510 print "Complete File Loaded."
  202.  
  203. 32512 on error goto 0
  204.  
  205. 32515 close #4
  206.  
  207. 32520 return
  208.  
  209. 33000 scnclr
  210.  
  211. 33010 print
  212.  
  213. 33011 get char$:get char$
  214.  
  215. 33015 if bas=1 then print "Do you want to use the prompts for every line":input yn$:if yn$="n" or yn$="N" then prompt=0 else prompt=1
  216.  
  217. 33017 print :print"Do you want a return sent after each line":input yn$:if yn$="Y" or yn$="y" then retn=1 else retn=0
  218.  
  219. 33018 scnclr
  220.  
  221. 33020 print " Beginning Upload"
  222.  
  223. 33025 get char$:get char$
  224.  
  225. 33030 for i=0 to num
  226.  
  227. 33040 for q=1 to len(a$(i))
  228.  
  229. 33045 qwer=asc(mid$(a$(i),q,1)): if bas=1 and qwer=10 then qwer=13
  230.  
  231. 33047 get char$:if char$<>"" then print:?:?"UPLOAD ABORTED BY USER":print:print:goto 33090
  232.  
  233. 33050 poke_w serdat%,qwer+256
  234.  
  235. 33053 print mid$(a$(i),q,1);
  236.  
  237. 33055 sleep 16000
  238.  
  239. 33060 next q
  240.  
  241. 33065 if retn=1 then poke_w serdat%,269:print
  242.  
  243. 33067 if prompt=1 then gosub 37000
  244.  
  245. 33070 next i
  246.  
  247. 33075 print:print
  248.  
  249. 33080 print "Buffer Upload Complete."
  250.  
  251. 33090 return
  252.  
  253. 34000 if plex=1 then plex=0:?:?:print "          F U L L   D U P L E X":goto 34020
  254.  
  255. 34010 if plex=0 then plex=1:?:?:print "          H A L F   D U P L E X"
  256.  
  257. 34020 get char$:get char$:return
  258.  
  259. 35000 scnclr
  260.  
  261. 35010 print "F1 - Turns Capture On.  All incoming data will be saved in the buffer."
  262.  
  263. 35020 print "F2 - Turns Capture Off.  No data is saved in the buffer."
  264.  
  265. 35030 print "F3 - Save Capture Buffer.  Saves the contents of the buffer to a file of your     choice."
  266.  
  267. 35040 print "F4 - Review Buffer.  Lets you see the contents of the buffer.  Press any          key during the review to abort."
  268.  
  269. 35050 print "F5 - Load Buffer.  This will load a file of your choice into the Buffer.          NOTE: It does NOT merge the data, it instead, clears out the old             information, then loads in the new."
  270.  
  271. 35060 print "F6 - Upload Buffer.  The question about prompts means that the Amiga will         wait for the computer you are hooked up with sends a prompt character.       This character is the "">"" character.  If you are sending other than a"
  272.  
  273. 35070 print "     source code, reply ""N""o to this question, then the Amiga will just           upload the entire buffer without waiting for prompts."
  274.  
  275. 35080 print "F7 - Duplex.  This toggles between half and full duplex.  When in Full            duplex, the computer you are hooked up with, must echo back what you         type in order to see what you have typed.  If the computer you are  "
  276.  
  277. 35090 print "     hooked up with does not echo back what you type, go to half duplex           and your typing will be put on the screen immediately."
  278.  
  279. 35100 print "F8 - Clear buffer.  Clears out the capture/upload/review buffer."
  280.  
  281. 35110 return
  282.  
  283. 36000 print
  284.  
  285. 36010 print
  286.  
  287. 36020 print "                B U F F E R    C L E A R E D"
  288.  
  289. 36030 erase a$
  290.  
  291. 36040 dim a$(3000)
  292.  
  293. 36050 buff$=""
  294.  
  295. 36060 return
  296.  
  297. 37000 gosub 160
  298.  
  299. 37010 if char$<>">" then 37000
  300.  
  301. 37020 return
  302.  
  303. 40000 rem draw windows for Function definitions
  304.  
  305. 40010 window #1,0,200,640,100
  306.  
  307. 40020 print #1,inverse(1);"F1";inverse(0);"-Cap On ";inverse(1);"F2";inverse(0);"-Cap Off ";inverse(1);"F3";inverse(0);"-Save ";inverse(1);"F4";inverse(0);"-Review ";inverse(1);"F5";inverse(0);
  308.  
  309. 40030 print #1,"-Load ";inverse(1);"F6";inverse(0);"-Upload ";inverse(1);"F7";inverse(0);"-Duplex ";inverse(1);"F8";inverse(0);"-Clear";
  310.  
  311. 40040 window #2,0,0,640,186
  312.  
  313. 40050 cmd 2
  314.  
  315. 40060 return
  316.  
  317. 42000 close #1,2
  318.  
  319. 42010 end
  320.  
  321.  
  322.  
  323.