home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / windows / infop141.zip / 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.                  showfont($01);
  294.                  showfont($02);
  295.                  showfont($03);
  296.                  showfont($04);
  297.                  showfont($05);
  298.                  int101210;
  299.                  xbyte:=mem[BIOSdseg : $0087];
  300.                  caption2('Mode change preserves screen buffer');
  301.                  yesorno(xbyte and $80 = $80);
  302.                  caption2('EGA active');
  303.                  yesorno(xbyte and $08 = $00);
  304.                  caption2('Wait for display enable');
  305.                  yesorno(xbyte and $04 = $04);
  306.                  caption2('CGA cursor emulation');
  307.                  yesorno(xbyte and $01 = $00);
  308.            (*  PC Magazine 6:12 p.326  *)
  309.                  caption2('Save area                    ');
  310.                  xword1:=memw[BIOSdseg : $00AA];
  311.                  xword2:=memw[BIOSdseg : $00A8];
  312.                  segofs(xword1, xword2);
  313.                  writeln;
  314.            (*  PC Tech Journal 3:4 p.65  *)
  315.                  caption2('Video parameter table        ');
  316.                  segofs(memw[xword1 : xword2 +  2], memw[xword1 : xword2]);
  317.                  writeln;
  318.                  caption2('Dynamic save area            ');
  319.                  xword3:=memw[xword1 : xword2 +  6];
  320.                  xword4:=memw[xword1 : xword2 +  4];
  321.                  if (xword3 > $0000) or (xword4 > $0000) then
  322.                    begin
  323.                    segofs(xword3, xword4);
  324.                    writeln
  325.                    end
  326.                  else
  327.                    writeln('(none)');
  328.                  caption2('Auxiliary character generator');
  329.                  xword3:=memw[xword1 : xword2 + 10];
  330.                  xword4:=memw[xword1 : xword2 +  8];
  331.                  if (xword3 > $0000) or (xword4 > $0000) then
  332.                    begin
  333.                    segofs(xword3, xword4);
  334.                    writeln
  335.                    end
  336.                  else
  337.                    writeln('(none)');
  338.                  caption2('Graphics mode auxiliary table');
  339.                  xword3:=memw[xword1 : xword2 + 14];
  340.                  xword4:=memw[xword1 : xword2 + 12];
  341.                  if (xword3 > $0000) or (xword4 > $0000) then
  342.                    segofs(xword3, xword4)
  343.                  else
  344.                    write('(none)')
  345.            (*  PC Tech Journal 3:4 p.67  *)
  346.                end;
  347.     hercmono : begin
  348.                writeln('Hercules or MDA');
  349.                captfont
  350.                end;
  351.     IBM8514 : begin
  352.               writeln('IBM 8514');
  353.               captfont
  354.               end;
  355.     ATT400 : begin
  356.              writeln('AT&T 400');
  357.              captfont
  358.              end;
  359.     VGA : begin
  360.           writeln('VGA');
  361.           vidmem:=0;
  362.           caption3('Chipset');
  363.           vgacard:=standard;
  364.           if vgacard = standard then
  365.             with regs do
  366.               begin
  367.               checking('Video 7');
  368.               AX:=$6F00;
  369.               BX:=0;
  370.               Intr($10, regs);
  371.               if BX = $5637 then
  372.                 begin
  373.                 vgacard:=video7;
  374.                 ClrEol;
  375.                 Write('Video 7');
  376.                 AX:=$6F07;
  377.                 Intr($10, regs);
  378.                 if AL = $6F then
  379.                   begin
  380.                   vidmem:=256 * (AH and $7F);
  381.                   caption3('memory type');
  382.                   if AH and $80 = $80 then
  383.                     Writeln('VRAM')
  384.                   else
  385.                     Writeln('DRAM')
  386.                   end
  387.                 else
  388.                   vidmem:=256;
  389.                 end;
  390.               end;
  391.           if vgacard = standard then
  392.             begin
  393.             checking('AHEAD');
  394.             s:=readROM($C000, $25, 5);
  395.             if s = 'AHEAD' then
  396.               begin
  397.               vgacard:=ahead;
  398.               ClrEol;
  399.               Writeln('Ahead');
  400.               end
  401.             end;
  402.           if vgacard = standard then
  403.             begin
  404.             checking('Cirrus');
  405.             if CirrusCK = 1 then
  406.               begin
  407.               vgacard:=cirrus;
  408.               ClrEol;
  409.               Write('Cirrus');
  410.               end;
  411.             end;
  412.           if vgacard = standard then
  413.             begin
  414.             checking('CTI');
  415.             with regs do
  416.               begin
  417.               AH:=$5F;
  418.               AL:=0;
  419.               Intr($10, regs);
  420.               if AL = $5F then
  421.                 begin
  422.                 ClrEol;
  423.                 Write('CTI 82C45', CTICK);
  424.                 vgacard:=CTI;
  425.                 vidmem:=(BH * 256) + 256;
  426.                 caption3('micro-channel');
  427.                 yesorno2(CX and 2 = 2);
  428.                 caption3('DAC size');
  429.                 if CX and 1 = 1 then
  430.                   Writeln('8-bit')
  431.                 else
  432.                   Writeln('6-bit');
  433.                 end
  434.               end;
  435.             end;
  436.           if vgacard = standard then
  437.           begin
  438.           checking('Genoa');
  439.           xword2:=MemW[$C000:$37];
  440.           xword1:=MemW[$C000:$39];
  441.           s:=readROM(xword1, xword2, 4);
  442.           if s = #$77#$11#$99#$66 then
  443.             begin
  444.             vgacard:=genoa;
  445.             ClrEol;
  446.             Writeln('Genoa');
  447.             end
  448.           end;
  449.        if vgacard = standard then
  450.           begin
  451.           checking('Trident');
  452.           Port[$3C4]:=$0B;
  453.           xbyte:=Port[$3C5] and $0F;
  454.           if (xbyte >= 1) and (xbyte <= 2) then
  455.             begin
  456.             vgacard:=trident;
  457.             ClrEol;
  458.             Write('Trident ');
  459.             if xbyte = 1 then
  460.               Write('8800BR')
  461.             else
  462.               Write('8800CS');
  463.             with regs do
  464.               begin
  465.               AX:=$7000;
  466.               BX:=0;
  467.               Intr($10, regs);
  468.               if AL = $70 then
  469.                 begin
  470.                 caption3('Everex Card');
  471.                 DX:=(DX and $FFF0) shr 4;
  472.                 case DX of
  473.                   $678: Write('Viewpoint');
  474.                   $236: Write('Ultragraphics II');
  475.                   $620: Write('Vision VGA');
  476.                   $673: Write('EVGA')
  477.                 else
  478.                   dontknow2;
  479.                 end; {case}
  480.                 vidmem:=((CH shr 6) * 256) + 256;
  481.                 caption3('Monitor');
  482.                 if CL < 8 then
  483.                   Writeln(trividmons[CL])
  484.                 else
  485.                   Writeln('(unknown) - ', CL);
  486.                 end
  487.               end;
  488.             end;
  489.           end;
  490.         if vgacard = standard then
  491.           begin
  492.           checking('Tseng');
  493.           if tsengCK = 1 then
  494.             begin
  495.             ClrEol;
  496.             Writeln('Tseng');
  497.             vgacard:=tseng
  498.             end;
  499.           end;
  500.         if vgacard = standard then
  501.           begin
  502.           checking('ZyMOS');
  503.           if zymosCK = 2 then
  504.             begin
  505.             ClrEol;
  506.             Writeln('ZyMOS');
  507.             vgacard:=zymos
  508.             end;
  509.           end;
  510.         if vgacard = standard then
  511.           with regs do
  512.             begin
  513.             checking('ATI');
  514.             s:=readROM($C000, $31, 9);
  515.             if s = '761295520' then
  516.               begin
  517.               vgacard:=ati;
  518.               ClrEol;
  519.               Write('ATI');
  520.               caption3('Board');
  521.               s:=readROM($C000, $40, 2);
  522.               if s = '31' then
  523.                 Write('VGAWonder');
  524.               if s = '32' then
  525.                 Write('EGAWonder 800+');
  526.               caption3('Revision');
  527.               Write(Mem[$C000:$4C], decimal, Mem[$C000:$4D]);
  528.               caption3('gate version');
  529.               c:=Chr(Mem[$C000:$43]);
  530.               if c = '3' then
  531.                 Writeln('2 w/ VRAM')
  532.               else
  533.                 Writeln(c);
  534.               xbyte:=Mem[$C000:$42];
  535.               caption3('mouse port');
  536.               yesorno2(xbyte and 2 = 2);
  537.               caption3('microchannel');
  538.               yesorno2(xbyte and 8 = 8);
  539.               caption3('non-interlaced available');
  540.               yesorno(xbyte and 4 = 4);
  541.               xword1:=MemW[$C000:$10];
  542.               xbyte:=ATIinfo($BB, xword1);
  543.               caption3('monitor');
  544.               Writeln(atividmons[xbyte and $0F]);
  545.               xbyte:=xbyte and $20;
  546.               if xbyte = $20 then
  547.                 vidmem:=512
  548.               else
  549.                 vidmem:=256;
  550.               end;
  551.             end;
  552.         if vgacard = standard then
  553.           begin
  554.           checking('Paradise');
  555.           s:=readROM($C000, $7D, 4);
  556.           if s = 'VGA=' then
  557.             begin
  558.             vgacard:=paradise;
  559.             ClrEol;
  560.             Write('Western Digital/Paradise');
  561.             cli;
  562.             PortW[$3CE]:=$0B0F;
  563.             vidmem:=(Port[$3CF] shr 4) * word(64);
  564.             sti;
  565.             vidmem:=(vidmem div 256) * 256;
  566.             caption3('Frequencies are');
  567.             cli;
  568.             PortW[$3CE]:=$0F0F;
  569.             xbyte:=Port[$3CF];
  570.             sti;
  571.             if (xbyte and $80) = $80 then
  572.               Writeln('multi-sync')
  573.             else
  574.               Writeln('fixed-sync')
  575.             end;
  576.           end;
  577.           if vgacard = standard then
  578.             begin
  579.             ClrEol;
  580.             dontknow;
  581.             end;
  582.           captfont;
  583.           showfont($01);
  584.           showfont($02);
  585.           showfont($03);
  586.           showfont($04);
  587.           showfont($05);
  588.           showfont($06);
  589.           showfont($07);
  590.           int101210;
  591.           with regs do
  592.             begin
  593.             AX:=$1009;
  594.             ES:=seg(VGAbuf);
  595.             DX:=ofs(VGAbuf);
  596.             intr($10, regs)
  597.             end;
  598.           caption2('Palette registers');
  599.           for i:=$00 to $0F do
  600.             write(hex(VGAbuf[i], 2), ' ');
  601.           writeln;
  602.           caption2('Border color');
  603.           writeln(hex(VGAbuf[$10], 2));
  604.           caption2('Color page');
  605.           with regs do
  606.             begin
  607.             AX:=$101A;
  608.             intr($10, regs);
  609.             writeln('$', hex(BH, 2));
  610.             caption2('Paging mode');
  611.             case BL of
  612.               $00 : writeln('4 pages of 64 registers');
  613.               $01 : writeln('16 pages of 16 registers')
  614.               else
  615.                 unknown('mode', BL, 2)
  616.             end
  617.             end
  618.         end;
  619.     PC3270 : begin
  620.              writeln('3270 PC');
  621.              captfont
  622.              end
  623.   else
  624.     unknown('adapter', graphdriver, 4)
  625.   end {case}
  626.   end; {page_06}
  627.