home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / ECO30603.ZIP / ECO30603.LZH / ECOLIBNG / SOURCE / ECO_UNIT.DAT < prev    next >
Encoding:
Text File  |  1992-07-06  |  72.0 KB  |  1,970 lines

  1. !short  Unit ECO_232;               Direct CathodeRayTube COM control
  2. unit ECO_232;
  3. interface
  4. uses crt;
  5.   procedure assignaux(var f: text; port,params: word);
  6.  
  7. !short  Unit ECO_adpt;              Adapter recognition
  8.  
  9. type 
  10.   adaptertype = (
  11.     none,mda,hercules,cga,egamono,egacolor,mcgamono,mcgacolor,
  12.     vgamono,vgacolor
  13.   );
  14.  
  15.  
  16. var
  17.   checksnow          : boolean;     {for snow on cga}
  18.   currenttextmode    : word;        {current video text mode}
  19.  
  20.   videopage          : byte;        {video page number}
  21.   videocard          : adaptertype; {video kaart}
  22.   maxrows            : byte;        {current max number of colums and lines}
  23.   maxcols            : byte;
  24.   videoofs           : word;        {offset video memory}
  25.   videoseg           : word;        {start video memory}
  26.   videoptr           : pointer absolute videoofs;
  27.   startupmode        : word;        {videomode at startup time}
  28.   startupcursorsize  : word;        {cursor size at startup time}
  29.  
  30.   procedure initdetect; {will fill all vars with rigth values}
  31.  
  32.   function  basescreen : word;
  33.  
  34.   function  systemid : byte; {returns system id}
  35.  
  36.   function  getvideopage : byte;
  37.   procedure setvideopage(page : byte);
  38.  
  39.   function  getvideomode : word;
  40.   procedure settextmode(mode : integer);
  41.  
  42.   function colormonitor : boolean;
  43.  
  44.   (* cursor manipulation *)
  45.   function  getcursorshape : word;
  46.   procedure setcursorshape(scanlines : word);
  47.  
  48.   (* desqview support *)
  49.   const in_dv : boolean = false;
  50.  
  51.   function  dv_get_version : word;
  52.   function  dv_get_video_buffer(videoseg : word) : word;
  53.   procedure dv_pause;
  54.   procedure dv_begin_critical;
  55.   procedure dv_end_critical;
  56.  
  57.  
  58. !short  Unit ECO_asyn;              Direct Asynchronous card control
  59. unit ECO_asyn;
  60. interface
  61. uses dos, crt;
  62.  
  63. const (* 8086/8088 hardware flags *)
  64.   ff   =  12; (* form feed       *)   cr   =  13; (* carriage return *)
  65.   dle  =  16; (* data link esc.  *)   xon  =  17; (* xon             *)
  66.   xoff =  19; (* xoff            *)   sub  =  26; (* end of file     *)
  67.   esc  =  27; (* escape          *)   del  = 127; (* delete          *)
  68.   fk_cr          :       char =  '|'; (* function key definition cr        *)
  69.   fk_delay       :       char =  '~'; (* function key def. 1 sECOnd wait   *)
  70.   fk_wait_for    :       char =  '`'; (* function key wait for next char   *)
  71.   fk_ctrl_mark   :       char =  '^'; (* marks next char as ctrl character *)
  72.   fk_script_ch   :       char =  '@'; (* script to execute follows         *)
  73.   fk_delay_time  :    integer =   10; (* delay to insert between each char *)
  74.   bs_string      :     string =   ^h; (* string to send when back space hit*)
  75.   ctrl_bs_string :     string = #127; (* string to send when ctrl bs hit   *)
  76.  
  77.   half_sECOnd_delay       =  500;    one_sECOnd_delay        = 1000;
  78.   two_sECOnd_delay        = 2000;    three_sECOnd_delay      = 3000;
  79.   tenth_of_a_sECOnd_delay = 100;     on   = true; off  = false;
  80.  
  81.   data_bits     : 5..8 = 8;          parity        : char = 'N';
  82.   stop_bits     : 0..2 = 1;          comm_port     : 1..4 = 1;
  83.   baud_rate     : 110..38400 = 2400; cmd_line_port : 0..4 = 0;
  84.  
  85.   n_baud_rates = 11;
  86.   baud_rates: array[ 1 .. n_baud_rates ] of word =
  87.       ( 110, 150, 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600 );
  88.  
  89.   modem_init          : string   = 'ATZ|~ATX1|';
  90.   modem_dial          : string[30] = 'ATDT';
  91.   modem_dial_end      : string[30] = '|';
  92.   modem_busy          : string[30] = 'BUSY';
  93.   modem_connect       : string[30] = 'CONNECT';
  94.   modem_no_carrier    : string[30] = 'NO CARRIER';
  95.   modem_escape        : string[30] = '+++';
  96.   modem_escape_time   : integer  = 1500;
  97.   modem_hang_up       : string[30] = 'ATH0|';
  98.   modem_time_out      : longint  = 60;
  99.   modem_redial_delay  : longint  = 45;
  100.   modem_answer        : string[30] = 'ATA|';
  101.   modem_host_set      : string   = 'ATZ|~ATX1|~ATS0=1|';
  102.   modem_host_unset    : string   = 'ATZ|~ATX1|~ATS0=0|';
  103.   modem_command_delay : integer  = 10;
  104.   modem_carrier_high  : boolean  = false;
  105.   modem_ring          : string[30] = 'RING';
  106.   host_auto_baud      : boolean  = true;
  107.   modem_hold_line     : boolean  = false;
  108.  
  109. (*                 communications hardware addresses                   *)
  110. (*       these are specific to ibm pcs and close compatibles.          *)
  111.   uart_thr = $00;       (* offset from base of uart registers for ibm pc *)
  112.   uart_rbr = $00; uart_ier = $01; uart_iir = $02; uart_lcr = $03;
  113.   uart_mcr = $04; uart_lsr = $05; uart_msr = $06;
  114.  
  115.   i8088_imr = $21;      (* port address of the interrupt mask register *)
  116.  
  117.   com1_base = $03f8;    (* port addresses for the uart *)
  118.   com2_base = $02f8; com3_base = $03e8; com4_base = $02e8;
  119.   com1_irq = 4;         (* interrupt line for the uart *)
  120.   com2_irq = 3; com3_irq = 4; com4_irq = 3;
  121.   com1_int = $0c;       (* interrupt number for the uart *)
  122.   com2_int = $0b; com3_int = $0c; com4_int = $0b;
  123.  
  124.   rs232_base = $0400    (* address of rs 232 com port pointer *);
  125.   maxcomports = 4       (* four ports allowed by this code    *);
  126.                                   (* port addresses of each com port *)
  127.   default_com_base : array[1..maxcomports] of word =
  128.     ( com1_base, com2_base, com3_base, com4_base );
  129.                                   (* irq line for each port *)
  130.   default_com_irq  : array[1..maxcomports] of integer =
  131.     ( com1_irq, com2_irq, com3_irq, com4_irq );
  132.                                   (* interrupt for each port *)
  133.   default_com_int  : array[1..maxcomports] of integer =
  134.     ( com1_int, com2_int, com3_int, com4_int );
  135.  
  136. (*──────────────────────────────────────────────────────────────────────*)
  137. (*                                                                      *)
  138. (*                   communications buffer variables                    *)
  139. (*                                                                      *)
  140. (*     the communications buffers are implemented as circular (ring)    *)
  141. (*     buffers, or double-ended queues.  the asynchronous i/o routines  *)
  142. (*     enter characters in the receive buffer as they arrive at the     *)
  143. (*     serial port.  higher-level routines may extract characters from  *)
  144. (*     the receive buffer at leisure.  higher-level routines insert     *)
  145. (*     characters into the send buffer.  the asynchronous i/o routines  *)
  146. (*     then send characters out the serial port when possible.          *)
  147. (*                                                                      *)
  148. (*──────────────────────────────────────────────────────────────────────*)
  149.    timeout             = 256        (* timeout value                   *);
  150.    async_xon           = ^q         (* xon character                   *);
  151.    async_xoff          = ^s         (* xoff character                  *);
  152.    async_overrun_error = 2          (*   overrun                       *);
  153.    async_parity_error  = 4          (*   parity error                  *);
  154.    async_framing_error = 8          (*   framing error                 *);
  155.    async_break_found   = 16         (*   break interrupt               *);
  156.    async_cts           = $10        (*   clear to send                 *);
  157.    async_rts           = $20        (*   request to send               *);
  158.    async_dsr           = $20        (*   data set ready                *);
  159.    async_dtr           = $10        (*   data terminal ready           *);
  160.    async_rtsdtr        = $30        (*   rts + dtr                     *);
  161.  
  162. type                                (* i/o buffer type for serial port *)
  163.    async_buffer_type   = array[0..1] of char;
  164.    async_ptr           = ^async_buffer_type;
  165. var                                 (* port addresses for serial ports *)
  166.    com_base               : array[1..maxcomports] of word;
  167.                                     (* irq line for each serial port   *)
  168.    com_irq                : array[1..maxcomports] of integer;
  169.                                     (* interrupt for each serial port   *)
  170.    com_int                : array[1..maxcomports] of integer;
  171.    async_buffer_ptr       : async_ptr  (* input buffer address  *);
  172.    async_obuffer_ptr      : async_ptr  (* output buffer address *);
  173.    async_open_flag        : boolean    (* true if port opened               *);
  174.    async_port             : integer    (* current open port number (1 ── 4) *);
  175.    async_base             : integer    (* base for current open port        *);
  176.    async_irq              : integer    (* irq for current open port         *);
  177.    async_int              : integer    (* interrupt # for current port      *);
  178.    async_rs232            : integer    (* rs232 address for current port    *);
  179.    async_buffer_overflow  : boolean    (* true if buffer overflow has happened *);
  180.    async_buffer_used      : integer    (* amount of input buffer used so far   *);
  181.    async_maxbufferused    : integer    (* maximum amount of input buffer used  *);
  182.                                        (* async_buffer empty if head = tail    *)
  183.    async_buffer_head      : integer    (* loc in async_buffer to put next char *);
  184.    async_buffer_tail      : integer    (* loc in async_buffer to get next char *);
  185.    async_buffer_newtail   : integer    (* for updating tail value              *);
  186.    async_obuffer_overflow : boolean    (* true if buffer overflow has happened *);
  187.    async_obuffer_used     : integer    (* amount of output buffer used         *);
  188.    async_maxobufferused   : integer    (* max amount of output buffer used     *);
  189.                                        (* async_buffer empty if head = tail    *)
  190.    async_obuffer_head     : integer    (* loc in async_buffer to put next char *);
  191.    async_obuffer_tail     : integer    (* loc in async_buffer to get next char *);
  192.    async_obuffer_newtail  : integer    (* for updating tail value              *);
  193.    async_buffer_low       : integer    (* low point in receive buffer for xon  *);
  194.    async_buffer_high      : integer    (* high point in receive buffer for xoff*);
  195.    async_buffer_high_2    : integer    (* emergency point for xoff             *);
  196.    async_xoff_sent        : boolean    (* if xoff sent                      *);
  197.    async_sender_on        : boolean    (* if sender is enabled              *);
  198.    async_send_xoff        : boolean    (* true to send xoff asap            *);
  199.    async_xoff_received    : boolean    (* if xoff received                  *);
  200.    async_xoff_rec_display : boolean    (* if xoff received and displayed    *);
  201.    async_xon_rec_display  : boolean    (* if xon received                   *);
  202.    async_baud_rate        : word       (* current baud rate                 *);
  203.                                    (* save previous serial interrupt status *)
  204.    async_save_iaddr       : pointer;
  205.    async_do_cts           : boolean (* true to do clear-to-send checking    *);
  206.    async_do_dsr           : boolean (* true to do data-set-ready checking   *);
  207.    async_do_xonxoff       : boolean (* true to do xon/xoff flow checking    *);
  208.    async_ov_xonxoff       : boolean (* true to do xon/xoff if buffer overfl *);
  209.    async_hard_wired_on    : boolean (* true if hard-wired connection        *);
  210.    async_break_length     : integer (* length of break in 1/10 sECOnds      *);
  211.    async_line_status      : byte    (* line status reg at interrupt         *);
  212.    async_modem_status     : byte    (* modem status reg at interrupt        *);
  213.    async_line_error_flags : byte    (* line status bits accumulated         *);
  214.    async_buffer_size      : integer (* stores input buffer size             *);
  215.    async_obuffer_size     : integer (* stores output buffer size            *);
  216.    async_uart_ier         : integer (* interrupt enable register address    *);
  217.    async_uart_mcr         : integer (* interrupt enable register address    *);
  218.    async_uart_iir         : integer (* interrupt id register address        *);
  219.    async_uart_msr         : integer (* modem status register address        *);
  220.    async_uart_lsr         : integer (* line status register address         *);
  221.    async_output_delay     : integer (* delay in ms when output buffer full  *);
  222.    async_onemsdelay       : integer (* loop count value to effect 1 ms delay*);
  223.    async_buffer_length    : integer (* receive buffer length                *);
  224.    async_obuffer_length   : integer (* send buffer length                   *);
  225.                                     (* pointer to async_send routine        *)
  226.    async_send_addr        : async_ptr;
  227.    break_length           :   integer;
  228.    current_carrier_status,
  229.    new_carrier_status,
  230.    attended_mode,
  231.    hard_wired,
  232.    reset_comm_port,
  233.    comm_port_changed,
  234.    check_cts,check_dsr,
  235.    do_xon_xoff_checks     : boolean;
  236.  
  237. (*──────────────────────────────────────────────────────────────────────*)
  238. (*                       multitasker definitions                        *)
  239. (*──────────────────────────────────────────────────────────────────────*)
  240.  
  241. type multitaskertype   = ( multitasker_none, doubledos, desqview, topview,
  242.                            mswindows, apxcore, ezdosit, concurrent_dos,
  243.                            taskview, multilink, other );
  244. var timesharingactive: boolean;    (* true if multitasker active        *)
  245.                                    (* which multitasker active          *)
  246.           multitasker: multitaskertype;
  247.  
  248. (*──────────────────────────────────────────────────────────────────────*)
  249. (*              dos jump stuff                                          *)
  250. (*──────────────────────────────────────────────────────────────────────*)
  251.  
  252. (* var *) const
  253.    heaptop           : pointer = nil   (* top of heap at program start       *);
  254.    stacksafetymargin : word    = 1000  (* safety margin for stack            *);
  255.    minspacefordos    : word    = 20000 (* minimum bytes for dos shell to run *);
  256.  
  257.  
  258. procedure bios_rs232_init( comport : integer; comparm : word );
  259. procedure async_close( drop_dtr: boolean );
  260. procedure async_clear_errors;
  261. procedure async_reset_port(
  262.   comport       : integer;
  263.   baudrate      : word;
  264.   parity        : char;
  265.   wordsize      : integer;
  266.   stopbits      : integer
  267. );
  268. function  async_open(
  269.   comport       : integer;
  270.   baudrate      : word;
  271.   parity        : char;
  272.   wordsize      : integer;
  273.   stopbits      : integer
  274. ) : boolean;
  275. procedure async_send( c : char );
  276. function async_receive( var c : char ) : boolean;
  277. procedure async_receive_with_timeout( secs : integer; var c : integer );
  278. procedure async_stuff( ch: char );
  279. procedure async_find_delay( var one_ms_delay : integer );
  280. procedure async_init(
  281.   async_buffer_max  : integer;
  282.   async_obuffer_max : integer;
  283.   async_high_lev1   : integer;
  284.   async_high_lev2   : integer;
  285.   async_low_lev     : integer
  286. );
  287. function  async_carrier_detect : boolean;
  288. function  async_carrier_drop : boolean;
  289. procedure async_term_ready( ready_status : boolean );
  290. function  async_buffer_check : boolean;
  291. function  async_line_error( var error_flags: byte ) : boolean;
  292. function  async_ring_detect : boolean;
  293. procedure async_send_break;
  294. procedure async_send_string( s : string );
  295. procedure async_send_string_with_delays(
  296.    s          : string;
  297.    char_delay : integer;
  298.    eos_delay  : integer
  299. );
  300. function  async_percentage_used : real;
  301. procedure async_purge_buffer;
  302. function  async_peek( nchars : integer ) : char;
  303. procedure async_setup_port(
  304.   comport       : integer;
  305.   base_address  : integer;
  306.   irq_line      : integer;
  307.   int_numb      : integer
  308. );
  309. procedure async_release_buffers;
  310. procedure async_flush_output_buffer;
  311. procedure async_drain_output_buffer( max_wait_time : integer );
  312. function  async_port_address_given( com_port : integer ) : boolean;
  313. procedure async_send_now( c : char );
  314. function  async_wait_for_quiet(
  315.   max_wait : longint;
  316.   wait_time: longint
  317. ) : boolean;
  318.  
  319.  
  320. procedure send_modem_command(modem_text: string);
  321. function  set_params(first_time: boolean): boolean;
  322. procedure initialize_modem;
  323.  
  324. !short  Unit ECO_atv;               Archive television ARC/ARJ/LZH/PAK/ZIP/ZOO
  325. unit ECO_atv;
  326. interface
  327. uses
  328.   dos, crt, unit_pgm,
  329.   unit_scn, unit_str,
  330.   unit_fil,
  331.   ECO_cfi,  ECO_vid,
  332.   ECO_str,  ECO_ext,
  333.   ECO_fil,
  334.   execswap
  335.  
  336.   ;
  337.  
  338.  
  339. type
  340.   cfgtype = record
  341.     applic_f, applic_b,
  342.     applic_h,
  343.     x1, y1, x2, y2      : byte;
  344.   end;
  345.  
  346.   optiontype = (o_unpak, o_delete, o_nothing);
  347.  
  348.   arcpanelobj = object
  349.     ful, quit,
  350.     showmem,
  351.     showreads,
  352.     complete_error : boolean;
  353.     treewidth,
  354.     status,
  355.     error          :    word;
  356.     cfg            : cfgtype;
  357.     mfree          : longint;
  358.     nulstr,
  359.     olddir         : pathstr;
  360.     wst            :  string;
  361.     {=Internal===============================================================}
  362.     function pak_tv(arc: pathstr; var opt: optiontype): boolean;
  363.     {=External===============================================================}
  364.     function atv(arcname: pathstr): boolean;
  365.   end; { arcpanelobj }
  366.  
  367.  
  368. !short  Unit ECO_bcnv;              Base conversion calculation functions
  369. unit ECO_bcnv;
  370. interface
  371. type
  372.   basestr = string[32];
  373.  
  374. var
  375.   baseerror: byte;
  376.  
  377. function base(x:longint;b:byte):basestr;                  {convert x to base b}
  378. function basef(x:longint;b,f:byte):basestr;      {convert x to base b length f}
  379. function hex(x:longint):basestr;                         {convert x to base 16}
  380. function hexf(x:longint;f:byte):basestr;        {convert x to base 16 length f}
  381. function dez(x:basestr;s:byte):longint;      {convert x from base s to decimal}
  382. function dezh(x:basestr):longint;            {convert hexadecimal x to decimal}
  383.  
  384. !short  Unit ECO_cal;               Popup calendar
  385. unit ECO_cal;
  386. interface
  387.  
  388.   procedure calendaraction;
  389.  
  390.  
  391. !short  Unit ECO_calc;              Extensive scientific calculator functions
  392. unit ECO_calc;
  393. interface
  394.  
  395. type
  396.   degreetype =  record
  397.     degrees, minutes, sECOnds : real;
  398.   end;
  399.  
  400. const
  401.   infinity = 9.9999999999e+37;
  402.  
  403. {  radians  }
  404. { sin, cos, and arctan are predefined }
  405.  
  406. function tan( radians : real ) : real;
  407. function arcsin( invalue : real ) : real;
  408. function arccos( invalue : real ) : real;
  409.  
  410. {  degrees, expressed as a real number  }
  411.  
  412. function degreestoradians( degrees : real ) : real;
  413. function radianstodegrees( radians : real ) : real;
  414. function sin_degree( degrees : real ) : real;
  415. function cos_degree( degrees : real ) : real;
  416. function tan_degree( degrees : real ) : real;
  417. function arcsin_degree( degrees : real ) : real;
  418. function arccos_degree( degrees : real ) : real;
  419. function arctan_degree( degrees : real ) : real;
  420.  
  421. {  degrees, in degrees, minutes, and sECOnds, as real numbers  }
  422.  
  423. function degreepartstodegrees( degrees, minutes, sECOnds : real ) : real;
  424. function degreepartstoradians( degrees, minutes, sECOnds : real ) : real;
  425. procedure degreestodegreeparts( degreesin : real;
  426.                                 var degrees, minutes, sECOnds : real );
  427. procedure radianstodegreeparts( radians : real;
  428.                                 var degrees, minutes, sECOnds : real );
  429. function sin_degreeparts( degrees, minutes, sECOnds : real ) : real;
  430. function cos_degreeparts( degrees, minutes, sECOnds : real ) : real;
  431. function tan_degreeparts( degrees, minutes, sECOnds : real ) : real;
  432. function arcsin_degreeparts( degrees, minutes, sECOnds : real ) : real;
  433. function arccos_degreeparts( degrees, minutes, sECOnds : real ) : real;
  434. function arctan_degreeparts( degrees, minutes, sECOnds : real ) : real;
  435.  
  436. {  degrees, expressed as degreetype ( reals in record ) }
  437.  
  438. function degreetypetodegrees( degreevar : degreetype ) : real;
  439. function degreetypetoradians( degreevar : degreetype ) : real;
  440. procedure degreetypetodegreeparts( degreevar : degreetype;
  441.                                    var degrees, minutes, sECOnds : real );
  442. procedure degreestodegreetype( degrees : real; var degreevar : degreetype );
  443. procedure radianstodegreetype( radians : real; var degreevar : degreetype );
  444. procedure degreepartstodegreetype( degrees, minutes, sECOnds : real;
  445.                                    var degreevar : degreetype );
  446. function sin_degreetype( degreevar : degreetype ) : real;
  447. function cos_degreetype( degreevar : degreetype ) : real;
  448. function tan_degreetype( degreevar : degreetype ) : real;
  449. function arcsin_degreetype( degreevar : degreetype ) : real;
  450. function arccos_degreetype( degreevar : degreetype ) : real;
  451. function arctan_degreetype( degreevar : degreetype ) : real;
  452.  
  453. {  hyperbolic functions  }
  454.  
  455. function sinh( invalue : real ) : real;
  456. function cosh( invalue : real ) : real;
  457. function tanh( invalue : real ) : real;
  458. function coth( invalue : real ) : real;
  459. function sech( invalue : real ) : real;
  460. function csch( invalue : real ) : real;
  461. function arcsinh( invalue : real ) : real;
  462. function arccosh( invalue : real ) : real;
  463. function arctanh( invalue : real ) : real;
  464. function arccoth( invalue : real ) : real;
  465. function arcsech( invalue : real ) : real;
  466. function arccsch( invalue : real ) : real;
  467.  
  468. {  logarithms, powers, and roots  }
  469.  
  470. { e to the x  is  exp() }
  471. { natural log is  ln()  }
  472. function log10( innumber : real ) : real;
  473. function log( base, innumber : real ) : real;  { log of any base }
  474. function power( innumber, exponent : real ) : real;
  475. function root( innumber, theroot : real ) : real;
  476.  
  477.  
  478. !short  Unit ECO_cfi;               C.F.I. = Compression File Interface
  479. unit ECO_cfi; { cfi = compression file interface }
  480. interface
  481. uses
  482.   dos
  483.  
  484.   ;
  485.  
  486. const
  487.   cfismartmode : boolean = false; { niet verder zoeken na geen hit }
  488.   cfisfx       : boolean = false; {       niet in exe & com kijken }
  489.  
  490. type
  491.   cfityperecord = record
  492.     cfiname      : string[67]; {filename only 12 chars!!!!!} {even meer !!}
  493.     cfipath      : string[67]; {directory if used}
  494.     cficrc       : longint;    {crc check}
  495.     cfipsize     : longint;    {packed size file}
  496.     cfiosize     : longint;    {original size file}
  497.     cfitime      : longint;    {dos packed time}
  498.     cfiattr      : byte;       {zip and lzh/lzs only}
  499.     cfimethod    : word;       {soort compressie}
  500.     cfiptotal    : longint;    {total packed size}
  501.     cfiototal    : longint;    {total original size}
  502.   end;
  503.   str79          = string[79];
  504.   str8           = string[8];
  505.  
  506.  
  507. var
  508.   cfierror          : boolean;
  509.   cfifile           : file;                          { used by all routines }
  510.   cfipos            : longint;               { position where info begins!! }
  511.   cfifilename       : str79;
  512.   cfitype           : cfityperecord;
  513.   cfityp            : byte;                { type archive : zoo, arc, lzh etc }
  514.   readcentralheader : boolean; { read also zip central header default false }
  515.  
  516.  
  517.  
  518.   procedure closecfi;
  519.   function opencfifile(f : str79) : boolean;
  520.   function cfinext : boolean;
  521.   function dectohex(l: longint; cfityp: byte) : str8;
  522.  
  523.  
  524. !short  Unit ECO_crc;               16 and 32 bit Cyclic Redundancy Check Functions
  525. unit ECO_crc;
  526.  
  527. interface
  528.  
  529.   function __crc32(value: byte; crc: longint) : longint;
  530.   function __crc16(value: byte; crc: word)    :    word;
  531.  
  532. usage by ultihouse; init:
  533.  
  534. var
  535.   crc16,
  536.   crc32  : longint;
  537.  
  538. begin
  539.   crc16 := $0000;
  540.   crc32 := $ffffffff;
  541.   crc16 := __crc16(xxxx, crc16);
  542.   crc32 := __crc32(xxxx, crc32);
  543. end;
  544.  
  545.  
  546.  
  547. !short  Unit ECO_crt                Replacement CRT unit (ASM'd)
  548.  
  549. const
  550.   bw40                      = 0;{40x25 b/w on cga}
  551.   co40                      = 1;{40x25 color on cga}
  552.   bw80                      = 2;{80x25 b/w on cga}
  553.   co80                      = 3;{80x25 color on cga}
  554.   mono                      = 7;{80x25 b/w on mda or hgc}
  555.   font8x8                   = 256;{43-/50-line mode ega/vga}
  556.   co132x25                  = 85;{color 132x25 line mode ega paradise 480}
  557.   co132x43                  = 84;{color 132x43 line mode ega paradise 480}
  558.   mo132x25                  = 86;{mono 132x25 line mode ega paradise 480}
  559.   mo132x43                  = 87;{mono 132x43 line mode ega paradise 480}
  560.   c40                       = co40;{for 3.0 compatibility}
  561.   c80                       = co80;{for 3.0 compatibility}
  562.  
  563.   black                     = $00;
  564.   blue                      = $01;
  565.   green                     = $02;
  566.   cyan                      = $03;
  567.   red                       = $04;
  568.   magenta                   = $05;
  569.   brown                     = $06;
  570.   lightgray                 = $07;
  571.   darkgray                  = $08;
  572.   lightblue                 = $09;
  573.   lightgreen                = $0a;
  574.   lightcyan                 = $0b;
  575.   lightred                  = $0c;
  576.   lightmagenta              = $0d;
  577.   yellow                    = $0e;
  578.   white                     = $0f;
  579.   blink                     = $80;
  580.  
  581.   blackbg                   = $00;
  582.   bluebg                    = $10;
  583.   greenbg                   = $20;
  584.   cyanbg                    = $30;
  585.   redbg                     = $40;
  586.   magentabg                 = $50;
  587.   brownbg                   = $60;
  588.   lightgraybg               = $70;
  589.  
  590.  
  591. type
  592.   adaptertype = (
  593.     none,mda,hercules,cga,egamono,egacolor,mcgamono,mcgacolor,
  594.     vgamono,vgacolor
  595.   );
  596.   
  597.   charset     = set of char; {makkelijk}
  598.  
  599.   stscreen    = string[132]; {max screen lengte i know is possible}
  600.   bordertypes               = (nobrdr,
  601.                                spacebrdr,singlebrdr,doublebrdr,
  602.                                horizdoublevertsinglebrdr,
  603.                                horizsinglevertdoublebrdr,
  604.                                hatch1brdr,hatch2brdr,hatch3brdr);
  605.  
  606.   borders                   = (horiztop, horizbottom,
  607.                                vertleft, vertright, horizborders,
  608.                                vertborders, allborders);
  609.   borderparts               = (tl,tr,bl,br,ht,hb,vr,vl,lc,rc,tc,bc,cc);
  610.   borderarray               = array[tl..cc] of char;
  611.  
  612. const
  613.   borderst : array [spacebrdr..hatch3brdr] of borderarray = (
  614.     '█████████████',
  615.     '┌┐└┘──││├┤┬┴┼',
  616.     '╔╗╚╝══║║╠╣╦╩╬',
  617.     '╒╕╘╛══││╞╡╤╧╪',
  618.     '╓╖╙╜──║║╟╢╥╙╫',
  619.     '░░░░░░░░░░░░░',
  620.     '▒▒▒▒▒▒▒▒▒▒▒▒▒',
  621.     '▓▓▓▓▓▓▓▓▓▓▓▓▓'
  622.    );
  623.  
  624. type
  625.   largearray     = array [1..32000] of word;
  626.  
  627.   savescrptr     = ^savescrrec;
  628.   savescrrec     = record
  629.    screensize   : word;
  630.    savedscr     : largearray;
  631.   end;
  632.  
  633.   quickwindowptr = ^quickwindowrec;
  634.   quickwindowrec = record
  635.    previous      : quickwindowptr; { is nil when last window }
  636.    windowinfo    : savescrptr; { window size,saved screen }
  637.    x1,y1,
  638.    x2,y2         : byte; { absolute screen coordiantes }
  639.    bt            : bordertypes;
  640.    sscrolllock   : boolean; { saved scrolllock status }
  641.    signorewindow : boolean; { saved ignorewindow }
  642.    sscanlines    : word; { cursor scan lines }
  643.    sx,sy         : byte; { cursor position }
  644.    swindmin,
  645.    swindmax      : word; { saved previous window }
  646.    stextattr     : byte; { saved textattr }
  647.   end;
  648.  
  649.  
  650. var
  651.   checksnow          : boolean absolute eco_adpt.checksnow;{for snow on cga}
  652.   textattr           : byte;{back and foreground color}
  653.   windmin            : word;{window coordinaten}
  654.   windmax            : word;
  655.   lastmode           : word absolute eco_adpt.currenttextmode;
  656.  
  657.   (* extra vars not in borland's CRT *)
  658.   videopage          : byte absolute eco_adpt.videopage;{video page number}
  659.   videocard          : adaptertype absolute eco_adpt.videocard; {video kaart}
  660.   maxrows            : byte absolute eco_adpt.maxrows;{current max number }
  661.   maxcols            : byte absolute eco_adpt.maxcols;{ of colums and lines}
  662.   videoofs           : word absolute eco_adpt.videoofs;{offset video memory}
  663.   videoseg           : word absolute eco_adpt.videoseg;{start video memory}
  664.   videoptr           : pointer absolute eco_adpt.videoptr;
  665.   scrolllockscreen   : boolean;{scroll screen;normaal is false}
  666.   startupmode        : word absolute eco_adpt.startupmode;{videomode at startup time}
  667.   startupcursorsize  : word absolute eco_adpt.startupcursorsize;
  668.   ignorewindow       : boolean; { if true abs screen coordinates are in use }
  669.   visiblequickwindow : quickwindowptr; { active quick window }
  670.  
  671.  
  672.   procedure textmode(mode : integer);
  673.   
  674.   procedure window(x1,y1,x2,y2 : byte);
  675.   procedure clrscr;
  676.   procedure clrline(y : byte);
  677.   procedure clreol;
  678.   
  679.   procedure delline;
  680.   procedure insline;
  681.   
  682.   procedure normvideo;
  683.   procedure lowvideo;
  684.   procedure highvideo;
  685.   
  686.   procedure textbackground(color : byte);
  687.   procedure textcolor(color : byte);
  688.   
  689.   procedure gotoxy(x,y : byte);
  690.   function  wherey : byte;
  691.   function  wherex : byte;
  692.   procedure gotoxyabs(x,y : byte);
  693.   function  whereyabs : byte;
  694.   function  wherexabs : byte;
  695.   
  696.   function  windowcols : byte;
  697.   function  windowrows : byte;
  698.   
  699.   function  readword : word;
  700.    inline($b8/$00/$00/           { mov ax,0        }
  701.           $cd/$16);              { int 16h         }
  702.   
  703.   function  readkey : char;
  704.   function  keypressed : boolean;
  705.   
  706.   procedure delay(ms : word);
  707.   procedure sound(hz : word);
  708.   procedure nosound;
  709.   
  710.   procedure assigncrt(var f : text);
  711.   
  712.   function  location(x,y : byte) : word;
  713.   procedure fillword(var dest;width,value : word);
  714.   
  715.   procedure scrollup(x1,y1,x2,y2,color : byte);
  716.   procedure scrolldown(x1,y1,x2,y2,color : byte);
  717.   
  718.   procedure fastwrite(x,y,attr : byte;st : stscreen);
  719.   procedure fastpwrite(x,y : byte;st : stscreen);
  720.   procedure changeattr(x,y,attr,len : byte);
  721.   procedure titleengine(x1,y1,x2,y2 : byte;bt : bordertypes;
  722.                         var title : stscreen);
  723.   procedure boxengine(x1,y1,x2,y2,attr : byte;
  724.                       bordertype : bordertypes;filled : boolean);
  725.   
  726.   procedure movefromscreen(var source,dest;length : word);
  727.   procedure movetoscreen(var source,dest;length : word);
  728.   
  729.   (* cursor manipulation *)
  730.   procedure normalcursor;
  731.   procedure insertcursor;
  732.   procedure halfcursor;
  733.   procedure hidecursor;
  734.   
  735.   (* screen save/restore procedures *)
  736.   function  savepartscreen(x1,y1,x2,y2 : byte) : savescrptr;
  737.   procedure restorepartscreen(var scrptr : savescrptr;x1,y1,x2,y2 : byte);
  738.   procedure disposepartscreen(var scrptr : savescrptr);
  739.   
  740.   (* quick window interface *)
  741.   procedure quickopenwindow(x1,y1,x2,y2,attr : byte;bt : bordertypes;
  742.                             st : stscreen);
  743.   procedure quickmovewindow(x,y : byte);
  744.   procedure quickclosewindow;
  745.  
  746. !short  Unit ECO_dos                DOS unit replacement (ASM'd)
  747.  
  748. const
  749.   (* flags bit masks *)
  750.  
  751.   fcarry     = $0001;
  752.   fparity    = $0004;
  753.   fauxiliary = $0010;
  754.   fzero      = $0040;
  755.   fsign      = $0080;
  756.   foverflow  = $0800;
  757.  
  758.   (* file mode magic numbers *)
  759.  
  760.   fmclosed = $d7b0;
  761.   fminput  = $d7b1;
  762.   fmoutput = $d7b2;
  763.   fminout  = $d7b3;
  764.  
  765.   (* file attribute constants *)
  766.  
  767.   readonly  = $01;
  768.   hidden    = $02;
  769.   sysfile   = $04;
  770.   volumeid  = $08;
  771.   directory = $10;
  772.   archive   = $20;
  773.   anyfile   = $3f;
  774.  
  775. type (* string types *)
  776.  
  777.   comstr  = string[127];        { command line string }
  778.   pathstr = string[79];         { full file path string }
  779.   dirstr  = string[67];         { drive and directory string }
  780.   namestr = string[8];          { file name string }
  781.   extstr  = string[4];          { file extension string }
  782.   filestr = string[12];         { file name + extension string }
  783.  
  784.   (* registers record used by intr and msdos *)
  785.  
  786.   registers = record
  787.    case integer of
  788.     0 : (ax,bx,cx,dx,bp,si,di,ds,es,flags : word);
  789.     1 : (al,ah,bl,bh,cl,ch,dl,dh : byte);
  790.   end;
  791.  
  792.    (* typed-file and untyped-file record *)
  793.  
  794.   filerec = record
  795.    handle   : word;
  796.    mode     : word;
  797.    recsize  : word;
  798.    private  : array [1..26] of byte;
  799.    userdata : array [1..16] of byte;
  800.    name     : array [0..79] of char;
  801.   end;
  802.  
  803.   (* textfile record *)
  804.  
  805.   textbuf = array [0..127] of char;
  806.   textrec = record
  807.    handle    : word;
  808.    mode      : word;
  809.    bufsize   : word;
  810.    private   : word;
  811.    bufpos    : word;
  812.    bufend    : word;
  813.    bufptr    : ^textbuf;
  814.    openfunc  : pointer;
  815.    inoutfunc : pointer;
  816.    flushfunc : pointer;
  817.    closefunc : pointer;
  818.    userdata  : array [1..16] of byte;
  819.    name      : array [0..79] of char;
  820.    buffer    : textbuf;
  821.   end;
  822.  
  823.   (* search record used by findfirst and findnext *)
  824.  
  825.   searchrec = record
  826.    fill : array [1..21] of byte;
  827.    attr : byte;
  828.    time : longint;
  829.    size : longint;
  830.    name : string[12];
  831.   end;
  832.  
  833.   (* date and time record used by packtime and unpacktime *)
  834.  
  835.   datetime = record
  836.    year,month,day,hour,min,sec : word;
  837.   end;
  838.  
  839. var 
  840.   doserror : integer;  (* error status variable *)
  841.  
  842.  
  843.  
  844.   function  dosversion : word;
  845.   procedure intr(intno : byte;var regs : registers);
  846.   procedure msdos(var regs : registers);
  847.   procedure getdate(var year,month,day,dayofweek : word);
  848.   procedure setdate(year,month,day : word);
  849.   procedure gettime(var hour,minute,second,sec100 : word);
  850.   procedure settime(hour,minute,second,sec100 : word);
  851.   procedure getcbreak(var break : boolean);
  852.   procedure setcbreak(break : boolean);
  853.   procedure getverify(var verify : boolean);
  854.   procedure setverify(verify : boolean);
  855.   function  diskfree(drive : byte) : longint;
  856.   function  disksize(drive : byte) : longint;
  857.   procedure getfattr(var f;var attr : word);
  858.   procedure setfattr(var f;attr : word);
  859.   procedure getftime(var f;var time : longint);
  860.   procedure setftime(var f;time : longint);
  861.   procedure findfirst(path : pathstr;attr : word;var f : searchrec);
  862.   procedure findnext(var f : searchrec);
  863.   procedure unpacktime(p : longint;var t : datetime);
  864.   procedure packtime(var t : datetime;var p : longint);
  865.   procedure getintvec(intno : byte;var vector : pointer);
  866.   procedure setintvec(intno : byte;vector : pointer);
  867.   procedure swapvectors;
  868.   procedure keep(exitcode : word);
  869.   procedure exec(path : pathstr;comline : comstr);
  870.   function  dosexitcode : word;
  871.   function  fsearch(path : pathstr;dirlist : string) : pathstr;
  872.   function  fexpand(path : pathstr) : pathstr;
  873.   procedure fsplit(path : pathstr;var dir : dirstr;
  874.                    var name : namestr;var ext : extstr);
  875.   function  envcount : integer;
  876.   function  envstr(index : integer) : string;
  877.   function  getenv(envvar : string) : string;
  878.   
  879.   function  isdevice(handle : word) : boolean;
  880.   function  fileexist(f : pathstr) : boolean;
  881.   function  filename(path : pathstr) : filestr;
  882.   function  pathname(path : pathstr) : dirstr;
  883.   function  filenamehasext(path : pathstr;var dotpos : byte) : boolean;
  884.   procedure defaultextension(ext : extstr;var path : pathstr);
  885.   procedure cleanfilename(var path : pathstr);
  886.   
  887.  
  888. !short  Unit ECO_dsqv               DesqView Compatibility Box
  889. unit ECO_dsqv;
  890. interface
  891. uses
  892.   dos
  893.  
  894.   ;
  895.  
  896. type   str2   = string[2];
  897.  
  898. var
  899.   desqresult  :      byte;
  900.   desqregs    : registers;
  901.   desqversion :      word;
  902.  
  903.  
  904.   function desqviewpresent:boolean;
  905.   procedure starttask(x: str2);
  906.   procedure giveupcpu;
  907.   procedure giveupidle;
  908.   procedure exittask;
  909.  
  910.  
  911.  
  912. !short  Unit ECO_emou;              Extended Mouse Function Library
  913. unit ECO_emou;
  914. interface
  915. uses
  916.   dos
  917.  
  918.   ;
  919.  
  920.  
  921. const
  922.   leftbutton   = 1;                                    {what the buttons are}
  923.   rightbutton  = 2;
  924.   centerbutton = 4;
  925.  
  926.   standard     = 1;                              {graphic cursor definitions}
  927.   uparrow      = 2;
  928.   downarrow    = 3;
  929.   leftarrow    = 4;
  930.   rightarrow   = 5;
  931.   checkmark    = 6;
  932.   uphand       = 7;
  933.   downhand     = 8;
  934.   lefthand     = 9;
  935.   righthand    = 10;
  936.   stophand     = 11;
  937.   hourglass    = 12;
  938.   diagcross    = 13;
  939.   rectcross    = 14;
  940.   rectbox      = 15;
  941.   targetcross  = 16;
  942.   targetcircle = 17;
  943.   targetbox    = 18;
  944.   questionmark = 19;
  945.  
  946.   maxmousecursorshape = 19;
  947.  
  948. {---------------------------------------------------------------------------}
  949. {externally accessable variables}
  950.  
  951. var
  952.  
  953.   mouse_installed    : boolean;   {initmouse - true if mouse is operable}
  954.   mouse_error        : integer;   {initmouse - error code}
  955.   mouse_type         : integer;   {initmouse - mouse type}
  956.  
  957.   mouse_clicked      : boolean;   {readmouse - true if button was clicked}
  958.   mouse_buttons      : word;      {readmouse - current mouse button status}
  959.   mouse_click_button : word;      {readmouse - click button status}
  960.   mousex             : word;      {readmouse - mouse text x position}
  961.   mousey             : word;      {readmouse - mouse text y position}
  962.   click_mousex       : word;      {readmouse - text x click position}
  963.   click_mousey       : word;      {readmouse - text y click position}
  964.   real_mousex        : word;      {readmouse - real mouse x position}
  965.   real_mousey        : word;      {readmouse - real mouse y position}
  966.  
  967.   mousetextwidth     : word;      {size of text on screen for mouse}
  968.   mousetextheight    : word;
  969.  
  970. {---------------------------------------------------------------------------}
  971. type
  972.   masktype = record                      {mouse graphic cursor definition}
  973.     def: array [0..1, 0..15] of word;     {graphics cursor def}
  974.     hotx, hoty: integer;                       { hot spot x,y }
  975.   end;
  976.  
  977. procedure initmouse;
  978. procedure showmouse;
  979. procedure hidemouse;
  980. procedure readmouse;
  981. procedure setmouseposition(x, y : word);
  982. procedure setmousepoint(x, y : word);
  983. function mousepress(
  984.   button: word;
  985.   var count, lastx, lasty: word
  986. ): word;
  987. function mouserelease(
  988.   button: word;
  989.   var count, lastx, lasty: word
  990. ): word;
  991. procedure setmousearea(x1,y1,x2,y2: word);
  992. procedure setmouseboxarea(var r);
  993. procedure mousegraphiccursor(shape: integer);
  994. procedure setmousegraphiccursor(var mask:masktype);
  995. procedure mousetextcursor(select, start, stop: word);
  996. procedure readmickey(var x, y: word);
  997. procedure setmouseisr(mask:word; var address);
  998. procedure lightpen(flag: boolean);
  999. procedure setpixeltomickey(x, y: word);
  1000. procedure hidemousearea(x1,y1,x2,y2: word);
  1001. procedure hidemouseboxarea(var r);
  1002. procedure mousethreshold(threshold:word);
  1003. procedure swapmouseisr(var mask:word; var address);
  1004. procedure setmousepage(page: word);
  1005. function getmousepage: word;
  1006. function mousein(x1,y1,x2,y2: word):boolean;
  1007. function mouseinbox(var r): boolean;
  1008. function mouseclick: boolean;
  1009. function mouseclickin(x1,y1,x2,y2: word): boolean;
  1010. function mouseclickinbox(var r): boolean;
  1011. function pushmouse: boolean;
  1012. function popmouse: boolean;
  1013. procedure zapmousestack;
  1014.  
  1015.  
  1016. !short  Unit ECO_exe;               Interrupt Connection With Host Program
  1017. unit ECO_exe;
  1018. interface
  1019. uses
  1020.    dos
  1021.  
  1022.    ;
  1023.  
  1024. type
  1025.   combuffer = record                 { exec communications buffer       }
  1026.     ident     : array[1..8] of char; { identification       }
  1027.     comvector : word;                { address stored here  }
  1028.     common    : pointer;             { common data address  }
  1029.     comsize   : word;                { common data size     }
  1030.     progpath  : string[67];          { next program         }
  1031.     cmdline   : string[127];         { next command line    }
  1032.     default   : string[67];          { default program      }
  1033.     comspec   : string[67];          { command full path    }
  1034.     lasterror : word;                { last dos 4b error    }
  1035.   end;
  1036.   combufptr = ^combuffer;
  1037.  
  1038.  
  1039. function getptr(vector : byte) : combufptr;
  1040. function cseg_t(var comseg,compars : word; vector : byte) : word;
  1041. function chain_t(prog,cmd : string; vector : byte) : word;
  1042. function default_t(prog : string; vector : byte) : word;
  1043.  
  1044.  
  1045. !short  Unit ECO_ext;               Powertools Base Extension Unit
  1046. unit ECO_ext;
  1047. interface
  1048. uses
  1049.   unit_key, unit_mnu,
  1050.   unit_sup, unit_fil,
  1051.   unit_scn, unit_str,
  1052.   unit_mou,
  1053.   ECO_time, dos
  1054.  
  1055.   ;
  1056.  
  1057.  
  1058. const
  1059.   bioskeybuffer= $f;
  1060.   only         =$40;     notnone      = $80;
  1061.  
  1062.   _period      = $342e;  _colon       = $273a;  _c_2= $0300;
  1063.   _slash       = $352f;  _padslash    = $e02f;  _c_6= $071e;
  1064.                                                 _c_minus = $0c1f;
  1065.   _left        = $4be0;  _padleft     = $4b00;
  1066.   _cleft       = $73e0;  _cpadleft    = $7300;
  1067.   _right       = $4de0;  _padright    = $4d00;
  1068.   _cright      = $74e0;  _cpadright   = $7400;
  1069.   _up          = $48e0;  _padup       = $4800;
  1070.   _down        = $50e0;  _paddown     = $5000;
  1071.   _pgup        = $49e0;  _padpgup     = $4900;
  1072.   _pgdn        = $51e0;  _padpgdn     = $5100;
  1073.   _home        = $47e0;  _padhome     = $4700;
  1074.   _chome       = $7700;  _end         = $4fe0;
  1075.   _padend      = $4f00;  _cend        = $7500;
  1076.   _ins         = $52e0;  _padins      = $5200;
  1077.   _del         = $53e0;  _paddel      = $5300;
  1078.   _spaddel     = $532e;  _backspace   = $0e08;
  1079.   _minus       = $0c2d;  _padminus    = $4a2d;
  1080.   _plus        = $0d2b;  _padplus     = $4e2b;
  1081.   _star        = $092a;  _padstar     = $372a;
  1082.   _enter       = $1c0d;  _newline     = $1c0a;
  1083.   _padenter    = $e00d;
  1084.  
  1085.   _tab         = $0f09;  _s_tab       = $0f00;
  1086.   _esc         = $011b;  _space       = $3920;
  1087.  
  1088.   _a    = $1e61;  _b     = $3062;  _s_a  = $1e41;  _s_b   = $3042;
  1089.   _c    = $2e63;  _d     = $2064;  _s_c  = $2e43;  _s_d   = $2044;
  1090.   _e    = $1265;  _f     = $2166;  _s_e  = $1245;  _s_f   = $2146;
  1091.   _g    = $2267;  _h     = $2368;  _s_g  = $2247;  _s_h   = $2348;
  1092.   _i    = $1769;  _j     = $246a;  _s_i  = $1749;  _s_j   = $244a;
  1093.   _k    = $256b;  _l     = $266c;  _s_k  = $254b;  _s_l   = $264c;
  1094.   _m    = $326d;  _n     = $316e;  _s_m  = $324d;  _s_n   = $314e;
  1095.   _o    = $186f;  _p     = $1970;  _s_o  = $184f;  _s_p   = $1950;
  1096.   _q    = $1071;  _r     = $1372;  _s_q  = $1051;  _s_r   = $1352;
  1097.   _s    = $1f73;  _t     = $1474;  _s_s  = $1f53;  _s_t   = $1454;
  1098.   _u    = $1675;  _v     = $2f76;  _s_u  = $1655;  _s_v   = $2f56;
  1099.   _w    = $1177;  _x     = $2d78;  _s_w  = $1157;  _s_x   = $2d58;
  1100.   _y    = $1579;  _z     = $2c7a;  _s_y  = $1559;  _s_z   = $2c5a;
  1101.  
  1102.   _c_a  = $1e01;  _c_b   = $3002;  _a_a  = $1e00;  _a_b   = $3000;
  1103.   _c_c  = $2e03;  _c_d   = $2004;  _a_c  = $2e00;  _a_d   = $2000;
  1104.   _c_e  = $1205;  _c_f   = $2106;  _a_e  = $1200;  _a_f   = $2100;
  1105.   _c_g  = $2207;  _c_h   = $2308;  _a_g  = $2200;  _a_h   = $2300;
  1106.   _c_i  = $1709;  _c_j   = $240a;  _a_i  = $1700;  _a_j   = $2400;
  1107.   _c_k  = $250b;  _c_l   = $260c;  _a_k  = $2500;  _a_l   = $2600;
  1108.   _c_m  = $320d;  _c_n   = $310e;  _a_m  = $3200;  _a_n   = $3100;
  1109.   _c_o  = $180f;  _c_p   = $1910;  _a_o  = $1800;  _a_p   = $1900;
  1110.   _c_q  = $1011;  _c_r   = $1312;  _a_q  = $1000;  _a_r   = $1300;
  1111.   _c_s  = $1f13;  _c_t   = $1414;  _a_s  = $1f00;  _a_t   = $1400;
  1112.   _c_u  = $1615;  _c_v   = $2f16;  _a_u  = $1600;  _a_v   = $2f00;
  1113.   _c_w  = $1117;  _c_x   = $2d18;  _a_w  = $1100;  _a_x   = $2d00;
  1114.   _c_y  = $1519;  _c_z   = $2c1a;  _a_y  = $1500;  _a_z   = $2c00;
  1115.  
  1116.   _f1   = $3b00;  _f2    = $3c00;  _f3   = $3d00;  _f4    = $3e00;
  1117.   _f5   = $3f00;  _f6    = $4000;  _f7   = $4100;  _f8    = $4200;
  1118.   _f9   = $4300;  _f10   = $4400;
  1119.  
  1120.   _s_f1 = $5400;  _s_f2  = $5500;  _s_f3 = $5600;  _s_f4  = $5700;
  1121.   _s_f5 = $5800;  _s_f6  = $5900;  _s_f7 = $5a00;  _s_f8  = $5b00;
  1122.   _s_f9 = $5c00;  _s_f10 = $5d00;
  1123.  
  1124.   _c_f1 = $5e00;  _c_f2  = $5f00;  _c_f3 = $6000;  _c_f4  = $6100;
  1125.   _c_f5 = $6200;  _c_f6  = $6300;  _c_f7 = $6400;  _c_f8  = $6500;
  1126.   _c_f9 = $6600;  _c_f10 = $6700;
  1127.  
  1128.   _a_f1 = $6800;  _a_f2  = $6900;  _a_f3 = $6a00;  _a_f4  = $6b00;
  1129.   _a_f5 = $6c00;  _a_f6  = $6d00;  _a_f7 = $6e00;  _a_f8  = $6f00;
  1130.   _a_f9 = $7000;  _a_f10 = $7100;
  1131.  
  1132.  
  1133. type
  1134.   mouseaction = (mleft, mmiddle, mright, mboth, mmove, mnoaction);
  1135.   filestr = string[12];
  1136.   str3    =  string[3];
  1137.  
  1138.   reflowinfo = record { for powertools menus }
  1139.     off, hioff:    byte;
  1140.     key       :   _keys;
  1141.     prot      : boolean;
  1142.   end;
  1143.  
  1144.  
  1145. const
  1146.   viewer : string[12]  = ' l.com ';
  1147.  
  1148.  
  1149. var
  1150.   { mouse }
  1151.   keypoller      : pointer;
  1152.   moldx, moldy   :    word;
  1153.  
  1154.   { keyboard }
  1155.   lastkey        :    char;
  1156.   lastscan       :    byte;
  1157.  
  1158.  
  1159.   { extended supplement }
  1160.   function  __attr(f, b: byte): byte;
  1161.   procedure __coordmou(var x: word; var y: word);
  1162.   procedure __delay(w: word);
  1163.   procedure __delaykey(w:word);
  1164.   procedure __fastkey;
  1165.   function  __funcmou(var b: word; var x: word; var y: word): mouseaction;
  1166.   function  __isboxmou(x1, y1, x2, y2, cx, cy: word): boolean;
  1167.   function  __keypressed: boolean;
  1168.   function  __keyword(k: _keys): word;
  1169.   function  __main(b: longint; w: word): longint;
  1170.   function  __max(v1, v2: longint): longint;
  1171.   function  __min(v1, v2: longint): longint;
  1172.   function  __power(x,y: integer): longint;
  1173.   function  __readkey: char;
  1174.   function  __retdow(y, m, d: word): word;
  1175.   function  __retkey: word;
  1176.   function  __str(st: string): integer;
  1177.   function  __today: byte;
  1178.   function  __val(st: string): longint;
  1179.  
  1180.  
  1181.  
  1182. !short  Unit ECO_fido;              FIDO Protocol Function Compatibility Box
  1183. unit ECO_fido;
  1184. interface
  1185. uses
  1186.   dos, crt,
  1187.   unit_str, unit_fil,
  1188.   ECO_str,  ECO_ext
  1189.  
  1190.   ;
  1191.  
  1192. type
  1193.   netmsg = record        { netmessage record structure }
  1194.     from,
  1195.     too        : string[35];
  1196.     subject    : string[71];
  1197.     date       : string[19];
  1198.     timesread,
  1199.     destnode,
  1200.     orignode,
  1201.     cost,
  1202.     orignet,
  1203.     destnet,
  1204.     replyto,
  1205.     attr,
  1206.     nextreply  : word;
  1207.     areaname   : string[20];
  1208.   end;
  1209.  
  1210.   pktheader = record        { packet header of packet }
  1211.     orignode,
  1212.     destnode,
  1213.     year,
  1214.     month,
  1215.     day,
  1216.     hour,
  1217.     minute,
  1218.     sECOnd,
  1219.     baud,
  1220.     orignet,
  1221.     destnet     : word;
  1222.   end;
  1223.  
  1224.   pktmessage = record        { packet header of each individual message }
  1225.     orignode,
  1226.     destnode,
  1227.     orignet,
  1228.     destnet,
  1229.     attr,
  1230.     cost        : word;
  1231.     date        : string[19];
  1232.     too         : string[35];
  1233.     from        : string[35];
  1234.     subject     : string[71];
  1235.     areaname    : string[20];
  1236.   end;
  1237.  
  1238.   archivename = record        { internal record structure used for     }
  1239.     mynet,       { determining the name of of an echomail }
  1240.     mynode,      { archive. i.e. 00fa1fd3.mo1             }
  1241.     hisnet,
  1242.     hisnode     : word;
  1243.   end;
  1244.  
  1245.  
  1246. const                        { attribute flags }
  1247.   _private  = $0001;
  1248.   _crash    = $0002;
  1249.   _recvd    = $0004;
  1250.   _sent     = $0008;
  1251.   _file     = $0010;
  1252.   _forward  = $0020;     { also know as in-transit }
  1253.   _orphan   = $0040;
  1254.   _killsent = $0080;
  1255.   _local    = $0100;
  1256.   _hold     = $0200;
  1257.   _freq     = $0800;
  1258.  
  1259.   months    : array[1..12] of string[3] = (
  1260.     'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'
  1261.   );
  1262.  
  1263.  
  1264. var
  1265.   net    :      netmsg;
  1266.   ph     :   pktheader;
  1267.   pm     :  pktmessage;
  1268.   arcn   : archivename;
  1269.  
  1270.  
  1271. function  packetname_                      :  string;
  1272. function  packetmessage_                   :  string;
  1273. function  packetheader_                    :  string;
  1274. function  netmessage_                      :  string;
  1275. function  getpath_(var fname : string)     : boolean;
  1276. function  getnet_(gn : string)             :  string;
  1277. function  getnode_(gn : string)            :  string;
  1278. function  msgdatestamp_                    :  string;
  1279. function  lastmsgnum_( _netpath : string ) : integer;
  1280. function  hex_ (n : word)                  :  string;
  1281. function  archivename_                     :  string;
  1282. procedure expandnodenumbers_(var list : string; var totalnumber : integer );
  1283. procedure convertnetnode_(netnode : string; var net, node : word);
  1284.  
  1285.  
  1286. !short  Unit ECO_fil;               PowerTools File Extension Box Functions
  1287. unit ECO_fil;
  1288. interface
  1289. uses
  1290.   dos,      unit_str,
  1291.   unit_sup, unit_fil,
  1292.   ECO_ext,  ECO_str
  1293.  
  1294.  
  1295.   ;
  1296.  
  1297.  
  1298. type
  1299.   searchrecord = record
  1300.     attr   :       byte;
  1301.     time   :    longint;
  1302.     size   :    longint;
  1303.     name   : string[12];
  1304.    {fill   : array[1..21] of byte; we don't need that!}
  1305.   end;
  1306.  
  1307.  
  1308. const
  1309.   only = $40; notnone = $80;
  1310.  
  1311.  
  1312. var
  1313.   _dosdrv        : integer;
  1314.   _dosdrvchar    :    char;
  1315.   _doscurpath    : pathstr;
  1316.   _dosdiscfree,
  1317.   _dosdiscsize   : longint;
  1318.  
  1319.  
  1320.  
  1321.   { extended file supplement }
  1322.   function  __attrfilter(fileattr, filter: byte): boolean;
  1323.   function  __comexebatfilter(s: namestr): boolean;
  1324.   function  __curdir: string;
  1325.   function  __delvlfil(drive: char) : boolean;
  1326.   function  __deverr: string;
  1327.   procedure __drvparm(drv: char);
  1328.   procedure __erasefiles(s: string);
  1329.   function  __existpath(s: string): boolean;
  1330.   function  __extractext(name: pathstr): str3;
  1331.   function  __extractname(s : string): string;
  1332.   function  __extractpath(s : string): string;
  1333.   function  __findfil(f: string; var s: string): boolean;
  1334.   function  __inparams(s: string): boolean;
  1335.   function  __packfil(str: string; size: byte): string;
  1336.   procedure __parsefil(name: filestr; var nam: namestr; var ext: extstr);
  1337.   function  __retdfil(drive: char) : byte;
  1338.   function  __reteqfil(drv: char; var errorcode: byte): char;
  1339.   function  __searchrec(
  1340.     src                  : searchrec;
  1341.     nm, woord, mainsize  :      word;
  1342.     takemainsize, extended,
  1343.     ampm, show_attr,
  1344.     wide                 :   boolean
  1345.   ): string;
  1346.   procedure __srec2srec(s: searchrec; var s2: searchrecord);
  1347.   function  __seteqfil(drv: char; var errorcode: byte): char;
  1348.   function  __sizefil(pt: string): longint;
  1349.   procedure __speedfil;
  1350.   function  __strattr(attr: byte): string;
  1351.  
  1352.  
  1353.  
  1354. !short  Unit ECO_fosl;              IFNA/FIDO FOSSIL Functions
  1355. unit ECO_fosl;
  1356. interface
  1357. uses
  1358.   dos, crt
  1359.  
  1360.   ;
  1361.  
  1362.  
  1363. var
  1364.   regs: registers;
  1365.  
  1366.  
  1367. function  fos_atcmd_      (comport_  : byte;  command_: string): boolean;
  1368. function  fos_avail_      (comport_  : byte): boolean;
  1369. function  fos_cd_         (comport_  : byte): boolean;
  1370. function  fos_checkmodem_ (comport_  : byte): boolean;
  1371. function  fos_empty_      (comport_  : byte): boolean;
  1372. function  fos_hangup_     (comport_  : byte): boolean;
  1373. function  fos_oktosend_   (comport_  : byte): boolean;
  1374. function  fos_receive_    (comport_  : byte): char;
  1375. procedure fos_reboot_;
  1376. procedure fos_ansi_       (character : char);
  1377. procedure fos_bios_       (character : char);
  1378. procedure fos_clear_regs_;
  1379. procedure fos_close_      (comport_  : byte);
  1380. procedure fos_dtr_        (comport_  : byte;  state: boolean);
  1381. procedure fos_flow_       (comport_  : byte;  state: boolean);
  1382. procedure fos_flush_      (comport_  : byte);
  1383. procedure fos_init_       (comport_  : byte);
  1384. procedure fos_kill_out_   (comport_  : byte);
  1385. procedure fos_kill_in_    (comport_  : byte);
  1386. procedure fos_parms_      (comport_  : byte;  baud: integer; databits: byte;
  1387.                                               parity: char;   stopbit: byte);
  1388. procedure fos_string_     (comport_  : byte;  outstring: string);
  1389. procedure fos_stringcrlf_ (comport_  : byte;  outstring: string);
  1390. procedure fos_watchdog_   (comport_  : byte;  state: boolean);
  1391. procedure fos_write_      (comport_  : byte;  character: char);
  1392.  
  1393.  
  1394.  
  1395. !short  Unit ECO_kbd;               Extended Keyboard Functions
  1396. unit ECO_kbd;
  1397. interface
  1398.  
  1399. const
  1400.   enableenhanced : boolean = true;  { false disables intr }
  1401.   digits : array[0..$f] of char = '0123456789ABCDEF';
  1402.  
  1403. {    plain               shifted              control            alternate  }
  1404.  
  1405. _esc       =$011b;_s_esc       =$011b;_c_esc       =$011b;_a_esc       =$0100;
  1406. _f1        =$3b00;_s_f1        =$5400;_c_f1        =$5e00;_a_f1        =$6800;
  1407. _f2        =$3c00;_s_f2        =$5500;_c_f2        =$5f00;_a_f2        =$6900;
  1408. _f3        =$3d00;_s_f3        =$5600;_c_f3        =$6000;_a_f3        =$6a00;
  1409. _f4        =$3e00;_s_f4        =$5700;_c_f4        =$6100;_a_f4        =$6b00;
  1410. _f5        =$3f00;_s_f5        =$5800;_c_f5        =$6200;_a_f5        =$6c00;
  1411. _f6        =$4000;_s_f6        =$5900;_c_f6        =$6300;_a_f6        =$6d00;
  1412. _f7        =$4100;_s_f7        =$5a00;_c_f7        =$6400;_a_f7        =$6e00;
  1413. _f8        =$4200;_s_f8        =$5b00;_c_f8        =$6500;_a_f8        =$6f00;
  1414. _f9        =$4300;_s_f9        =$5c00;_c_f9        =$6600;_a_f9        =$7000;
  1415. _f10       =$4400;_s_f10       =$5d00;_c_f10       =$6700;_a_f10       =$7100;
  1416. _f11       =$8500;_s_f11       =$8700;_c_f11       =$8900;_a_f11       =$8b00;
  1417. _f12       =$8600;_s_f12       =$8800;_c_f12       =$9000;_a_f12       =$8c00;
  1418. _pad_slash =$e02f;_s_pad_slash =$e02f;_c_pad_slash =$9500;_a_pad_slash =$a400;
  1419. _asterisk  =$372a;_s_asterisk  =$372a;_c_asterisk  =$7200;_a_asterisk  =$3700;
  1420. _pad_minus =$4a2d;_s_pad_minus =$4a2d;_c_pad_minus =$8e00;_a_pad_minus =$4a00;
  1421. _pad_home  =$4700;_s_pad_home  =$4737;_c_pad_home  =$7700;_a_pad_home  =$9700;
  1422. _pad_up    =$4800;_s_pad_up    =$4838;_c_pad_up    =$8d00;_a_pad_up    =$9800;
  1423. _pad_pgup  =$4900;_s_pad_pgup  =$4939;_c_pad_pgup  =$8400;_a_pad_pgup  =$9900;
  1424. _pad_plus  =$4e2b;_s_pad_plus  =$4e2b;_c_pad_plus  =$9000;_a_pad_plus  =$4e00;
  1425. _pad_left  =$4b00;_s_pad_left  =$4b34;_c_pad_left  =$7300;_a_pad_left  =$9b00;
  1426. _pad_center=$4c00;_s_pad_center=$4c35;_c_pad_center=$8f00;_a_pad_center=$9c00;
  1427. _pad_right =$4d00;_s_pad_right =$4d36;_c_pad_right =$7400;_a_pad_right =$9d00;
  1428. _pad_end   =$4f00;_s_pad_end   =$4f31;_c_pad_end   =$7500;_a_pad_end   =$9f00;
  1429. _pad_down  =$5000;_s_pad_down  =$5032;_c_pad_down  =$9100;_a_pad_down  =$a000;
  1430. _pad_pgdn  =$5100;_s_pad_pgdn  =$5133;_c_pad_pgdn  =$7600;_a_pad_pgdn  =$a100;
  1431. _pad_enter =$e00d;_s_pad_enter =$e00d;_c_pad_enter =$e00a;_a_pad_enter =$a600;
  1432. _pad_ins   =$5200;_s_pad_ins   =$5230;_c_pad_ins   =$9200;_a_pad_ins   =$a200;
  1433. _pad_del   =$5300;_s_pad_del   =$532e;_c_pad_del   =$9300;_a_pad_del   =$a300;
  1434. _tab       =$0f09;_s_tab       =$0f00;_c_tab       =$9400;_a_tab       =$a500;
  1435. _lbracket  =$1a5b;_s_lbracket  =$1a7b;_c_lbracket  =$1a1b;_a_lbracket  =$1a00;
  1436. _rbracket  =$1b5d;_s_rbracket  =$1b7d;_c_rbracket  =$1b1d;_a_rbracket  =$1b00;
  1437. _backslash =$2b5c;_s_backslash =$2b7c;_c_backslash =$2b1c;_a_backslash =$2b00;
  1438. _semicolon =$273b;_s_semicolon =$273a;_c_semicolon =$2700;_a_semicolon =$2700;
  1439. _quote     =$2827;_s_quote     =$2822;_c_quote     =$2800;_a_quote     =$2800;
  1440. _comma     =$332c;_s_comma     =$333c;_c_comma     =$3300;_a_comma     =$3300;
  1441. _period    =$342e;_s_period    =$343e;                    _a_period    =$3400;
  1442. _slash     =$352f;_s_slash     =$353f;                    _a_slash     =$3500;
  1443. _space     =$3920;_s_space     =$3920;_c_space     =$3920;_a_space     =$3920;
  1444. _ins       =$52e0;                    _c_ins       =$92e0;_a_ins       =$a200;
  1445. _home      =$47e0;                    _c_home      =$77e0;_a_home      =$9700;
  1446. _pgup      =$49e0;                    _c_pgup      =$84e0;_a_pgup      =$9900;
  1447. _del       =$53e0;                    _c_del       =$93e0;_a_del       =$a300;
  1448. _end       =$4fe0;                    _c_end       =$75e0;_a_end       =$9f00;
  1449. _pgdn      =$51e0;                    _c_pgdn      =$76e0;_a_pgdn      =$a100;
  1450. _up        =$48e0;                    _c_up        =$8de0;_a_up        =$9800;
  1451. _left      =$4be0;                    _c_left      =$73e0;_a_left      =$9b00;
  1452. _down      =$50e0;                    _c_down      =$91e0;_a_down      =$a000;
  1453. _right     =$4de0;                    _c_right     =$74e0;_a_right     =$9d00;
  1454. _enter     =$1c0d;_s_enter     =$1c0d;_c_enter     =$1c0a;_a_enter     =$1c00;
  1455. _pad_45    =$565c;_s_pad_45    =$567c;
  1456. _backquote =$2960;_s_backquote =$297e;                    _a_backquote =$2900;
  1457. _0         =$0b30;_s_0         =$0b29;                    _a_0         =$8100;
  1458. _1         =$0231;_s_1         =$0221;                    _a_1         =$7800;
  1459. _2         =$0332;_s_2         =$0340;_c_2         =$0300;_a_2         =$7900;
  1460. _3         =$0433;_s_3         =$0423;                    _a_3         =$7a00;
  1461. _4         =$0534;_s_4         =$0524;                    _a_4         =$7b00;
  1462. _5         =$0635;_s_5         =$0625;                    _a_5         =$7c00;
  1463. _6         =$0736;_s_6         =$075e;_c_6         =$071e;_a_6         =$7d00;
  1464. _7         =$0837;_s_7         =$0826;                    _a_7         =$7e00;
  1465. _8         =$0938;_s_8         =$092a;                    _a_8         =$7f00;
  1466. _9         =$0a39;_s_9         =$0a28;                    _a_9         =$8000;
  1467. _minus     =$0c2d;_s_minus     =$0c5f;_c_minus     =$0c1f;_a_minus     =$8200;
  1468. _equals    =$0d3d;_s_equals    =$0d2b;                    _a_equals    =$8300;
  1469. _backspace =$0e08;_s_backspace =$0e08;_c_backspace =$0e7f;_a_backspace =$0e00;
  1470. _a         =$1e61;_s_a         =$1e41;_c_a         =$1e01;_a_a         =$1e00;
  1471. _b         =$3062;_s_b         =$3042;_c_b         =$3002;_a_b         =$3000;
  1472. _c         =$2e63;_s_c         =$2e43;_c_c         =$2e03;_a_c         =$2e00;
  1473. _d         =$2064;_s_d         =$2044;_c_d         =$2004;_a_d         =$2000;
  1474. _e         =$1265;_s_e         =$1245;_c_e         =$1205;_a_e         =$1200;
  1475. _f         =$2166;_s_f         =$2146;_c_f         =$2106;_a_f         =$2100;
  1476. _g         =$2267;_s_g         =$2247;_c_g         =$2207;_a_g         =$2200;
  1477. _h         =$2368;_s_h         =$2348;_c_h         =$2308;_a_h         =$2300;
  1478. _i         =$1769;_s_i         =$1749;_c_i         =$1709;_a_i         =$1700;
  1479. _j         =$246a;_s_j         =$244a;_c_j         =$240a;_a_j         =$2400;
  1480. _k         =$256b;_s_k         =$254b;_c_k         =$250b;_a_k         =$2500;
  1481. _l         =$266c;_s_l         =$264c;_c_l         =$260c;_a_l         =$2600;
  1482. _m         =$326d;_s_m         =$324d;_c_m         =$320d;_a_m         =$3200;
  1483. _n         =$316e;_s_n         =$314e;_c_n         =$310e;_a_n         =$3100;
  1484. _o         =$186f;_s_o         =$184f;_c_o         =$180f;_a_o         =$1800;
  1485. _p         =$1970;_s_p         =$1950;_c_p         =$1910;_a_p         =$1900;
  1486. _q         =$1071;_s_q         =$1051;_c_q         =$1011;_a_q         =$1000;
  1487. _r         =$1372;_s_r         =$1352;_c_r         =$1312;_a_r         =$1300;
  1488. _s         =$1f73;_s_s         =$1f53;_c_s         =$1f13;_a_s         =$1f00;
  1489. _t         =$1474;_s_t         =$1454;_c_t         =$1414;_a_t         =$1400;
  1490. _u         =$1675;_s_u         =$1655;_c_u         =$1615;_a_u         =$1600;
  1491. _v         =$2f76;_s_v         =$2f56;_c_v         =$2f16;_a_v         =$2f00;
  1492. _w         =$1177;_s_w         =$1117;_c_w         =$1157;_a_w         =$1100;
  1493. _x         =$2d78;_s_x         =$2d58;_c_x         =$1519;_a_x         =$2d00;
  1494. _y         =$1579;_s_y         =$1559;_c_y         =$1519;_a_y         =$1500;
  1495. _z         =$2c7a;_s_z         =$2c5a;_c_z         =$2c1a;_a_z         =$2c00;
  1496.  
  1497.  
  1498. var
  1499.   hasenhancedkbd : boolean;  {true  when enhanced keyboard is detected}
  1500.  
  1501.   procedure restorekbdvectors;
  1502.   function readkeyword : word;
  1503.   function hexw(w : word) : string;
  1504.  
  1505.  
  1506.  The following table summarizes the keys which are affected by using this
  1507.  unit. The entries are the values of the scan word in hex. The high byte of
  1508.  the scan word is the scan code, the low byte the ASCII character. If the low
  1509.  byte is 00, the high byte will be returned on the next call to ReadKey. Any
  1510.  keys not listed are returned in the usual manner (see the Turbo Pascal 4.0
  1511.  manual, first printing pages 571-572, for a scan code chart). See Notes,
  1512.  following the table, for the key to special symbols.
  1513.  
  1514.                Plain     Shift     Control   Alt
  1515.                -----     -----     -------   ----
  1516.  F11           8500%     8700%     8900%     8B00%
  1517.  F12           8600%     8800%     8A00%     8C00%
  1518.  Esc           011B      011B      011B      0100*
  1519.  Backquote     2960      297E      2960      2900*
  1520.  Backspace     0E08      0E08      0E7F      0E00*
  1521.  Tab           0F09      0F00      9400*     A500*
  1522.  Left Brack    1A5B      1A7B      1A1B      1A00*
  1523.  Right Brack   1B5D      1B7D      1B1D      1B00*
  1524.  Backslash     2B5C      2B7C      2B1C      2B00*
  1525.  Semicolon     273B      273A       -        2700*
  1526.  Quote         2827      2822       -        2800*
  1527.  Enter         1C0D      1C0D      1C0A      1C00*
  1528.  Comma         332C      333C       -        3300*
  1529.  Period        342E      343E       -        3400*
  1530.  Slash         352F      353F       -        3500*
  1531.  Insert        5200      5230      9200*     A200#
  1532.  Del           5300      532E      9300*     A300#
  1533.  Home          4700      4737      7700      9700#
  1534.  End           4F00      4F31      7500      9F00#
  1535.  PgUp          4900      4939      8400      9900#
  1536.  PgDn          5100      5133      7600      A100#
  1537.  Up            4800      4838      8D00*     9800#
  1538.  Down          5000      5032      9100*     A000#
  1539.  Left          4B00      4B34      7300      9B00#
  1540.  Right         4D00      4D36      7400      9D00#
  1541.  Pad-Asterisk  372A       !         !        3700#  (numeric keypad keys)
  1542.  Pad-Minus     4A2D      4A2D      8E00*     4A00#
  1543.  Pad-Plus      4E2B      4E2B      9000*     4E00#
  1544.  Pad-5         4C00*     4C35      8F00*     9C00#
  1545.  
  1546. Notes:
  1547. - These keystrokes are ignored.
  1548. * These keystrokes are not normally returned by the non-enhanced keyboard.
  1549. # These keystrokes are not normally returned by the enhanced keyboard.
  1550. ! These keystrokes control printscreen and print echoing. They cannot
  1551.   simulate the effect of the enhanced keyboard, which has the Asterisk and
  1552.   PrtSc keys separated.
  1553. % The F11 and F12 keys are returned only if they actually exist on the
  1554.   keyboard.
  1555.  
  1556.  With a few exceptions, the EnhKbd unit returns results identical to those of
  1557.  the enhanced keyboard BIOS. One difference makes the enhanced keyboard
  1558.  simpler to use in a program: those scan words which normally contain E0 in
  1559.  the low byte to indicate that the key is specific to the enhanced keyboard
  1560.  (like the dedicated cursor keys) will have the low cleared to zero by EnhKbd.
  1561.  
  1562.  Keys marked with # are normally ignored by the enhanced BIOS. By defining
  1563.  these numeric keypad keys when Alt is pressed, the usual ability to enter
  1564.  arbitrary keys on the numeric keypad is disabled. Within applications, the
  1565.  ability to use alt-shifted arrow keys will generally be more useful. The
  1566.  arbitrary keys from the numeric keypad are still available by pressing both
  1567.  Alt and Left Shift simultaneously.
  1568.  
  1569.  Because this unit takes over interrupt 9, it will crash the system if
  1570.  SideKick is installed and another TSR that takes over interrupt 9 has been
  1571.  loaded after SideKick. You must exercise similar caution in using this unit
  1572.  in programs that must take over interrupt 9 for other reasons.
  1573.  
  1574.  Uses this unit early in the USES clause!
  1575.  
  1576.  
  1577. !short  Unit ECO_mou;               Standard Mouse Functions
  1578. unit ECO_mou;
  1579. interface
  1580. uses
  1581.   dos
  1582.  
  1583.   ;
  1584.  
  1585.  
  1586. const
  1587.   mdd = $33;                { interrupt for mouse device driver }
  1588.   hardware = 1;                                  { cursor types }
  1589.   software = 0;
  1590.   left     = 0;                                 { mouse buttons }
  1591.   right    = 1;
  1592.   middle   = 2;
  1593.  
  1594. type
  1595.   resetrec = record        { initialized by mouse function 0 }
  1596.     exists   : boolean;           { true if mouse is present }
  1597.     nbuttons : integer;                 { # buttons on mouse }
  1598.   end;
  1599.  
  1600.   locrec = record    { initialized by mouse fcns 3, 5, and 6 }
  1601.     buttonstatus,    { bits 0-2 on if corresp button is down }
  1602.     opcount,               { # times button has been clicked }
  1603.                              { opcount not returned by fcn 3 }
  1604.     column,                                       { position }
  1605.     row      : integer;
  1606.   end;
  1607.  
  1608.   moverec = record             { initialized by mouse fcn 11 }
  1609.     hcount,                        { net horizontal movement }
  1610.     vcount : integer;                { net vertical movement }
  1611.   end;
  1612.  
  1613. var
  1614.   reg : registers;
  1615.  
  1616.  
  1617.   {$F+}
  1618.   procedure mreset (var mouse : resetrec);       { function  0 }
  1619.   procedure mshow;                               { function  1 }
  1620.   procedure mhide;                               { function  2 }
  1621.   procedure mpos (var mouse : locrec);           { function  3 }
  1622.   procedure mmoveto (col, row : integer);        { function  4 }
  1623.   procedure mpressed (button : integer;
  1624.                       var mouse : locrec);       { function  5 }
  1625.   procedure mreleased (button : integer;
  1626.                       var mouse : locrec);       { function  6 }
  1627.   procedure mcolrange (min, max : integer);      { function  7 }
  1628.   procedure mrowrange (min, max : integer);      { function  8 }
  1629.   procedure mgraphcursor (hhot, vhot : integer;
  1630.                      maskseg, maskofs : word);   { function  9 }
  1631.   procedure mtextcursor (ctype, p1, p2 : word);  { function 10 }
  1632.   procedure mmotion (var moved : moverec);       { function 11 }
  1633.   procedure minsttask (mask,
  1634.                        taskseg, taskofs : word); { function 12 }
  1635.   procedure mlpenon;                             { function 13 }
  1636.   procedure mlpenoff;                            { function 14 }
  1637.   procedure mratio (horiz, vert : integer);      { function 15 }
  1638.   {$F-}
  1639.  
  1640.  
  1641. !short  Unit ECO_pal;               CGA/EGA/VGA/Herc Colour Palette Functions
  1642. unit ECO_pal;
  1643. interface
  1644. uses
  1645.   crt,     unit_scn,
  1646.   ECO_vid, ECO_ext
  1647.  
  1648.   ;
  1649.  
  1650. type
  1651.   attributes = record
  1652.     fore, back: byte;
  1653.   end;
  1654.  
  1655.   function getcolor(
  1656.     x_pos, y_pos, winf, winb, wintype: byte;
  1657.     var fore, back: byte;
  1658.     msg: string
  1659.   ): byte;
  1660.  
  1661.  
  1662. !short  Unit ECO_pasc;              Popup Ascii Table Return Function
  1663. unit ECO_pasc;
  1664. interface
  1665. uses
  1666.   crt,
  1667.   unit_key, unit_scn,
  1668.   ECO_vid,  ECO_ext,
  1669.   ECO_str
  1670.  
  1671.   ;
  1672.  
  1673.   procedure __setpopascii(x, y, f1, b1: integer);
  1674.   function __popascii : char;
  1675.  
  1676.  
  1677. !short  Unit ECO_pclc;              Popup Calculator Return Function
  1678. unit ECO_pclc;
  1679.  
  1680. interface
  1681. uses
  1682.   dos, crt,
  1683.   unit_scn, ECO_vid,
  1684.   ECO_ext,  ECO_str
  1685.  
  1686.   ;
  1687.  
  1688.  
  1689.   procedure __setcalc(x,y,f,b:integer);
  1690.   function  __popcalc: real;
  1691.  
  1692.  
  1693. !short  Unit ECO_play;              Extensive BASIC Play Command Functions
  1694. unit ECO_play;
  1695. interface
  1696.  
  1697. uses crt;
  1698.  
  1699. const
  1700.    note_octave   : integer = 4;     { current octave for note            }
  1701.    note_fraction : real    = 0.875; { fraction of duration given to note }
  1702.    note_duration : integer = 0;     { duration of note     ^^semi-legato }
  1703.    note_length   : real    = 0.25;  { length of note }
  1704.    note_quarter  : real    = 500.0; { moderato pace (principal beat)     }
  1705.  
  1706. procedure setdefaultnotes;
  1707. procedure play(s: string);
  1708. procedure beep(h, l: word);
  1709.  
  1710.   call: play(string)
  1711.  
  1712.         music_string --- the string containing the encoded music to be
  1713.                          played.  the format is the same as that of the
  1714.                          microsoft basic play statement.  the string
  1715.                          must be <= 254 characters in length.
  1716.  
  1717.   calls:  sound
  1718.           getint  (internal)
  1719.  
  1720.   remarks:  the characters accepted by this routine are:
  1721.  
  1722.             a - g       musical notes
  1723.             # or +      following a - g note, indicates sharp
  1724.             -           following a - g note, indicates flat
  1725.             <           move down one octave
  1726.             >           move up one octave
  1727.             .           dot previous note (extend note duration by 3/2)
  1728.             mn          normal duration (7/8 of interval between notes)
  1729.             ms          staccato duration
  1730.             ml          legato duration
  1731.             ln          length of note (n=1-64; 1=whole note,4=quarter note)
  1732.             pn          pause length (same n values as ln above)
  1733.             tn          tempo,n=notes/minute (n=32-255,default n=120)
  1734.             on          octave number (n=0-6,default n=4)
  1735.             nn          play note number n (n=0-84)
  1736.  
  1737.             the following two commands are ignored by play:
  1738.  
  1739.             mf          complete note before continuing
  1740.             mb          another process may begin before speaker is
  1741.                         finished playing note
  1742.  
  1743.   important --- setdefaultnotes must have been called at least once before
  1744.                 this routine is called.
  1745.  
  1746.  
  1747. !short  Unit ECO_scrn;              Screen Saver - Graphical Function
  1748. unit ECO_scrn;
  1749. interface uses
  1750.   crt, graph, bgidriv,
  1751.   ECO_vid
  1752.  
  1753.   ;
  1754.  
  1755.   procedure screensaver(st: string);
  1756.  
  1757.  
  1758. !short  Unit ECO_srch;              Boyer/Moore Search Function Unit
  1759. unit ECO_srch;
  1760. interface
  1761.  
  1762.  
  1763.   function blockpos(var buffer;size: word;s: string): integer;
  1764.  
  1765.  
  1766. type
  1767.   boyertable = record
  1768.     match       :              string;
  1769.     matchlength :                byte;
  1770.     table       : array[char] of byte
  1771.   end;
  1772.  
  1773.   procedure makeboyertable(matchstring: string;var table: boyertable);
  1774.   function boyermoore(
  1775.     var bufferaddr;size: word;start: word;var table: boyertable
  1776.   ): word;
  1777.  
  1778.  
  1779.  
  1780.  
  1781. !short  Unit ECO_str;               PowerTools Extension String Functions
  1782. unit ECO_str;
  1783. interface
  1784. uses
  1785.   dos,
  1786.   unit_str, ECO_ext
  1787.  
  1788.   ;
  1789.  
  1790.  
  1791. type
  1792.   filestr   =            string[12];
  1793.   str3      =             string[3];
  1794.   anystr    =                string;
  1795.   asciiz    = array[0..255] of char;
  1796.   asciizptr =               ^^asciiz;
  1797.  
  1798.  
  1799. const
  1800.   fk_ctrl_mark: char = '^';
  1801.  
  1802.  
  1803.   { extended string supplement }
  1804.   procedure __app(var st: string; aps: string);
  1805.   function  __backapp(s: string) : string;
  1806.   function  __backrem(s: string) : string;
  1807.   function  __comp(s1, s2: string): boolean;
  1808.   function  __hxdecstr(hexstr: string): longint;
  1809.   function  __lo(s: string): string;
  1810.   function  __num(nr: longint): string;
  1811.   function  __nw(s: string): string;
  1812.   function  __overtype(n:byte;strs,strt:string):string;
  1813.   function  __pntstr(n: longint): string;
  1814.   function  __rep(n: byte; character: char): string;
  1815.   function  __retdowstr(dayofweek: word; ful: boolean): string;
  1816.   function  __todaystr(ful: boolean): string;
  1817.   function  __up(s: string): string;
  1818.   function  __uprem(s: string): string;
  1819.  
  1820.   {== ASCIIZ ==}
  1821.   procedure copystoa(s: anystr; var a; length_a: integer);
  1822.   procedure copys2ar(s: anystr; var a; length_a: integer);
  1823.   function  read_ctrls(s: anystr): anystr;
  1824.   function  write_ctrls(s: anystr): anystr;
  1825.   function  asciiz_to_str(a: asciiz): string;
  1826.   procedure str_to_asciiz(s: string; var a : asciiz);
  1827.  
  1828.  
  1829. !short  Unit ECO_swch;              Switch To DOS With EMS/Disc Swap
  1830. unit ECO_swch;
  1831. interface
  1832.  
  1833.   function switch(drive: integer; mem: integer; command: string): integer;
  1834.  
  1835.  
  1836. !short  Unit ECO_time;              Timer Functions
  1837. unit ECO_time;
  1838. interface
  1839. uses
  1840.   dos
  1841.  
  1842.   ;
  1843.  
  1844.   procedure starttimer (whichclock : byte);
  1845.   starts the internal clock.  resets the clock if it was previously set.
  1846.  
  1847.   function  getlaptime (whichclock : byte) : string;
  1848.   returns a string showing the elapsed time.  the returned string is...
  1849.    "xx:xx:xx.xx".  the clock continues to run.
  1850.  
  1851.   procedure restarttimer (whichclock : byte);
  1852.   restarts the clock if the stoptimer procedure stopped the clock.  it does
  1853.   nothing if the clock is still running.
  1854.  
  1855.   function  stoptimer (whichclock : byte) : string;
  1856.   stops the timer without clearing the elapsed time.  returned string will be
  1857.   one of the following...  "xx:xx:xx.xx", or "Can't stop clock #0!".
  1858.  
  1859.  
  1860. !short  Unit ECO_vga;               VGA Palette Manipulation Functions
  1861. unit ECO_vga;
  1862. interface
  1863. uses
  1864.   dos, crt,
  1865.   unit_scn
  1866.  
  1867.   ;
  1868.  
  1869.  
  1870. const
  1871.   colors = 256;
  1872.   delayamt   : byte    =   50;
  1873.   steps      : byte    =   30;
  1874.   vgapresent : boolean = true;
  1875.  
  1876.  
  1877. type
  1878.   paltype = array [0..colors-1] of record
  1879.     r, g, b: byte;
  1880.   end;
  1881.  
  1882. var
  1883.   origpal : paltype;
  1884.  
  1885.  
  1886.   procedure __palget(var origpal: paltype);
  1887.   procedure __palfade(origpal: paltype; fadeout: boolean);
  1888.   procedure __palblack(origpal: paltype);
  1889.   procedure __palput(origpal: paltype);
  1890.  
  1891.  
  1892. !short  Unit ECO_vid;               PowerTools Extension Video Functions
  1893. unit ECO_vid;
  1894. interface
  1895. uses
  1896.   unit_sup, unit_key,
  1897.   unit_scn, unit_fil,
  1898.   ECO_str,  ECO_ext
  1899.  
  1900.   ;
  1901.  
  1902.  
  1903. const
  1904.   bt_double    = 15;     bt_single    =   0;
  1905.   black        = 00;     blue         = 01;
  1906.   green        = 02;     cyan         = 03;
  1907.   red          = 04;     magenta      = 05;
  1908.   brown        = 06;     lightgray    = 07;
  1909.   darkgray     = 08;     lightblue    = 09;
  1910.   lightgreen   = 10;     lightcyan    = 11;
  1911.   lightred     = 12;     lightmagenta = 13;
  1912.   yellow       = 14;     white        = 15;
  1913.   blink        = 128;
  1914.  
  1915.  
  1916.  
  1917.   procedure __attrib(x1, y1, x2, y2, f, b: byte);
  1918.   procedure __bandwin(del: boolean; x1,y1,x2,y2,f,b,bt: byte);
  1919.   function  __barchoice(x,x1,y,f,b,h : byte; st: string): byte;
  1920.   procedure __betwscn(x1, x2, y, f, b: byte; st: string);
  1921.   procedure __clrscn(x1, y1, x2, y2, f, b: byte; c: char);
  1922.   procedure __cls;
  1923.   function  __copyfil(x1,x2,y,f,b: byte; fs: longint; src, targ: string): byte;
  1924.   procedure __copyscn(x1, y1, x2, y2, x, y: byte);
  1925.   procedure __ECO_message;
  1926.   procedure __hbetwscn(x1, x2, y, f, b, h: byte; st: string);
  1927.   procedure __hquikscn(x, y, f, b, h: byte; st: string);
  1928.   procedure __nocrt;
  1929.   procedure __panelwin(del: boolean; x1, y1, x2, y2, f, b, bt: byte);
  1930.   procedure __partscn(sc: pointer; x1, y1, x2, y2: byte; toscreen: boolean);
  1931.   procedure __ptd_message;
  1932.   procedure __qvertscn(x1, y1, f, b: byte;  st: string);
  1933.   procedure __repscn(f, b: byte; st: string);
  1934.   procedure __resscn(sc: _scnimageptr);
  1935.   procedure __savscn(sc: _scnimageptr);
  1936.   procedure __setblwin(blink: boolean);
  1937.  
  1938.  
  1939. var
  1940.   scn1, scn2, scn3, scn4: _scnimageptr;
  1941.  
  1942.  
  1943. !short  Unit ECO_vprm;              VideoParameter Functions
  1944. unit ECO_vprm;
  1945. interface
  1946. uses
  1947.   graph, ptd_gdrv
  1948.  
  1949.   ;
  1950.  
  1951.  
  1952. !short  Unit ECO_zmod;              ZModem Interface (Receive/Transmit)
  1953. unit ECO_zmod;
  1954.  
  1955. interface
  1956. uses
  1957.   crt, dos,
  1958.   ECO_asyn;
  1959.  
  1960.  
  1961. function zmodem_receive(
  1962.   path: string; comport: word; baudrate: longint
  1963. ): boolean;
  1964.  
  1965. function zmodem_send(
  1966.   pathname: string; lastfile: boolean; comport: word; baudrate: longint
  1967. ): boolean;
  1968.  
  1969. ========================================================================
  1970.