home *** CD-ROM | disk | FTP | other *** search
/ Frostbyte's 1980s DOS Shareware Collection / floppyshareware.zip / floppyshareware / DOOG / INFOP131.ZIP / PAGE_06.INC < prev    next >
Text File  |  1990-09-04  |  14KB  |  456 lines

  1. procedure page_06;
  2. type
  3.   cardtype = (vesa, standard, paradise, video7, ati);
  4.   VESAitype = record
  5.                 signature: array[0..3] of char;
  6.                 version: word;
  7.                 OEMnameOfs: word;
  8.                 OEMnameSeg: word;
  9.                 capabilities: array[0..3] of byte;
  10.                 modesOfs: word;
  11.                 modesSeg: word;
  12.                 reserved: array[0..237] of byte;
  13.               end;
  14.   VESAmtype = record
  15.                 modeattr: word;
  16.                 winaattr: byte; {Window A attributes}
  17.                 winbattr: byte; {Window B attributes}
  18.                 wingran: word;  {Window Granularity}
  19.                 winsize: word;  {Window Size}
  20.                 winaseg: word;  {Window A segment}
  21.                 winbseg: word;  {Window B segment}
  22.                 posOfs: word;   {Offset of Far call to positioning function}
  23.                 posSeg: word;   {Segment ..}
  24.                 scansize: word; {Bytes per scan line}
  25.                 {The following information is optional for VESA modes,
  26.                  required for OEM modes}
  27.                 pixwidth: word;
  28.                 pixheight: word;
  29.                 charwidth: byte;
  30.                 charheight: byte;
  31.                 memplanes: byte;
  32.                 pixelbits: byte;
  33.                 banks: byte;
  34.                 memmodel: byte;
  35.                 banksize: byte;
  36.                 reserved: array[0..227] of byte;
  37.               end;
  38.  
  39. var
  40.   i : byte;
  41.   VGAbuf : array[$00..$10] of byte;
  42.   VESAinfo: VESAitype;
  43.   VESAmode: VESAmtype;
  44.   xbyte : byte;
  45.   xword1 : word;
  46.   xword2 : word;
  47.   xword3 : word;
  48.   xword4 : word;
  49.   vgacard: cardtype;
  50.   vidmem : word;
  51.   s: string;
  52.   c: char;
  53.   saveattr, savex, savey: byte;
  54.  
  55. procedure captfont;
  56.   begin
  57.   caption1('Font           Address');
  58.   writeln;
  59.   write('INT 1FH        ');
  60.   segofs(longint(intvec[$1F]) shr 16, longint(intvec[$1F]) and $0000FFFF);
  61.   writeln
  62.   end; {captfont}
  63.  
  64. procedure showfont(a : byte);
  65.   begin
  66.   with regs do
  67.     begin
  68.     case a of
  69.       $00 : write('INT 1FH     ');
  70.       $01 : write('INT 43H     ');
  71.       $02 : write('ROM 8x14    ');
  72.       $03 : write('ROM 8x8 (lo)');
  73.       $04 : write('ROM 8x8 (hi)');
  74.       $05 : write('ROM 9x14    ');
  75.       $06 : write('ROM 8x16    ');
  76.       $07 : write('ROM 9x16    ')
  77.     end;
  78.     write('   ');
  79.     AX:=$1130;
  80.     BH:=a;
  81.     intr($10, regs);
  82.     segofs(ES, BP);
  83.     writeln
  84.     end
  85.   end; {showfont}
  86.  
  87. procedure int101210;
  88.   begin
  89.   with regs do
  90.     begin
  91.     AH:=$12;
  92.     BL:=$10;
  93.     intr($10, regs);
  94.     caption2('Display type');
  95.     case BH of
  96.       $00 : writeln('color');
  97.       $01 : writeln('monochrome')
  98.       else
  99.         unknown('display', BH, 2)
  100.     end;
  101.     caption2('Memory');
  102.     if vgacard <> standard then
  103.       Writeln(vidmem, 'K')
  104.     else
  105.       case BL of
  106.         $00 : writeln('64K');
  107.         $01 : writeln('128K');
  108.         $02 : writeln('192K');
  109.         $03 : writeln('256K')
  110.         else
  111.           unknown('size', BL, 2)
  112.       end;
  113.     caption2('Feature bits');
  114.     writeln(bin4(CH and $0F));
  115.     caption2('DIP switches (EGA)');
  116.     writeln(bin4(CL and $0F))
  117.     end
  118.   end;
  119.  
  120.   procedure searching;
  121.     begin
  122.     savex:=WhereX;
  123.     savey:=WhereY;
  124.     saveattr:=TextAttr;
  125.     TextColor(LightRed + Blink);
  126.     Write('** Searching for supported modes **');
  127.     TextAttr:=saveattr;
  128.     GotoXY(savex, savey);
  129.     end;
  130.  
  131.   begin (* procedure page_06 *)
  132.   vgacard:=standard;
  133.   caption2('Display adapter');
  134.   with regs do
  135.     begin
  136.     AX:=$4F00;
  137.     ES:=Seg(VESAinfo);
  138.     DI:=Ofs(VESAinfo);
  139.     Intr($10, regs);
  140.     s:='';
  141.     if (AL = $4F) and (AH = 0) and (VESAinfo.signature = 'VESA') then
  142.       begin
  143.       with VESAinfo do
  144.         begin
  145.         vgacard:=vesa;
  146.         Writeln('VESA version ', Hi(version), Chr(country[9]), Lo(version));
  147.         caption2('OEM ID');
  148.         xword1:=OEMnameSeg;
  149.         xword2:=OEMnameOfs;
  150.         s:='';
  151.         c:=Chr(Mem[xword1:xword2]);
  152.         while c <> #0 do
  153.           begin
  154.           Write(c);
  155.           s:=s + c;
  156.           Inc(xword2);
  157.           c:=Chr(Mem[xword1:xword2])
  158.           end;
  159.         caption3('Manufacturer');
  160.         if s = '761295520' then
  161.           Writeln('ATI')
  162.         else
  163.           Writeln('(unknown)');
  164.         end;
  165.       caption1('Video modes supported:');
  166.       Writeln;
  167.       searching;
  168.       with VESAmode do
  169.         for xword1:=$0000 to $7FFF do
  170.           begin
  171.           AX:=$4F01;
  172.           CX:=xword1;
  173.           ES:=Seg(VESAmode);
  174.           DI:=Ofs(VESAmode);
  175.           Intr($10, regs);
  176.           if (AX = $004F) and (modeattr and 1 = 1) then
  177.             begin
  178.             Write('                                   ');
  179.             GotoXY(savex, savey);
  180.             pause3(4);
  181.             if endit then
  182.               Exit;
  183.             caption2('Number');
  184.             Write(hex(xword1, 4));
  185.             caption3('Mode');
  186.             if modeattr and 8 = 8 then
  187.               Write('Color ')
  188.             else
  189.               Write('Monochrome ');
  190.             if modeattr and $10 = $10 then
  191.               Write('graphics')
  192.             else
  193.               Write('text');
  194.             caption3('BIOS output support');
  195.             yesorno(modeattr and 4 = 4);
  196.             if modeattr and 2 = 2 then
  197.               begin
  198.               caption3('Screen size');
  199.               Write(pixwidth, 'x', pixheight);
  200.               caption3('Character size');
  201.               Write(charwidth, 'x', charheight);
  202.               caption3('Colors');
  203.               Writeln(exp((pixelbits * 1.0) * ln(2.0)):1:0);
  204.               caption3('Memory model');
  205.               case memmodel of
  206.                 3: Write('Planar');
  207.                 4: Write('Bit-packed');
  208.               else
  209.                 Write('(unkown - ', hex(memmodel, 4), ')')
  210.               end;
  211.               caption3('Memory planes');
  212.               Write(memplanes);
  213.               caption3('Memory banks');
  214.               Write(banks);
  215.               if banks > 1 then
  216.                 begin
  217.                 caption3('Bank size');
  218.                 Write(banksize, 'K')
  219.                 end;
  220.               Writeln;
  221.               end;
  222.             Writeln;
  223.             searching
  224.             end;
  225.           end;
  226.       Write('                                   ');
  227.       GotoXY(savex, savey);
  228.       TextColor(LightGreen);
  229.       Write('The next screen will show standard information, so ');
  230.       pause1;
  231.       if endit then
  232.         Exit;
  233.       ClrScr;
  234.       caption2('Display adapter');
  235.       end;
  236.     end;
  237.   case graphdriver of
  238.     CGA : begin
  239.           writeln('CGA');
  240.           captfont
  241.           end;
  242.     MCGA : begin
  243.            writeln('MCGA');
  244.            captfont;
  245.            showfont($01);
  246.            showfont($03);
  247.            showfont($04);
  248.            showfont($06)
  249.            end;
  250.     EGA..EGAmono : begin
  251.                  writeln('EGA');
  252.                  captfont;
  253.                  showfont($01);
  254.                  showfont($02);
  255.                  showfont($03);
  256.                  showfont($04);
  257.                  showfont($05);
  258.                  int101210;
  259.                  xbyte:=mem[BIOSdseg : $0087];
  260.                  caption2('Mode change preserves screen buffer');
  261.                  yesorno(xbyte and $80 = $80);
  262.                  caption2('EGA active');
  263.                  yesorno(xbyte and $08 = $00);
  264.                  caption2('Wait for display enable');
  265.                  yesorno(xbyte and $04 = $04);
  266.                  caption2('CGA cursor emulation');
  267.                  yesorno(xbyte and $01 = $00);
  268.            (*  PC Magazine 6:12 p.326  *)
  269.                  caption2('Save area                    ');
  270.                  xword1:=memw[BIOSdseg : $00AA];
  271.                  xword2:=memw[BIOSdseg : $00A8];
  272.                  segofs(xword1, xword2);
  273.                  writeln;
  274.            (*  PC Tech Journal 3:4 p.65  *)
  275.                  caption2('Video parameter table        ');
  276.                  segofs(memw[xword1 : xword2 +  2], memw[xword1 : xword2]);
  277.                  writeln;
  278.                  caption2('Dynamic save area            ');
  279.                  xword3:=memw[xword1 : xword2 +  6];
  280.                  xword4:=memw[xword1 : xword2 +  4];
  281.                  if (xword3 > $0000) or (xword4 > $0000) then
  282.                    begin
  283.                    segofs(xword3, xword4);
  284.                    writeln
  285.                    end
  286.                  else
  287.                    writeln('(none)');
  288.                  caption2('Auxiliary character generator');
  289.                  xword3:=memw[xword1 : xword2 + 10];
  290.                  xword4:=memw[xword1 : xword2 +  8];
  291.                  if (xword3 > $0000) or (xword4 > $0000) then
  292.                    begin
  293.                    segofs(xword3, xword4);
  294.                    writeln
  295.                    end
  296.                  else
  297.                    writeln('(none)');
  298.                  caption2('Graphics mode auxiliary table');
  299.                  xword3:=memw[xword1 : xword2 + 14];
  300.                  xword4:=memw[xword1 : xword2 + 12];
  301.                  if (xword3 > $0000) or (xword4 > $0000) then
  302.                    segofs(xword3, xword4)
  303.                  else
  304.                    write('(none)')
  305.            (*  PC Tech Journal 3:4 p.67  *)
  306.                end;
  307.     hercmono : begin
  308.                writeln('Hercules or MDA');
  309.                captfont
  310.                end;
  311.     IBM8514 : begin
  312.               writeln('IBM 8514');
  313.               captfont
  314.               end;
  315.     ATT400 : begin
  316.              writeln('AT&T 400');
  317.              captfont
  318.              end;
  319.     VGA : begin
  320.           writeln('VGA');
  321.           caption3('Chipset');
  322.           vgacard:=standard;
  323.           with regs do
  324.             begin
  325.             AX:=$7F;
  326.             BH:=2;
  327.             Intr($10, regs);
  328.             if BH = $7F then
  329.               begin
  330.               vgacard:=paradise;
  331.               Write('Paradise');
  332.               vidmem:=word(64) * CH;
  333.               caption3('Frequencies are');
  334.               AX:=$7F;
  335.               BH:=$1F;
  336.               Intr($10, regs);
  337.               if (BL and $80) = $80 then
  338.                 Writeln('multi-sync')
  339.               else
  340.                 Writeln('fixed-sync')
  341.               end;
  342.             AX:=$6F00;
  343.             BX:=0;
  344.             Intr($10, regs);
  345.             if BX = $5637 then
  346.               begin
  347.               vgacard:=video7;
  348.               Write('Video 7');
  349.               AX:=$6F07;
  350.               Intr($10, regs);
  351.               if AL = $6F then
  352.                 begin
  353.                 vidmem:=256 * (AH and $7F);
  354.                 caption3('memory type');
  355.                 if AH and $80 = $80 then
  356.                   Writeln('VRAM')
  357.                 else
  358.                   Writeln('DRAM')
  359.                 end
  360.               else
  361.                 vidmem:=256;
  362.               end;
  363.             s:='';
  364.             for xword1:=$31 to $39 do
  365.               s:=s + Chr(Mem[$C000:xword1]);
  366.             if s = '761295520' then
  367.               begin
  368.               vgacard:=ati;
  369.               Write('ATI');
  370.               s:=Chr(Mem[$C000:$40]) + Chr(Mem[$C000:$41]);
  371.               if s = '31' then
  372.                 begin
  373.                 xbyte:=Mem[$C000:$42];
  374.                 caption3('mouse port');
  375.                 yesorno2(xbyte and 2 = 2);
  376.                 caption3('microchannel');
  377.                 yesorno(xbyte and 8 = 8);
  378.                 caption3('  non-interlaced 1024x768 available');
  379.                 yesorno2(xbyte and 4 = 4);
  380.                 xword1:=MemW[$C000:$10];
  381.                 xbyte:=ATIinfo($BB, xword1) and $0F;
  382.                 caption3('monitor');
  383.                 case xbyte of
  384.                   $0: Writeln('EGA');
  385.                   $1: Writeln('analog monochrome');
  386.                   $2: Writeln('TTL monochrome');
  387.                   $3: Writeln('analog color');
  388.                   $4: Writeln('RGB color');
  389.                   $5: Writeln('Multisync or compatible');
  390.                   $7: Writeln('PS/2 8514 or compatible');
  391.                   $9: Writeln('NEC MultiSync 2A');
  392.                   $A: Writeln('Tatung OmniScan');
  393.                   $B: Writeln('NEC 3D or compatible');
  394.                   $C: Writeln('TVM 3M');
  395.                   $D: Writeln('NEC MultiSync XL/+/4D/5D');
  396.                   $E: Writeln('TVM 3A');
  397.                   $F: Writeln('TVM 2A');
  398.                 else
  399.                   Writeln('(unknown type - ', hex(xbyte, 2), ')');
  400.                 end; {case}
  401.                 xbyte:=ATIinfo($BB, xword1) and $20;;
  402.                 if xbyte = $20 then
  403.                   vidmem:=512
  404.                 else
  405.                   vidmem:=256;
  406.                 end;
  407.               end;
  408.             end;
  409.           if vgacard = standard then
  410.             Writeln('(unknown)');
  411.           captfont;
  412.           showfont($01);
  413.           showfont($02);
  414.           showfont($03);
  415.           showfont($04);
  416.           showfont($05);
  417.           showfont($06);
  418.           showfont($07);
  419.           int101210;
  420.           with regs do
  421.             begin
  422.             AX:=$1009;
  423.             ES:=seg(VGAbuf);
  424.             DX:=ofs(VGAbuf);
  425.             intr($10, regs)
  426.             end;
  427.           caption2('Palette registers');
  428.           for i:=$00 to $0F do
  429.             write(hex(VGAbuf[i], 2), ' ');
  430.           writeln;
  431.           caption2('Border color');
  432.           writeln(hex(VGAbuf[$10], 2));
  433.           caption2('Color page');
  434.           with regs do
  435.             begin
  436.             AX:=$101A;
  437.             intr($10, regs);
  438.             writeln('$', hex(BH, 2));
  439.             caption2('Paging mode');
  440.             case BL of
  441.               $00 : writeln('4 pages of 64 registers');
  442.               $01 : writeln('16 pages of 16 registers')
  443.               else
  444.                 unknown('mode', BL, 2)
  445.             end
  446.             end
  447.         end;
  448.     PC3270 : begin
  449.              writeln('3270 PC');
  450.              captfont
  451.              end
  452.   else
  453.     unknown('adapter', graphdriver, 4)
  454.   end {case}
  455.   end; {page_06}
  456.