home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Masterblend / cdsharewaremasterblend.iso / utils / infoplus / page_06.pas < prev    next >
Pascal/Delphi Source File  |  1990-12-08  |  19KB  |  627 lines

  1. procedure page_06;
  2. const
  3.   atividmons: array[0..15] of string[24] =
  4.                ('EGA', 'analog monochrome', 'TTL monochrome', 'analog color',
  5.                 'RGB color', 'Multisync or compatible', '(unknown)',
  6.                 'PS/2 8514 or compatible', '(unknown)', 'NEC MultiSync 2A',
  7.                 'Tatung OmniScan', 'NEC 3D or compatible', 'TVM 3M',
  8.                 'NEC MultiSync XL/+/4D/5D', 'TVM 3A', 'TVM 2A');
  9.   trividmons: array [0..7] of string[17] =
  10.                ('MDA', 'CGA', 'EGA', 'Digital multisync', 'VGA', '8514',
  11.                 'SuperVGA', 'Analog multisync');
  12.  
  13. type
  14.   cardtype = (none, vesa, standard, paradise, video7, ati, ahead, cirrus,
  15.                cti, genoa, trident, tseng, zymos);
  16.   VESAitype = record
  17.                 signature: array[0..3] of char;
  18.                 version: word;
  19.                 OEMnameOfs: word;
  20.                 OEMnameSeg: word;
  21.                 capabilities: array[0..3] of byte;
  22.                 modesOfs: word;
  23.                 modesSeg: word;
  24.                 reserved: array[0..237] of byte;
  25.               end;
  26.   VESAmtype = record
  27.                 modeattr: word;
  28.                 winaattr: byte; {Window A attributes}
  29.                 winbattr: byte; {Window B attributes}
  30.                 wingran: word;  {Window Granularity}
  31.                 winsize: word;  {Window Size}
  32.                 winaseg: word;  {Window A segment}
  33.                 winbseg: word;  {Window B segment}
  34.                 posOfs: word;   {Offset of Far call to positioning function}
  35.                 posSeg: word;   {Segment ..}
  36.                 scansize: word; {Bytes per scan line}
  37.                 {The following information is optional for VESA modes,
  38.                  required for OEM modes}
  39.                 pixwidth: word;
  40.                 pixheight: word;
  41.                 charwidth: byte;
  42.                 charheight: byte;
  43.                 memplanes: byte;
  44.                 pixelbits: byte;
  45.                 banks: byte;
  46.                 memmodel: byte;
  47.                 banksize: byte;
  48.                 reserved: array[0..227] of byte;
  49.               end;
  50.  
  51. var
  52.   i : byte;
  53.   VGAbuf : array[$00..$10] of byte;
  54.   VESAinfo: VESAitype;
  55.   VESAmode: VESAmtype;
  56.   xbyte : byte;
  57.   xword1 : word;
  58.   xword2 : word;
  59.   xword3 : word;
  60.   xword4 : word;
  61.   vgacard: cardtype;
  62.   vidmem : word;
  63.   s: string;
  64.   c: char;
  65.  
  66. procedure captfont;
  67.   begin
  68.   caption1('Font           Address');
  69.   writeln;
  70.   write('INT 1FH        ');
  71.   segofs(longint(intvec[$1F]) shr 16, longint(intvec[$1F]) and $0000FFFF);
  72.   writeln
  73.   end; {captfont}
  74.  
  75. procedure showfont(a : byte);
  76.   const
  77.     fontnames: array [0..7] of string[12] = (
  78.                  'INT 1FH     ',
  79.                  'INT 43H     ',
  80.                  'ROM 8x14    ',
  81.                  'ROM 8x8 (lo)',
  82.                  'ROM 8x8 (hi)',
  83.                  'ROM 9x14    ',
  84.                  'ROM 8x16    ',
  85.                  'ROM 9x16    ');
  86.  
  87.   begin
  88.   with regs do
  89.     begin
  90.     Write(fontnames[a], '   ');
  91.     AX:=$1130;
  92.     BH:=a;
  93.     intr($10, regs);
  94.     segofs(ES, BP);
  95.     writeln
  96.     end
  97.   end; {showfont}
  98.  
  99. procedure int101210;
  100.   const
  101.     memnames: array[0..3] of string[4] = ('64K', '128K', '192K', '256K');
  102.  
  103.   begin
  104.   with regs do
  105.     begin
  106.     AH:=$12;
  107.     BL:=$10;
  108.     intr($10, regs);
  109.     caption2('Display type');
  110.     case BH of
  111.       $00 : writeln('color');
  112.       $01 : writeln('monochrome')
  113.       else
  114.         unknown('display', BH, 2)
  115.     end;
  116.     caption2('Memory');
  117.     if vidmem > 0 then
  118.       Writeln(vidmem, 'K')
  119.     else
  120.       if BL < 4 then
  121.         Writeln(memnames[BL], ' as determined from standard BIOS call')
  122.       else
  123.         unknown('size', BL, 2);
  124.     if vgacard = none then
  125.       begin
  126.       caption2('Feature bits');
  127.       writeln(bin4(CH and $0F));
  128.       caption2('DIP switches (EGA)');
  129.       writeln(bin4(CL and $0F))
  130.       end
  131.     end
  132.   end;
  133.  
  134.   function readROM(seg, ofs: word; length: byte): string;
  135.     var
  136.       x: word;
  137.       s: string;
  138.  
  139.     begin
  140.     s:='';
  141.     for x:=ofs to ofs + (length - 1) do
  142.       s:=s + Chr(Mem[seg:x]);
  143.     readROM:=s
  144.     end; {readROM}
  145.  
  146.   procedure checking(s: string);
  147.     var
  148.       x, y: byte;
  149.     begin
  150.     x:=WhereX;
  151.     y:=WhereY;
  152.     ClrEol;
  153.     Write('Checking for ', s);
  154.     GotoXY(x, y);
  155.     end; {checking}
  156.  
  157.   procedure cli;
  158.     inline($FA);
  159.  
  160.   procedure sti;
  161.     inline($FB);
  162.  
  163.   begin (* procedure page_06 *)
  164.   vgacard:=none;
  165.   caption2('Display adapter');
  166.   checking('VESA');
  167.   with regs do
  168.     begin
  169.     AX:=$4F00;
  170.     ES:=Seg(VESAinfo);
  171.     DI:=Ofs(VESAinfo);
  172.     Intr($10, regs);
  173.     s:='';
  174.     if (AL = $4F) and (AH = 0) and (VESAinfo.signature = 'VESA') then
  175.       begin
  176.       with VESAinfo do
  177.         begin
  178.         vgacard:=vesa;
  179.         ClrEol;
  180.         Writeln('VESA version ', Hi(version), decimal, Lo(version));
  181.         caption2('OEM ID');
  182.         xword1:=OEMnameSeg;
  183.         xword2:=OEMnameOfs;
  184.         s:='';
  185.         c:=Chr(Mem[xword1:xword2]);
  186.         while c <> #0 do
  187.           begin
  188.           Write(c);
  189.           s:=s + c;
  190.           Inc(xword2);
  191.           c:=Chr(Mem[xword1:xword2])
  192.           end;
  193.         caption3('Manufacturer');
  194.         if s = '761295520' then
  195.           Writeln('ATI')
  196.         else
  197.           dontknow
  198.         end;
  199.       caption1('Video modes supported:');
  200.       Writeln;
  201.       xword2:=VESAinfo.modesSeg;
  202.       xword3:=VESAinfo.modesOfs;
  203.       with VESAmode do
  204.         while MemW[xword2:xword3] <> $FFFF do
  205.           begin
  206.           xword1:=MemW[xword2:xword3];
  207.           AX:=$4F01;
  208.           CX:=xword1;
  209.           ES:=Seg(VESAmode);
  210.           DI:=Ofs(VESAmode);
  211.           Intr($10, regs);
  212.           if (AX = $004F) and (modeattr and 1 = 1) then
  213.             begin
  214.             pause3(4);
  215.             if endit then
  216.               Exit;
  217.             caption2('Number');
  218.             Write(hex(xword1, 4));
  219.             caption3('Mode');
  220.             if modeattr and 8 = 8 then
  221.               Write('Color ')
  222.             else
  223.               Write('Monochrome ');
  224.             if modeattr and $10 = $10 then
  225.               Write('graphics')
  226.             else
  227.               Write('text');
  228.             caption3('BIOS output support');
  229.             yesorno(modeattr and 4 = 4);
  230.             if modeattr and 2 = 2 then
  231.               begin
  232.               caption3('Screen size');
  233.               Write(pixwidth, 'x', pixheight);
  234.               caption3('Character size');
  235.               Write(charwidth, 'x', charheight);
  236.               caption3('Colors');
  237.               Writeln(exp((pixelbits * 1.0) * ln(2.0)):1:0);
  238.               caption3('Memory model');
  239.               case memmodel of
  240.                 0: Write('Text');
  241.                 1: Write('CGA');
  242.                 2: Write('Hercules');
  243.                 3: Write('4-plane');
  244.                 4: Write('Packed-pixel');
  245.                 5: Write('Nonchain 4');
  246.                 6..$0F: Write('(reserved)');
  247.               else
  248.                 Write('(unknown)')
  249.               end;
  250.               caption3('Memory planes');
  251.               Write(memplanes);
  252.               caption3('Memory banks');
  253.               Write(banks);
  254.               if banks > 1 then
  255.                 begin
  256.                 caption3('Bank size');
  257.                 Write(banksize, 'K')
  258.                 end;
  259.               Writeln;
  260.               end;
  261.             Writeln;
  262.             Inc(xword3, 2);
  263.             end;
  264.           end;
  265.       TextColor(LightGreen);
  266.       Write('The next screen will show standard information, so ');
  267.       pause1;
  268.       if endit then
  269.         Exit;
  270.       ClrScr;
  271.       caption2('Display adapter');
  272.       end;
  273.     end;
  274.   vgacard:=none;
  275.   vidmem:=0;
  276.   ClrEol;
  277.   case graphdriver of
  278.     CGA : begin
  279.           writeln('CGA');
  280.           captfont
  281.           end;
  282.     MCGA : begin
  283.            writeln('MCGA');
  284.            captfont;
  285.            showfont($01);
  286.            showfont($03);
  287.            showfont($04);
  288.            showfont($06)
  289.            end;
  290.     EGA..EGAmono : begin
  291.                  writeln('EGA');
  292.                  captfont;
  293.