home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / pascal / swag / comm.swg / 0057_Fossil Identification.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-08-25  |  2.1 KB  |  64 lines

  1. {
  2. From: Patrick.Bernier@f209.n167.z1.fidonet.org
  3.  
  4. >I now realize that $1954 will be returned for either BNU/X00, but I would
  5. >still like to be able to list to screen "which" fossil has been detected,
  6. >and I cannot seem to figure it out.
  7.  
  8.  > try to call to the fossile with ah=1bh and you'll get
  9.  > an info record,
  10.  > containing pointer for fossil ID string ..
  11.  
  12. True. Here is an excerpt from 'myfos', my fossil interface unit; F_GetDrvID()
  13. will return a string containing the current fossil driver's identification.
  14. Sorry for the sloppy coding, I programmed this thing quite a while ago and
  15. since it worked I never updated it to my current programming skills...
  16.  
  17. <incomplete code - won't compile>
  18. }
  19.   type
  20.     F_IdentPtr = ^F_IdentStr;
  21.     F_IdentStr = array[1..255] of byte;
  22.     F_InfoBlock = record { len = 69 }
  23.                     size:     word;        { Size of the infoblock }
  24.                     majver:   byte;        { Version (high byte) }
  25.                     minver:   byte;        { ...     (low byte) }
  26.                     ident:    F_identptr;  { Pointer to asciiz ID of driver }
  27.                     ibufr:    word;        { Input buffer size }
  28.                     ifree:    word;        { Input buffer free }
  29.                     obufr:    word;        { Output buffer size }
  30.                     ofree:    word;        { Output buffer free }
  31.                     swidth:   byte;        { Width of screen (in chars) }
  32.                     sheight:  byte;        { Height of screen }
  33.                     baud:     byte;        { Actual baud rate (computer-modem)
  34. }
  35.                   end;
  36.  
  37.   procedure F_GetDrvInfo;
  38.   begin
  39.     regs.ah := $1b;
  40.     regs.cx := sizeof(F_InfoBlock);
  41.     regs.dx := F_PORT;
  42.     regs.es := Seg(F_Info);
  43.     regs.di := Ofs(F_Info);
  44.     intr($14,regs);
  45.   end;
  46.  
  47.   function F_GetDrvID: string;
  48.   var
  49.     InfoRec: F_IdentStr;
  50.     X: integer;
  51.     s: string;
  52.   begin
  53.     F_GetDrvInfo;
  54.     InfoRec := F_Info.ident^;
  55.     X := 1;
  56.     s := '';
  57.     while InfoRec[X] <> 0 do begin
  58.       s := s + chr(InfoRec[X]);
  59.       inc(X);
  60.     end;
  61.     F_GetDrvID := s;
  62.   end;
  63.  
  64.