home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / i / ifp1s156.zip / PAGE_06.PAS < prev    next >
Pascal/Delphi Source File  |  1992-12-30  |  39KB  |  1,198 lines

  1. unit page_06;
  2.  
  3. interface
  4.  
  5. uses crt, dos, graph, ifpglobl, ifpcomon, ifpextrn;
  6.  
  7. procedure page06;
  8.  
  9. implementation
  10.  
  11. procedure page06;
  12. const
  13.   atividmons: array[0..15] of string[24] =
  14.                ('EGA', 'analog monochrome', 'TTL monochrome', 'analog color',
  15.                 'RGB color', 'Multisync or compatible', '(unknown)',
  16.                 'PS/2 8514 or compatible', 'Seiko 1430', 'MultiSync 2A',
  17.                 'Tatung OmniScan', 'NEC 3D or compatible', 'TVM 3M',
  18.                 'NEC MultiSync XL/+/4D/5D', 'TVM 2A', 'TVM 3A');
  19.   trividmons: array[0..7] of string[17] =
  20.                ('MDA', 'CGA', 'EGA', 'Digital multisync', 'VGA', '8514',
  21.                 'SuperVGA', 'Analog multisync');
  22.   parachips: array[1..4] of string[7] =
  23.                ('PVGA1A', 'WD90C00', 'WD90C10', 'WD90C11');
  24.  
  25.  
  26. type
  27.   cardtype = (none, vesa, standard, paradise, video7, ati, ahead, cirrus,
  28.                cti, genoa, trident, tseng, zymos);
  29.   VESAitype = record
  30.                 signature: array[0..3] of char;
  31.                 version: word;
  32.                 OEMnameOfs: word;
  33.                 OEMnameSeg: word;
  34.                 capabilities: array[0..3] of byte;
  35.                 modesOfs: word;
  36.                 modesSeg: word;
  37.                 reserved: array[0..237] of byte;
  38.               end;
  39.   VESAmtype = record
  40.                 modeattr: word;
  41.                 winaattr: byte; {Window A attributes}
  42.                 winbattr: byte; {Window B attributes}
  43.                 wingran: word;  {Window Granularity}
  44.                 winsize: word;  {Window Size}
  45.                 winaseg: word;  {Window A segment}
  46.                 winbseg: word;  {Window B segment}
  47.                 posOfs: word;   {Offset of Far call to positioning function}
  48.                 posSeg: word;   {Segment ..}
  49.                 scansize: word; {Bytes per scan line}
  50.                 {The following information is optional for VESA modes,
  51.                  required for OEM modes}
  52.                 pixwidth: word;
  53.                 pixheight: word;
  54.                 charwidth: byte;
  55.                 charheight: byte;
  56.                 memplanes: byte;
  57.                 pixelbits: byte;
  58.                 banks: byte;
  59.                 memmodel: byte;
  60.                 banksize: byte;
  61.                 reserved: array[0..227] of byte;
  62.               end;
  63.  
  64. ATIvidtype = record
  65.                columns: byte;
  66.                maxrow: byte;
  67.                lines_a_row: byte;
  68.                buffer_size: word;
  69.                seqreg: array[1..4] of byte;
  70.                miscreg: byte;
  71.                crtsreg: array[0..$18] of byte;
  72.                attrreg: array[0..$13] of byte;
  73.                graphreg: array[0..8] of byte;
  74.              end;
  75.  
  76. var
  77.   i : byte;
  78.   VGAbuf : array[$00..$10] of byte;
  79.   VESAinfo: VESAitype;
  80.   VESAmode: VESAmtype;
  81.   xbyte, xbyte2, xbyte3, paralock1, paralock2: byte;
  82.   xword1 : word;
  83.   xword2 : word;
  84.   xword3 : word;
  85.   xword4 : word;
  86.   vgacard: cardtype;
  87.   vidmem : word;
  88.   s: string;
  89.   c: char;
  90.   saveattr, savex, savey: byte;
  91.   foundone, foundit: boolean;
  92.  
  93. procedure captfont;
  94.   begin
  95.   caption1('Font           Address');
  96.   Writeln;
  97.   Write('INT 1FH        ');
  98.   segofs(longint(intvec[$1F]) shr 16, longint(intvec[$1F]) and $0000FFFF);
  99.   Writeln
  100.   end; {captfont}
  101.  
  102. procedure showfont(a : byte);
  103.   const
  104.     fontnames: array [0..7] of string[12] = (
  105.                  'INT 1FH     ',
  106.                  'INT 43H     ',
  107.                  'ROM 8x14    ',
  108.                  'ROM 8x8 (lo)',
  109.                  'ROM 8x8 (hi)',
  110.                  'ROM 9x14    ',
  111.                  'ROM 8x16    ',
  112.                  'ROM 9x16    ');
  113.  
  114.   begin
  115.   with regs do
  116.     begin
  117.     Write(fontnames[a], '   ');
  118.     AX:=$1130;
  119.     BH:=a;
  120.     intr($10, regs);
  121.     segofs(ES, BP);
  122.     Writeln
  123.     end
  124.   end; {showfont}
  125.  
  126. procedure int101210;
  127.   const
  128.     memnames: array[0..3] of string[4] = ('64K', '128K', '192K', '256K');
  129.  
  130.   begin
  131.   with regs do
  132.     begin
  133.     AH:=$12;
  134.     BL:=$10;
  135.     intr($10, regs);
  136.     caption2('Display type');
  137.     case BH of
  138.       $00 : Writeln('color');
  139.       $01 : Writeln('monochrome')
  140.       else
  141.         unknown('display', BH, 2)
  142.     end;
  143.     caption2('Memory');
  144.     if vidmem > 0 then
  145.       Writeln(vidmem, 'K')
  146.     else
  147.       if BL < 4 then
  148.         Writeln(memnames[BL], ' as determined from standard BIOS call')
  149.       else
  150.         unknown('size', BL, 2);
  151.     if vgacard = none then
  152.       begin
  153.       caption2('Feature bits');
  154.       Writeln(bin4(CH and $0F));
  155.       caption2('DIP switches (EGA)');
  156.       Writeln(bin4(CL and $0F))
  157.       end
  158.     end
  159.   end;
  160.  
  161.   function readROM(seg, ofs: word; length: byte): string;
  162.     var
  163.       x: word;
  164.       s: string;
  165.  
  166.     begin
  167.     s:='';
  168.     for x:=ofs to ofs + (length - 1) do
  169.       s:=s + Chr(Mem[seg:x]);
  170.     readROM:=s
  171.     end; {readROM}
  172.  
  173.   procedure checking(s: string);
  174.     var
  175.       x, y: byte;
  176.     begin
  177.     x:=WhereX;
  178.     y:=WhereY;
  179.     ClrEol;
  180.     Write('Checking for ', s);
  181.     GotoXY(x, y);
  182.     end; {checking}
  183.  
  184.   procedure d8or16bit(b: boolean);
  185.     begin
  186.     if b then
  187.       Write('8-bit')
  188.     else
  189.       Write('16-bit');
  190.     end;
  191.  
  192.   procedure cli;
  193.     inline($FA);
  194.  
  195.   procedure sti;
  196.     inline($FB);
  197.  
  198.   function isXGA: word;
  199.     var
  200.       POSport, cardID, tmpw: word;
  201.       tmp, tmp1, tmp2, tmp3, tmp4: byte;
  202.       slot: byte;
  203.       regs: registers;
  204.       foundit: boolean;
  205.  
  206.     begin
  207.     isXGA:=0;
  208.     foundit:=false;
  209.     with regs do
  210.       begin
  211.       DX:=$FFFF;
  212.       AX:=$C400;
  213.       Intr($15, regs);
  214.       if (not nocarry(regs)) or (DX = -1) then
  215.         Exit;
  216.       posport:=DX;
  217.       slot:=0;
  218.       repeat
  219.         cli;
  220.         if slot = 0 then
  221.           Port[$94]:=$DF
  222.         else
  223.           begin
  224.           AX:=$C401;
  225.           BX:=slot;
  226.           Intr($15, regs)
  227.           end;
  228.         cardID:=PortW[POSport];
  229.         tmp1:=Port[POSport + 2];
  230.         tmp2:=Port[POSport + 3];
  231.         tmp3:=Port[POSport + 4];
  232.         tmp4:=Port[POSport + 5];
  233.         if slot = 0 then
  234.           Port[$94]:=$FF
  235.         else
  236.           begin
  237.           AX:=$C402;
  238.           BX:=slot;
  239.           Intr($15, regs);
  240.           end;
  241.         cli;
  242.         if (cardID >= $8FD8) and (cardID <= $8FDB) then
  243.           begin
  244.           tmpw:=tmp1 and $E;
  245.           POSport:=(tmpw shl 3) + $2100;
  246.           Port[POSport + $A]:=$52;
  247.           tmp:=Port[POSport + $B] and $F;
  248.           if (tmp <> 0) and (tmp <> $F) then
  249.             foundit:=true
  250.           else
  251.             Inc(slot);
  252.           end
  253.         else
  254.           Inc(slot);
  255.       until foundit or (slot > 9);
  256.       end;
  257.     if foundit then
  258.       isXGA:=POSport;
  259.     end; {isXGA}
  260.  
  261.   procedure isport2(var regs: registers; var foundit: boolean);
  262.     var
  263.       savebx, saveax: word;
  264.       tmp: byte;
  265.  
  266.     begin
  267.     with regs do
  268.       begin
  269.       savebx:=BX;
  270.       BX:=AX;
  271.       Port[DX]:=AL;
  272.       AH:=AL;
  273.       AL:=Port[DX + 1];
  274.       tmp:=AH;
  275.       AH:=AL;
  276.       AL:=tmp;
  277.       saveax:=AX;
  278.       AX:=BX;
  279.       PortW[DX]:=AX;
  280.       Port[DX]:=AL;
  281.       AH:=AL;
  282.       AL:=Port[DX + 1];
  283.       AL:=AL and BH;
  284.       foundit:=(AL = BH);
  285.       if AL = BH then
  286.         begin
  287.         AL:=AH;
  288.         AH:=0;
  289.         Port[DX]:=AX;
  290.         Port[DX]:=AL;
  291.         AH:=AL;
  292.         AL:=Port[DX + 1];
  293.         AL:=AL and BH;
  294.         foundit:=(AL = 0);
  295.         end;
  296.       AX:=saveax;
  297.       PortW[DX]:=AX;
  298.       BX:=savebx;
  299.       end;
  300.     end;
  301.  
  302.   begin (* procedure page_06 *)
  303.   vgacard:=none;
  304.   caption2('Display adapter');
  305.   checking('VESA');
  306.   with regs do
  307.     begin
  308.     AX:=$4F00;
  309.     ES:=Seg(VESAinfo);
  310.     DI:=Ofs(VESAinfo);
  311.     Intr($10, regs);
  312.     s:='';
  313.     if (AL = $4F) and (AH = 0) and (VESAinfo.signature = 'VESA') then
  314.       begin
  315.       with VESAinfo do
  316.         begin
  317.         vgacard:=vesa;
  318.         ClrEol;
  319.         Writeln('VESA version ', Hi(version), decimal, Lo(version));
  320.         caption2('OEM ID');
  321.         xword1:=OEMnameSeg;
  322.         xword2:=OEMnameOfs;
  323.         s:='';
  324.         c:=Chr(Mem[xword1:xword2]);
  325.         while c <> #0 do
  326.           begin
  327.           Write(c);
  328.           s:=s + c;
  329.           Inc(xword2);
  330.           c:=Chr(Mem[xword1:xword2])
  331.           end;
  332.         caption3('Manufacturer');
  333.         if s = '761295520' then
  334.           Writeln('ATI')
  335.         else
  336.           Writeln(s)
  337.         end;
  338.       caption1('Video modes supported:');
  339.       Writeln;
  340.       xword2:=VESAinfo.modesSeg;
  341.       xword3:=VESAinfo.modesOfs;
  342.       with VESAmode do
  343.         while MemW[xword2:xword3] <> $FFFF do
  344.           begin
  345.           xword1:=MemW[xword2:xword3];
  346.           pause3(4);
  347.           if endit then
  348.             Exit;
  349.           caption2('Number');
  350.           Write(hex(xword1, 4));
  351.           AX:=$4F01;
  352.           CX:=xword1;
  353.           ES:=Seg(VESAmode);
  354.           DI:=Ofs(VESAmode);
  355.           Intr($10, regs);
  356.           if (AX = $004F) and (modeattr and 1 = 1) then
  357.             begin
  358.             caption3('Mode');
  359.             if modeattr and 8 = 8 then
  360.               Write('Color ')
  361.             else
  362.               Write('Monochrome ');
  363.             if modeattr and $10 = $10 then
  364.               Write('graphics')
  365.             else
  366.               Write('text');
  367.             caption3('BIOS output support');
  368.             yesorno(modeattr and 4 = 4);
  369.             if modeattr and 2 = 2 then
  370.               begin
  371.               caption3('Screen size');
  372.               Write(pixwidth, 'x', pixheight);
  373.               caption3('Character size');
  374.               Write(charwidth, 'x', charheight);
  375.               caption3('Colors');
  376.               Writeln(exp((pixelbits * 1.0) * ln(2.0)):1:0);
  377.               caption3('Memory model');
  378.               case memmodel of
  379.                 0: Write('Text');
  380.                 1: Write('CGA');
  381.                 2: Write('Hercules');
  382.                 3: Write('4-plane');
  383.                 4: Write('Packed-pixel');
  384.                 5: Write('Nonchain 4');
  385.                 6..$0F: Write('(reserved)');
  386.               else
  387.                 Write('(unknown)')
  388.               end;
  389.               caption3('Memory planes');
  390.               Write(memplanes);
  391.               caption3('Memory banks');
  392.               Write(banks);
  393.               if banks > 1 then
  394.                 begin
  395.                 caption3('Bank size');
  396.                 Write(banksize, 'K')
  397.                 end;
  398.               Writeln;
  399.               end;
  400.             end;
  401.             Inc(xword3, 2);
  402.           end;
  403.       TextColor(LightGreen);
  404.       Write('The next screen will show standard information, so ');
  405.       pause1;
  406.       if endit then
  407.         Exit;
  408.       ClrScr;
  409.       caption2('Display adapter');
  410.       end;
  411.     end;
  412.   vgacard:=none;
  413.   vidmem:=0;
  414.   ClrEol;
  415.   case graphdriver of
  416.     CGA : begin
  417.           Writeln('CGA');
  418.           captfont
  419.           end;
  420.     MCGA : begin
  421.            Writeln('MCGA');
  422.            captfont;
  423.            showfont($01);
  424.            showfont($03);
  425.            showfont($04);
  426.            showfont($06)
  427.            end;
  428.     EGA..EGAmono : begin
  429.                  Writeln('EGA');
  430.                  captfont;
  431.                  showfont($01);
  432.                  showfont($02);
  433.                  showfont($03);
  434.                  showfont($04);
  435.                  showfont($05);
  436.                  int101210;
  437.                  xbyte:=mem[BIOSdseg : $0087];
  438.                  caption2('Mode change preserves screen buffer');
  439.                  yesorno(xbyte and $80 = $80);
  440.                  caption2('EGA active');
  441.                  yesorno(xbyte and $08 = $00);
  442.                  caption2('Wait for display enable');
  443.                  yesorno(xbyte and $04 = $04);
  444.                  caption2('CGA cursor emulation');
  445.                  yesorno(xbyte and $01 = $00);
  446.            (*  PC Magazine 6:12 p.326  *)
  447.                  caption2('Save area                    ');
  448.                  xword1:=memw[BIOSdseg : $00AA];
  449.                  xword2:=memw[BIOSdseg : $00A8];
  450.                  segofs(xword1, xword2);
  451.                  Writeln;
  452.            (*  PC Tech Journal 3:4 p.65  *)
  453.                  caption2('Video parameter table        ');
  454.                  segofs(memw[xword1 : xword2 +  2], memw[xword1 : xword2]);
  455.                  Writeln;
  456.                  caption2('Dynamic save area            ');
  457.                  xword3:=memw[xword1 : xword2 +  6];
  458.                  xword4:=memw[xword1 : xword2 +  4];
  459.                  if (xword3 > $0000) or (xword4 > $0000) then
  460.                    begin
  461.                    segofs(xword3, xword4);
  462.                    Writeln
  463.                    end
  464.                  else
  465.                    Writeln('(none)');
  466.                  caption2('Auxiliary character generator');
  467.                  xword3:=memw[xword1 : xword2 + 10];
  468.                  xword4:=memw[xword1 : xword2 +  8];
  469.                  if (xword3 > $0000) or (xword4 > $0000) then
  470.                    begin
  471.                    segofs(xword3, xword4);
  472.                    Writeln
  473.                    end
  474.                  else
  475.                    Writeln('(none)');
  476.                  caption2('Graphics mode auxiliary table');
  477.                  xword3:=memw[xword1 : xword2 + 14];
  478.                  xword4:=memw[xword1 : xword2 + 12];
  479.                  if (xword3 > $0000) or (xword4 > $0000) then
  480.                    segofs(xword3, xword4)
  481.                  else
  482.                    Write('(none)')
  483.            (*  PC Tech Journal 3:4 p.67  *)
  484.                end;
  485.     hercmono : begin
  486.                Writeln('Hercules or MDA');
  487.                captfont
  488.                end;
  489.     IBM8514 : begin
  490.               Writeln('IBM 8514');
  491.               captfont
  492.               end;
  493.     ATT400 : begin
  494.              Writeln('AT&T 400');
  495.              captfont
  496.              end;
  497.     VGA : begin
  498.           if novgacheck then
  499.             begin
  500.             Writeln('VGA');
  501.             caption3('Chipset');
  502.             Writeln('Detection blocked by NV command-line switch!');
  503.             end
  504.           else
  505.             begin
  506.             xword1:=isXGA;
  507.             if xword1 > 0 then
  508.               if Port[xword1] and 1 = 1 then
  509.                 Writeln('XGA')
  510.               else
  511.                 Writeln('VGA, XGA on other monitor')
  512.             else
  513.               Writeln('VGA');
  514.             vidmem:=0;
  515.             caption3('Chipset');
  516.             vgacard:=standard;
  517.             if vgacard = standard then
  518.               begin
  519.               checking('Video 7');
  520.               if Port[$3CC] and 1 = 1 then
  521.                 xword1:=$3D0
  522.               else
  523.                 xword1:=$3B0;
  524.               Port[xword1 + 4]:=$C;
  525.               i:=Port[xword1 + 5];
  526.               Port[xword1 + 5]:=$55;
  527.               xbyte:=Port[xword1 + 5];
  528.               Port[xword1 + 4]:=$1F;
  529.               xbyte2:=Port[xword1 + 5];
  530.               Port[xword1 + 4]:=$C;
  531.               Port[xword1 + 5]:=i;
  532.               if xbyte2 = $55 xor $EA then
  533.                 begin
  534.                 vgacard:=video7;
  535.                 ClrEol;
  536.                 Write('Video 7 - ');
  537.                 port[$3C4]:=$8E;
  538.                 xbyte:=Port[$3C5];
  539.                 case xbyte of
  540.                   $80..$FF: Writeln('Vega VGA');
  541.                   $70..$7F: with regs do
  542.                               begin
  543.                               AX:=$6F07;
  544.                               Intr($10, regs);
  545.                               if (AH and $80) = $80 then
  546.                                 Writeln('VRAM')
  547.                               else
  548.                                 Writeln('FastWrite');
  549.                               end;
  550.                   $50..$59: Writeln('VGA Version 5');
  551.                   $40..$49: Writeln('1024i')
  552.                 else
  553.                   Writeln('unknown value $', hex(xbyte, 2));
  554.                 end;
  555.                 caption3('  Chip revision');
  556.                 Port[$3C4]:=$8E;
  557.                 Write(Port[$3C5]);
  558.                 Port[$3C4]:=$FF;
  559.                 xbyte:=Port[$3C5];
  560.                 with regs do
  561.                   begin
  562.                   AX:=$6F07;
  563.                   Intr($10, regs);
  564.                   if AL = $6F then
  565.                     begin
  566.                     vidmem:=256 * (AH and $7F);
  567.                     caption3('Memory type');
  568.                     if AH and $80 = $80 then
  569.                       Writeln('VRAM')
  570.                     else
  571.                       Writeln('DRAM')
  572.                     end
  573.                   else
  574.                     vidmem:=256;
  575.                   end;
  576.                 caption3('  Memory');
  577.                 d8or16bit((xbyte and 1) = 0);
  578.                 caption3('I/O');
  579.                 d8or16bit((xbyte and 2) = 0);
  580.                 caption3('BIOS');
  581.                 d8or16bit((xbyte and 8) = 0);
  582.                 caption3('bus');
  583.                 caption3('Fast-Write');
  584.                 yesorno((xbyte and 4) = 4);
  585.                 end;
  586.               end;
  587.             if vgacard = standard then
  588.               begin
  589.               checking('AHEAD');
  590.               s:=readROM($C000, $25, 5);
  591.               if s = 'AHEAD' then
  592.                 begin
  593.                 vgacard:=ahead;
  594.                 ClrEol;
  595.                 Writeln('Ahead');
  596.                 end
  597.               end;
  598.             if vgacard = standard then
  599.               begin
  600.               checking('Genoa');
  601.               s:=readROM($C000, MemW[$C000:$37], 4);
  602.               if (s[1] = #$77) and (Copy(s, 3, 2) = #$99#$66) then
  603.                 begin
  604.                 vgacard:=genoa;
  605.                 ClrEol;
  606.                 Write('Genoa ');
  607.                 case Ord(s[2]) of
  608.                   $33: Write('5100/5200 (Tseng ET3000 based)');
  609.                   $55: Write('5300/5400 (Tseng ET3000 based)');
  610.                   $22: Write('6100');
  611.                   $00: Write('6200/6300');
  612.                   $11: Write('6400/6600')
  613.                 else
  614.                   Write('(unknown type - $', hex(Ord(s[2]), 2), ')');
  615.                 end;
  616.                 Writeln;
  617.                 if (s[2] = #$33) or (s[2] = #$55) then
  618.                   begin
  619.                   end
  620.                 else
  621.                   begin
  622.                   Port[$3C4]:=5;
  623.                   xbyte:=Port[$3C5];
  624.                   caption3('  Bus');
  625.                   if (xbyte and 1) = 1 then
  626.                     Write('PC')
  627.                   else
  628.                     Write('MCA');
  629.                   caption3('Video width');
  630.                   d8or16bit((xbyte and 2) = 2);
  631.                   caption3('BIOS width');
  632.                   d8or16bit((xbyte and 4) = 4);
  633.                   caption3('I/O ports at');
  634.                   if (xbyte and $10) = $10 then
  635.                     Writeln('$3xx')
  636.                   else
  637.                     Writeln('$2xx');
  638.                   caption3('  BIOS size');
  639.                   case (xbyte and $60) shr 5 of
  640.                     0, 3: Write('24K');
  641.                     1: Write('30K');
  642.                     2: Write('32K')
  643.                   end;
  644.                   Port[$3C4]:=7;
  645.                   xbyte:=Port[$3C5];
  646.                   caption3('Monitor type');
  647.                   if (xbyte and $20) = $20 then
  648.                     Write('TTL digital')
  649.                   else
  650.                     Write('analog');
  651.                   caption3('Chipset on');
  652.                   if (xbyte and 8) = 8 then
  653.                     Writeln('motherboard')
  654.                   else
  655.                     Writeln('adapter card');
  656.                   Port[$3C4]:=$10;
  657.                   xbyte:=Port[$3C5];
  658.                   caption3('  Fast scroll');
  659.                   yesorno2((xbyte and 1) = 1);
  660.                   caption3('Fast address');
  661.                   yesorno2((xbyte and 2) = 2);
  662.                   caption3('Fast write');
  663.                   yesorno((xbyte and $40) = $40);
  664.                   Port[$3C4]:=8;
  665.                   xbyte:=Port[$3C5];
  666.                   caption3('  70Hz vertical retrace');
  667.                   yesorno2((xbyte and $10) = $10);
  668.                   xword1:=MemW[$40:$63];
  669.                   Port[xword1]:=$2F;
  670.                   xbyte:=Port[xword1 + 1];
  671.                   caption3('Interlaced');
  672.                   yesorno((xbyte and 1) = 1);
  673.                   end
  674.                 end
  675.               end;
  676.             if vgacard = standard then
  677.               begin
  678.               checking('Cirrus');
  679.               xword1:=CirrusCK;
  680.               if xword1 <> 0 then
  681.                 begin
  682.                 vgacard:=cirrus;
  683.                 ClrEol;
  684.                 Write('Cirrus');
  685.                 caption3('chipset type');
  686.                 case xword1 of
  687.                   $EC: Write('510/520');
  688.                   $CA: Write('610/620');
  689.                   $EA: Write('Video Seven')
  690.                 else
  691.                   Write('unknown - $', hex(xword1, 2))
  692.                 end;
  693.                 caption3('Cirrus BIOS');
  694.                 s:=readROM($C000, 6, 2);
  695.                 yesorno(s = 'CL');
  696.                 end;
  697.               end;
  698.             if vgacard = standard then
  699.               begin
  700.               checking('CTI');
  701.               Port[$46E8]:=$1E;
  702.               xbyte:=Port[$104];
  703.               Port[$46E8]:=$E;
  704.               if xbyte = $A5 then
  705.                 with regs do
  706.                   begin
  707.                   AH:=$5F;
  708.                   AL:=0;
  709.                   Intr($10, regs);
  710.                   ClrEol;
  711.                   Write('CTI 82C45');
  712.                   Port[$46E8]:=$1E;
  713.                   Port[$103]:=$80;
  714.                   Port[$46E8]:=$E;
  715.                   Port[$3D6]:=0;
  716.                   xbyte:=Port[$3D7];
  717.                   xbyte3:=(xbyte and $F0) shr 4;
  718.                   if xbyte3 = 1 then
  719.                     begin
  720.                     Port[$3D6]:=$3A;
  721.                     i:=Port[$3D7];
  722.                     Port[$3D7]:=$AA;
  723.                     xbyte2:=Port[$3D7];
  724.                     Port[$3D7]:=i;
  725.                     if xbyte2 = $AA then
  726.                       xbyte3:=2
  727.                     else
  728.                       xbyte3:=1;
  729.                     end;
  730.                   Port[$46E8]:=$1E;
  731.                   Port[$103]:=0;
  732.                   Port[$46E8]:=$E;
  733.                   Port[$3D6]:=0;
  734.                   Str(xbyte3:0, s);
  735.                   Writeln(s);
  736.                   vgacard:=CTI;
  737.                   case BH of
  738.                     0: vidmem:=256;
  739.                     1: vidmem:=512;
  740.                     2: vidmem:=1024;
  741.                   else
  742.                     vidmem:=0;
  743.                   end;
  744.                   caption3('  Chip revision');
  745.                   Writeln(xbyte and $0F);
  746.                   caption3('micro-channel');
  747.                   yesorno2(CX and 2 = 2);
  748.                   caption3('DAC size');
  749.                   if CX and 1 = 1 then
  750.                     Writeln('8-bit')
  751.                   else
  752.                     Writeln('6-bit');
  753.                   end;
  754.               end;
  755.             if vgacard = standard then
  756.               begin
  757.               checking('Trident');
  758.               Port[$3C4]:=$0B;
  759.               xbyte:=Port[$3C5];
  760.               if (xbyte <= 6) and (xbyte >= 2) then
  761.   {
  762.                 Port[$3C5]:=Port[$3C5];
  763.                 Port[$3C4]:=$0E;
  764.                 i:=Port[$3C5];
  765.                 Port[$3C5]:=0;
  766.                 xbyte:=Port[$3C5] and $0F;
  767.                 Port[$3C5]:=i;
  768.                 if xbyte = 2 then
  769.   }
  770.                 begin
  771.                 vgacard:=trident;
  772.                 ClrEol;
  773.                 Write('Trident ');
  774.   {
  775.                 Port[$3C4]:=$0B;
  776.                 Port[$3C5]:=0;
  777.                 xbyte3:=Port[$3C5];
  778.   }
  779.                 case xbyte of
  780.                   1: Writeln('8800BR');
  781.                   2: Writeln('8800CS')
  782.                 else
  783.                   begin
  784.                   Writeln('8900');
  785.                   Port[$3C4]:=$1F;
  786.                   xbyte:=Port[$3C5] and 3;
  787.                   case xbyte of
  788.                     0: vidmem:=256;
  789.                     1: vidmem:=512;
  790.                     2, 3: vidmem:=1024;
  791.                   end; {case}
  792.                   end;
  793.                 end;
  794.                 caption3('  BIOS');
  795.                 Port[$3C4]:=$F;
  796.                 xbyte:=Port[$3C5];
  797.                 d8or16bit((xbyte and $80) = 0);
  798.                 caption3('interlaced');
  799.                 Port[$3C4]:=$1E;
  800.                 xbyte:=Port[$3C5];
  801.                 yesorno((xbyte and $20) = $20);
  802.                 with regs do
  803.                   begin
  804.                   AX:=$7000;
  805.                   BX:=0;
  806.                   Intr($10, regs);
  807.                   if AL = $70 then
  808.                     begin
  809.                     caption3('Everex Card');
  810.                     DX:=(DX and $FFF0) shr 4;
  811.                     case DX of
  812.                       $678: Write('Viewpoint');
  813.                       $236: Write('Ultragraphics II');
  814.                       $620: Write('Vision VGA');
  815.                       $673: Write('EVGA')
  816.                     else
  817.                       dontknow2;
  818.                     end; {case}
  819.                     vidmem:=((CH shr 6) * 256) + 256;
  820.                     caption3('Monitor');
  821.                     if CL < 8 then
  822.                       Writeln(trividmons[CL])
  823.                     else
  824.                       Writeln('(unknown) - ', CL);
  825.                     end
  826.                   end;
  827.                 end;
  828.               end;
  829.             if vgacard = standard then
  830.               begin
  831.               checking('Tseng');
  832.               xbyte:=tsengCK;
  833.               if xbyte = 1 then
  834.                 begin
  835.                 ClrEol;
  836.                 Write('Tseng ET');
  837.                 if Port[$3CC] and 1 = 1 then
  838.                   xword:=$3D0
  839.                 else
  840.                   xword:=$3B0;
  841.                 Port[xword + 4]:=$33;
  842.                 xbyte:=Port[xword + 5];
  843.                 Port[xword + 5]:=xbyte xor $F;
  844.                 xbyte2:=Port[xword + 5];
  845.                 Port[xword + 5]:=xbyte;
  846.                 if xbyte2 = xbyte xor $F then
  847.                   begin
  848.                   Write('4000');
  849.                   Port[$3BF]:=3;
  850.                   Port[$3D8]:=$A0;
  851.                   with regs do
  852.                     begin
  853.                     AX:=$10F1;
  854.                     BL:=0;
  855.                     Intr($10, regs);
  856.                     if AL=$10 then
  857.                       case BL of
  858.                         0: Writeln(' w/ normal DAC');
  859.                         1: Writeln(' w/ SC1148x HiColor DAC');
  860.                         2: Writeln(' w/ new HiColor DAC')
  861.                       else
  862.                         Writeln(' w/ unknown HiColor DAC');
  863.                       end;
  864.                     end;
  865.                   Port[xword + 4]:=$37;
  866.                   xbyte:=Port[xword + 5];
  867.                   if xbyte and 8 = 0 then
  868.                     vidmem:=256
  869.                   else
  870.                     case xbyte and 3 of
  871.                       0,1: vidmem:=256;
  872.                       2: vidmem:=512;
  873.                       3: vidmem:=1024;
  874.                     end
  875.                   end
  876.                 else
  877.                   Write('3000');
  878.                 caption3('ROM');
  879.                 d8or16bit((xbyte and $10) = 0);
  880.                 caption3('Video');
  881.                 Port[xword + 4]:=$36;
  882.                 xbyte:=Port[xword + 5];
  883.                 d8or16bit((xbyte and $40) = 0);
  884.                 caption3('I/O');
  885.                 d8or16bit((xbyte and $80) = 0);
  886.                 Writeln;
  887.                 Port[xword + 4]:=$37;
  888.                 xbyte:=Port[xword + 5];
  889.                 caption3('Memory type');
  890.                 if xbyte and $80 = $80 then
  891.                   Write('VRAM')
  892.                 else
  893.                   Write('DRAM');
  894.                 Port[$3C4]:=7;
  895.                 xbyte:=Port[$3C5];
  896.                 caption3('Compatibility');
  897.                 if xbyte and $80 = $80 then
  898.                   Write('VGA')
  899.                 else
  900.                   Write('EGA');
  901.                 caption3('ROM address');
  902.                 if xbyte and $20 = 0 then
  903.                   if xbyte and 8 = 0 then
  904.                     Writeln('C000-C3FF')
  905.                   else
  906.                     Writeln('disabled')
  907.                 else
  908.                   if xbyte and 8 = 0 then
  909.                     Writeln('C000-C5FF and C680 - C7FF')
  910.                   else
  911.                     Writeln('C000-C7FF');
  912.                 vgacard:=tseng
  913.                 end;
  914.               end;
  915.             if vgacard = standard then
  916.               begin
  917.               checking('ZyMOS');
  918.               if zymosCK = 2 then
  919.                 begin
  920.                 ClrEol;
  921.                 Writeln('ZyMOS');
  922.                 vgacard:=zymos
  923.                 end;
  924.               end;
  925.             if vgacard = standard then
  926.               begin
  927.               checking('Oak');
  928.               with regs do
  929.                 begin
  930.                 DX:=$3DE;
  931.                 AX:=$FF11;
  932.                 isport2(regs, foundit);
  933.                 if foundit then
  934.                   begin
  935.                   ClrEol;
  936.                   Writeln('Oak');
  937.                   Port[$3DE]:=$D;
  938.                     asm
  939.                        jmp  @1
  940.                     @1:
  941.                     end;
  942.                   xbyte:=Port[$3DF];
  943.                   if xbyte and $80 = $80 then
  944.                     vidmem:=512
  945.                   else
  946.                     vidmem:=256;
  947.                   end;
  948.                 end;
  949.               end;
  950.             if vgacard = standard then
  951.               with regs do
  952.                 begin
  953.                 checking('ATI');
  954.                 s:=readROM($C000, $31, 9);
  955.                 if s = '761295520' then
  956.                   begin
  957.                   vgacard:=ati;
  958.                   ClrEol;
  959.                   Write('ATI ');
  960.                   c:=Chr(Mem[$C000:$43]);
  961.                   case c of
  962.                     '1': Write('18800');
  963.                     '2': Write('18800-1');
  964.                     '3': Write('28800-2');
  965.                     '4': Write('28800-4');
  966.                     '5': Write('28800-5');
  967.                   end;
  968.                   caption3('Board');
  969.                   s:=readROM($C000, $40, 2);
  970.                   if s = '31' then
  971.                     Write('VGAWonder');
  972.                   if s = '32' then
  973.                     Write('EGAWonder 800+');
  974.                   caption3('Revision');
  975.                   Write(Mem[$C000:$4D], decimal);
  976.                   ZeroPad(Mem[$C000:$4C]);
  977.                   xbyte:=Mem[$C000:$42];
  978.                   caption3('mouse port');
  979.                   yesorno(xbyte and 2 = 2);
  980.                   caption3('programmable video clock');
  981.                   yesorno2(xbyte and $10 = $10);
  982.                   xword1:=MemW[$C000:$10];
  983.                   xbyte:=ATIinfo($BB, xword1);
  984.                   caption3('monitor');
  985.                   Writeln(atividmons[xbyte and $0F]);
  986.                   if c > '0' then
  987.                     begin
  988.                     xbyte:=Mem[$C000:$44];
  989.                     caption3('70Hz non-interlace');
  990.                     yesorno2(xbyte and 1 = 1);
  991.                     caption3('Korean chars');
  992.                     yesorno2(xbyte and 2 = 2);
  993.                     caption3('Memory clock');
  994.                     if (xbyte and 4 = 4) then
  995.                       Writeln('45MHz')
  996.                     else
  997.                       Writeln('40MHz');
  998.                     caption3('Zero wait state');
  999.                     yesorno2(xbyte and 8 = 8);
  1000.                     caption3('Paged ROMs');
  1001.                     yesorno2(xbyte and $10 = $10);
  1002.                     caption3('8514/A');
  1003.                     yesorno2(xbyte and $40 <> $40);
  1004.                     caption3('HiColor DAC');
  1005.                     yesorno(xbyte and $80 = $80);
  1006.                     end;
  1007.                   caption3('Video modes');
  1008.                   xbyte2:=0;
  1009.                   foundone:=false;
  1010.                   for xbyte:=0 to 255 do
  1011.                     begin
  1012.                     AH:=$12;
  1013.                     AL:=xbyte;
  1014.                     BX:=$5506;
  1015.                     BP:=$FFFF;
  1016.                     Intr($10, regs);
  1017.                     if BP <> $FFFF then
  1018.                       begin
  1019.                       Write(hex(xbyte, 2), ' ');
  1020.                       Inc(xbyte2);
  1021.                       foundone:=true;
  1022.                       if xbyte2 = 21 then
  1023.                         begin
  1024.                         Writeln;
  1025.                         Write('               ');
  1026.                         xbyte2:=0;
  1027.                         end;
  1028.                       end;
  1029.                     end;
  1030.                   if (not foundone) or (foundone and (xbyte <> 0)) then
  1031.                     Writeln;
  1032.                   vidmem:=256;
  1033.                   if (c = '1') or (c = '2') then
  1034.                     begin
  1035.                     if ATIinfo($BB, xword1) and $20 = $20 then
  1036.                       vidmem:=512;
  1037.                     end
  1038.                   else
  1039.                     begin
  1040.                     xbyte:=ATIinfo($B0, xword1);
  1041.                     if xbyte and $10 = $10 then
  1042.                       vidmem:=512;
  1043.                     if c <> '3' then
  1044.                       if xbyte and 8 = 8 then
  1045.                         vidmem:=1024;
  1046.                     end;
  1047.                   end;
  1048.                 end;
  1049.             if vgacard = standard then
  1050.               begin
  1051.               checking('Paradise');
  1052.               s:=readROM($C000, $7D, 4);
  1053.               if s = 'VGA=' then
  1054.                 begin
  1055.                 vgacard:=paradise;
  1056.                 ClrEol;
  1057.                 Write('Western Digital/Paradise ');
  1058.                 Port[$3CE]:=$F;
  1059.                 paralock1:=Port[$3CF];
  1060.                 Port[$3CF]:=5;
  1061.                 Port[$3C4]:=7;
  1062.                 if Port[$3CC] and 1 = 1 then
  1063.                   xword:=$3D0
  1064.                 else
  1065.                   xword:=$3B0;
  1066.                 Port[xword + 4]:=$29;
  1067.                 paralock2:=Port[xword + 5];
  1068.                 Port[xword + 5]:=$85;
  1069.                 PortW[$3C4]:=$4806;
  1070.                 Port[xword + 4]:=$2B;
  1071.                 xbyte:=Port[xword + 5];
  1072.                 Port[xword + 5]:=$AA;
  1073.                 xbyte2:=Port[xword + 5];
  1074.                 Port[xword + 5]:=xbyte;
  1075.                 if xbyte2 <> $AA then
  1076.                   xbyte3:=1
  1077.                 else
  1078.                   begin
  1079.                   Port[$3C4]:=$12;
  1080.                   xbyte:=Port[$3C5];
  1081.                   Port[$3C5]:=xbyte and $BF;
  1082.                   xbyte2:=Port[$3C5] and $40;
  1083.                   if xbyte2 <> 0 then
  1084.                     begin
  1085.                     Port[$3C5]:=xbyte;
  1086.                     xbyte3:=2;
  1087.                     end
  1088.                   else
  1089.                     begin
  1090.                     Port[$3C5]:=xbyte or $40;
  1091.                     xbyte2:=Port[$3C] and $40;
  1092.                     if xbyte2 = 0 then
  1093.                       begin
  1094.                       Port[$3C5]:=xbyte;
  1095.                       xbyte3:=2;
  1096.                       end
  1097.                     else
  1098.                       begin
  1099.                       Port[$3C5]:=xbyte;
  1100.                       xbyte3:=4;
  1101.                       Port[$3C4]:=$10;
  1102.                       xbyte:=Port[$3C5];
  1103.                       Port[$3C5]:=xbyte and $FB;
  1104.                       xbyte2:=Port[$3C5] and 4;
  1105.                       if xbyte2 <> 0 then
  1106.                         xbyte3:=3;
  1107.                       Port[$3C5]:=xbyte or 4;
  1108.                       xbyte2:=Port[$3C5] and 4;
  1109.                       if xbyte2 = 0 then
  1110.                         xbyte3:=3;
  1111.                       Port[$3C5]:=xbyte;
  1112.                       end
  1113.                     end
  1114.                   end;
  1115.                 Writeln(parachips[xbyte3]);
  1116.                 Port[$3CE]:=$0B;
  1117.                 for xbyte:=1 to 2 do;
  1118.                 xbyte:=Port[$3CF];
  1119.                 vidmem:=word(64) * (xbyte shr 4);
  1120.                 caption3('Video');
  1121.                 d8or16bit((xbyte and 4) = 0);
  1122.                 caption3('ROM');
  1123.                 d8or16bit((xbyte and 2) = 0);
  1124.                 caption3('Frequencies are');
  1125.                 Port[$3CE]:=$0F;
  1126.                 xbyte:=Port[$3CF];
  1127.                 if (xbyte and $80) = $80 then
  1128.                   Writeln('multi-sync')
  1129.                 else
  1130.                   Writeln('fixed-sync');
  1131.                 Port[xword + 4]:=$29;
  1132.                 Port[xword + 5]:=paralock2;
  1133.                 Port[$3CE]:=$F;
  1134.                 Port[$3CF]:=paralock1;
  1135.                 end;
  1136.               end;
  1137.             if vgacard = standard then
  1138.               begin
  1139.               ClrEol;
  1140.               dontknow;
  1141.               end;
  1142.             end;
  1143.           captfont;
  1144.           showfont($01);
  1145.           showfont($02);
  1146.           showfont($03);
  1147.           showfont($04);
  1148.           showfont($05);
  1149.           showfont($06);
  1150.           showfont($07);
  1151.           int101210;
  1152.           saveattr:=TextAttr;
  1153.           savex:=WhereX;
  1154.           savey:=WhereY;
  1155.           TextColor(LightRed + Blink);
  1156.           Write('**Retrieving palette information**');
  1157.           with regs do
  1158.             begin
  1159.             AX:=$1009;
  1160.             ES:=seg(VGAbuf);
  1161.             DX:=ofs(VGAbuf);
  1162.             intr($10, regs)
  1163.             end;
  1164.           GotoXY(savex, savey);
  1165.           Write('                                  ');
  1166.           GotoXY(savex, savey);
  1167.           TextAttr:=saveattr;
  1168.           caption2('Palette registers');
  1169.           for i:=$00 to $0F do
  1170.             Write(hex(VGAbuf[i], 2), ' ');
  1171.           Writeln;
  1172.           caption2('Border color');
  1173.           Write(hex(VGAbuf[$10], 2));
  1174.           caption3('Color page');
  1175.           with regs do
  1176.             begin
  1177.             AX:=$101A;
  1178.             intr($10, regs);
  1179.             Write('$', hex(BH, 2));
  1180.             caption3('Paging mode');
  1181.             case BL of
  1182.               $00 : Writeln('4 pages of 64 registers');
  1183.               $01 : Writeln('16 pages of 16 registers')
  1184.               else
  1185.                 unknown('mode', BL, 2)
  1186.             end
  1187.             end
  1188.         end;
  1189.     PC3270 : begin
  1190.              Writeln('3270 PC');
  1191.              captfont
  1192.              end
  1193.   else
  1194.     unknown('adapter', graphdriver, 4)
  1195.   end {case}
  1196.   end; {page06}
  1197. end.
  1198.