home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / HARDWARE / INFOP120.ZIP / PAGE_06.INC < prev    next >
Encoding:
Text File  |  1990-07-29  |  9.3 KB  |  316 lines

  1. procedure page_06;
  2. type
  3.   cardtype = (standard, paradise, video7, ati);
  4.  
  5. var
  6.   i : byte;
  7.   VGAbuf : array[$00..$10] of byte;
  8.   xbyte : byte;
  9.   xword1 : word;
  10.   xword2 : word;
  11.   xword3 : word;
  12.   xword4 : word;
  13.   vgacard: cardtype;
  14.   vidmem : word;
  15.   s: string;
  16.  
  17. procedure captfont;
  18.   begin
  19.   caption1('Font           Address');
  20.   writeln;
  21.   write('INT 1FH        ');
  22.   segofs(longint(intvec[$1F]) shr 16, longint(intvec[$1F]) and $0000FFFF);
  23.   writeln
  24.   end; {captfont}
  25.  
  26. procedure showfont(a : byte);
  27.   begin
  28.   with regs do
  29.     begin
  30.     case a of
  31.       $00 : write('INT 1FH     ');
  32.       $01 : write('INT 43H     ');
  33.       $02 : write('ROM 8x14    ');
  34.       $03 : write('ROM 8x8 (lo)');
  35.       $04 : write('ROM 8x8 (hi)');
  36.       $05 : write('ROM 9x14    ');
  37.       $06 : write('ROM 8x16    ');
  38.       $07 : write('ROM 9x16    ')
  39.     end;
  40.     write('   ');
  41.     AX:=$1130;
  42.     BH:=a;
  43.     intr($10, regs);
  44.     segofs(ES, BP);
  45.     writeln
  46.     end
  47.   end; {showfont}
  48.  
  49. procedure int101210;
  50.   begin
  51.   with regs do
  52.     begin
  53.     AH:=$12;
  54.     BL:=$10;
  55.     intr($10, regs);
  56.     caption2('Display type');
  57.     case BH of
  58.       $00 : writeln('color');
  59.       $01 : writeln('monochrome')
  60.       else
  61.         unknown('display', BH, 2)
  62.     end;
  63.     caption2('Memory');
  64.     if vgacard <> standard then
  65.       Writeln(vidmem, 'K')
  66.     else
  67.       case BL of
  68.         $00 : writeln('64K');
  69.         $01 : writeln('128K');
  70.         $02 : writeln('192K');
  71.         $03 : writeln('256K')
  72.         else
  73.           unknown('size', BL, 2)
  74.       end;
  75.     caption2('Feature bits');
  76.     writeln(bin4(CH and $0F));
  77.     caption2('DIP switches');
  78.     writeln(bin4(CL and $0F))
  79.     end
  80.   end;
  81.  
  82.   procedure ATIinfo;
  83.   begin
  84.   inline($FA/               {cli}
  85.          $8B/$96/xword1/    {mov dx,[xword1]}
  86.          $8A/$86/xbyte/     {mov al,[xbyte]}
  87.          $EE/               {out dx,al}
  88.          $42/               {inc dx}
  89.          $EC/               {in al,dx}
  90.          $88/$86/xbyte/     {mov [xbyte],al}
  91.          $FB);              {sti}
  92.    end; {ATIinfo}
  93.  
  94.   begin (* procedure page_06 *)
  95.   vgacard:=standard;
  96.   caption2('Display adapter');
  97.   case graphdriver of
  98.     CGA : begin
  99.           writeln('CGA');
  100.           captfont
  101.           end;
  102.     MCGA : begin
  103.            writeln('MCGA');
  104.            captfont;
  105.            showfont($01);
  106.            showfont($03);
  107.            showfont($04);
  108.            showfont($06)
  109.            end;
  110.     EGA..EGAmono : begin
  111.                  writeln('EGA');
  112.                  captfont;
  113.                  showfont($01);
  114.                  showfont($02);
  115.                  showfont($03);
  116.                  showfont($04);
  117.                  showfont($05);
  118.                  int101210;
  119.                  xbyte:=mem[BIOSdseg : $0087];
  120.                  caption2('Mode change preserves screen buffer');
  121.                  yesorno(xbyte and $80 = $80);
  122.                  caption2('EGA active');
  123.                  yesorno(xbyte and $08 = $00);
  124.                  caption2('Wait for display enable');
  125.                  yesorno(xbyte and $04 = $04);
  126.                  caption2('CGA cursor emulation');
  127.                  yesorno(xbyte and $01 = $00);
  128.            (*  PC Magazine 6:12 p.326  *)
  129.                  caption2('Save area                    ');
  130.                  xword1:=memw[BIOSdseg : $00AA];
  131.                  xword2:=memw[BIOSdseg : $00A8];
  132.                  segofs(xword1, xword2);
  133.                  writeln;
  134.            (*  PC Tech Journal 3:4 p.65  *)
  135.                  caption2('Video parameter table        ');
  136.                  segofs(memw[xword1 : xword2 +  2], memw[xword1 : xword2]);
  137.                  writeln;
  138.                  caption2('Dynamic save area            ');
  139.                  xword3:=memw[xword1 : xword2 +  6];
  140.                  xword4:=memw[xword1 : xword2 +  4];
  141.                  if (xword3 > $0000) or (xword4 > $0000) then
  142.                    begin
  143.                    segofs(xword3, xword4);
  144.                    writeln
  145.                    end
  146.                  else
  147.                    writeln('(none)');
  148.                  caption2('Auxiliary character generator');
  149.                  xword3:=memw[xword1 : xword2 + 10];
  150.                  xword4:=memw[xword1 : xword2 +  8];
  151.                  if (xword3 > $0000) or (xword4 > $0000) then
  152.                    begin
  153.                    segofs(xword3, xword4);
  154.                    writeln
  155.                    end
  156.                  else
  157.                    writeln('(none)');
  158.                  caption2('Graphics mode auxiliary table');
  159.                  xword3:=memw[xword1 : xword2 + 14];
  160.                  xword4:=memw[xword1 : xword2 + 12];
  161.                  if (xword3 > $0000) or (xword4 > $0000) then
  162.                    segofs(xword3, xword4)
  163.                  else
  164.                    write('(none)')
  165.            (*  PC Tech Journal 3:4 p.67  *)
  166.                end;
  167.     hercmono : begin
  168.                writeln('Hercules or MDA');
  169.                captfont
  170.                end;
  171.     IBM8514 : begin
  172.               writeln('IBM 8514');
  173.               captfont
  174.               end;
  175.     ATT400 : begin
  176.              writeln('AT&T 400');
  177.              captfont
  178.              end;
  179.     VGA : begin
  180.           writeln('VGA');
  181.           caption3('Chipset');
  182.           vgacard:=standard;
  183.           with regs do
  184.             begin
  185.             AX:=$7F;
  186.             BH:=2;
  187.             Intr($10, regs);
  188.             if BH = $7F then
  189.               begin
  190.               vgacard:=paradise;
  191.               Write('Paradise');
  192.               vidmem:=word(64) * CH;
  193.               caption3('Frequencies are');
  194.               AX:=$7F;
  195.               BH:=$1F;
  196.               Intr($10, regs);
  197.               if (BL and $80) = $80 then
  198.                 Writeln('multi-sync')
  199.               else
  200.                 Writeln('fixed-sync')
  201.               end;
  202.             AX:=$6F00;
  203.             BX:=0;
  204.             Intr($10, regs);
  205.             if BX = $5637 then
  206.               begin
  207.               vgacard:=video7;
  208.               Write('Video 7');
  209.               AX:=$6F07;
  210.               Intr($10, regs);
  211.               if AL = $6F then
  212.                 begin
  213.                 vidmem:=256 * (AH and $7F);
  214.                 caption3('memory type');
  215.                 if AH and $80 = $80 then
  216.                   Writeln('VRAM')
  217.                 else
  218.                   Writeln('DRAM')
  219.                 end
  220.               else
  221.                 vidmem:=256;
  222.               end;
  223.             s:='';
  224.             for xword1:=$31 to $39 do
  225.               s:=s + Chr(Mem[$C000:xword1]);
  226.             if s = '761295520' then
  227.               begin
  228.               vgacard:=ati;
  229.               Write('ATI');
  230.               s:=Chr(Mem[$C000:$40]) + Chr(Mem[$C000:$41]);
  231.               if s = '31' then
  232.                 begin
  233.                 xbyte:=Mem[$C000:$42];
  234.                 caption3('mouse port');
  235.                 yesorno2(xbyte and 2 = 2);
  236.                 caption3('microchannel');
  237.                 yesorno(xbyte and 8 = 8);
  238.                 caption3('  non-interlaced 1024x768 available');
  239.                 yesorno2(xbyte and 4 = 4);
  240.                 xword1:=MemW[$C000:$10];
  241.                 xbyte:=$BB;
  242.                 ATIinfo;
  243.                 xbyte:=xbyte and $0F;
  244.                 caption3('monitor');
  245.                 case xbyte of
  246.                   $0: Writeln('EGA');
  247.                   $1: Writeln('analog monochrome');
  248.                   $2: Writeln('TTL monochrome');
  249.                   $3: Writeln('analog color');
  250.                   $4: Writeln('RGB color');
  251.                   $5: Writeln('Multisync (generic)');
  252.                   $7: Writeln('8514');
  253.                   $9: Writeln('NEC MultiSync 2A');
  254.                   $B: Writeln('NEC MultiSync 3D');
  255.                   $D: Writeln('NEC MultiSync XL')
  256.                 else
  257.                   Writeln('(unknown)');
  258.                 end; {case}
  259.                 xbyte:=$BB;
  260.                 ATIinfo;
  261.                 xbyte:=xbyte and $20;
  262.                 if xbyte = $20 then
  263.                   vidmem:=512
  264.                 else
  265.                   vidmem:=256;
  266.                 end;
  267.               end;
  268.             end;
  269.           if vgacard = standard then
  270.             Writeln('(unknown)');
  271.           captfont;
  272.           showfont($01);
  273.           showfont($02);
  274.           showfont($03);
  275.           showfont($04);
  276.           showfont($05);
  277.           showfont($06);
  278.           showfont($07);
  279.           int101210;
  280.           with regs do
  281.             begin
  282.             AX:=$1009;
  283.             ES:=seg(VGAbuf);
  284.             DX:=ofs(VGAbuf);
  285.             intr($10, regs)
  286.             end;
  287.           caption2('Palette registers');
  288.           for i:=$00 to $0F do
  289.             write(hex(VGAbuf[i], 2), ' ');
  290.           writeln;
  291.           caption2('Border color');
  292.           writeln(hex(VGAbuf[$10], 2));
  293.           caption2('Color page');
  294.           with regs do
  295.             begin
  296.             AX:=$101A;
  297.             intr($10, regs);
  298.             writeln('$', hex(BH, 2));
  299.             caption2('Paging mode');
  300.             case BL of
  301.               $00 : writeln('4 pages of 64 registers');
  302.               $01 : writeln('16 pages of 16 registers')
  303.               else
  304.                 unknown('mode', BL, 2)
  305.             end
  306.             end
  307.         end;
  308.     PC3270 : begin
  309.              writeln('3270 PC');
  310.              captfont
  311.              end
  312.   else
  313.     unknown('adapter', graphdriver, 4)
  314.   end {case}
  315.   end; {page_06}
  316.