home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / TURBOPAS / PMODEM.ARK / IO.INC < prev    next >
Text File  |  1987-02-22  |  2KB  |  119 lines

  1. {********** io.inc **********}
  2.  
  3.  
  4. procedure Modem_Out_Line(Line: data2); forward;
  5.  
  6. Procedure Init_Modem;
  7. {Initialize modem port}
  8. begin
  9.   ch_init;
  10.   mdinit;
  11.   {set default values}
  12.   duplex:= true;
  13.   hiBaud:= true;
  14.   capture:= false;
  15.   filter:= true;
  16.   delay_set:= true;
  17.   command_file:= false;
  18.   do_command:= false;
  19.   log_on:= true;
  20.   autolog:= false;
  21.   slowbaud:= false;
  22.   host_mode:= false;
  23.   phone_buffer:= '';
  24.   wait:= 3;
  25. end;  {Init_Modem}
  26.  
  27. Function Carrier : boolean;
  28. {Return TRUE if carrier present}
  29. begin
  30.   Carrier:= ch_carck;
  31. end; {Carrier}
  32.  
  33. Function Modem_In_Ready : boolean;
  34. {Return TRUE if modem character ready}
  35. begin
  36.   Modem_In_Ready:= ch_inprdy;
  37. end; {Modem_In_Status}
  38.  
  39. Function GetMod : char;
  40. {Read the modem input port, assume char ready}
  41. begin
  42.   GetMod:= chr(ch_inp);
  43. end; {GetMod}
  44.  
  45. Function Modem_In : char;
  46. {Read the modem input port}
  47. begin
  48.   repeat until modem_in_ready;
  49.   Modem_In:= GetMod;
  50. end;  {Modem_In}
  51.  
  52. Procedure Modem_Out(ch: char);
  53. {Output a character to the modem}
  54.  
  55. begin
  56.   ch_out(ord(ch));
  57. end;  {Modem_Out}
  58.  
  59. procedure sinp(var ch: char);
  60. {direct I/O from keyboard}
  61. {may use keypressed for status}
  62. begin
  63.   ch:= chr(bdos(6,$FF));
  64. end; {sinp}
  65.  
  66. procedure resetCRT;
  67. {clear screen and reset CRT}
  68. begin
  69.   write(ESC, 'z');  {for Heath H-19}
  70. {  attention; }
  71.   delay(100);
  72. end;  {resetCRT}
  73.  
  74. Procedure Set_LoBaud; {300 baud}
  75. begin
  76.   if HiBaud then begin
  77.     HiBaud:= false;
  78.     ch_set(300);
  79.   end;
  80. end;  {Set_LoBaud}
  81.  
  82. Procedure Set_HiBaud; {1200 baud}
  83. begin
  84.   if not HiBaud then begin
  85.     HiBaud:= true;
  86.     slowbaud:= false;
  87.     ch_set(1200);
  88.   end;
  89. end;  {Set_HiBaud}
  90.  
  91. procedure timeout;
  92. {turn off disk drive motor}
  93. begin
  94.   port[$34]:= 0;
  95. end; {timeout}
  96.  
  97. procedure timein;
  98. {turn disk drive motor back on}
  99. begin
  100.   port[$34]:= $21;
  101. end; {timein}
  102.  
  103.  
  104. procedure attention; {previously referenced}
  105. {let the modem catch its breath}
  106. begin
  107.   ch_out(ord(CR));
  108. end;  {attention}
  109.  
  110. Procedure Go_Onhook;
  111. begin
  112.   mdhangup;
  113. end;  {Go_Onhook}
  114.  
  115. Procedure go_Dial(line: data);
  116. begin
  117.   Modem_Out_Line('ATDP '+ line);
  118. end; {go_Dial}
  119.