home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / GRAPHICS / PLOT / SURFUTI3.ZIP / SETSYS.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1987-11-17  |  3.1 KB  |  128 lines

  1. procedure SETSYS;
  2. { Initialize system-dependent parameters, and check for hardware presence
  3.   if possible.  (Ncolors is set to 0 if the hardware is known to not be
  4.   present.
  5. }
  6.  
  7. begin
  8.   case System of
  9.     STDCGA: begin
  10.       Ngraphchar := 40;
  11.       Gxmin := 5;
  12.       Gxmax := 315;
  13.       Gymin := 5;
  14.       Gymax := 195;
  15.       Ncolors := 3;
  16.     end;
  17.     EGA: begin
  18.       Ngraphchar := 80;
  19.       Gxmin := 5;
  20.       Gxmax := 630;
  21.       Gymin := 5;
  22.       Gymax := 345;
  23.       { Set the number of available colors on this EGA system (dependent on the
  24.         amount of EGA memory on the board). }
  25.       Inline(
  26.       $B4/$12                {     MOV     AH,$12}
  27.       /$B3/$10               {     MOV     BL,$10}
  28.       /$B9/$FF/$FF           {     MOV     CX,$FFFF}
  29.       /$CD/$10               {     INT     $10}
  30.                              {     XOR     AX,AX}
  31.       /$81/$F9/$FF/$FF       {     CMP     CX,-1}
  32.       /$74/$00               {     JZ      X43}
  33.       /$B8/$03/$00           {     MOV     AX,$3}
  34.       /$08/$DB               {     OR      BL,BL}
  35.       /$74/$03               {     JZ      X43}
  36.       /$B8/$0F/$00           {     MOV     AX,$f}
  37.       /$A3/>NCOLORS          {X43:  MOV     [>Ncolors],AX}
  38.       );
  39.       if Ncolors = 0 then begin
  40.         writeln('You don''t have an EGA');
  41.         halt;
  42.       end;
  43.     end;
  44.     HERCULES: begin
  45.       Ngraphchar := 0;
  46.       Gxmin := 10;
  47.       Gymin := 5;
  48.       Gxmax := 709;
  49.       Gymax := 344;
  50.       Ncolors := 1;
  51.     end;
  52.     SANYO: begin
  53.       Ngraphchar := 80;
  54.       Gxmin := 10;
  55.       Gxmax := 630;
  56.       Gymin := 5;
  57.       Gymax := 195;
  58.       Ncolors := 7;
  59.     end;
  60.     Z100: begin
  61.       Ngraphchar := 0;
  62.       Gxmin := 5;
  63.       Gxmax := 630;
  64.       Gymin := 5;
  65.       Gymax := 220;
  66.       Ncolors := 7;
  67.     end;
  68.     TBCGA: begin
  69.       { Initialize the graphics first }
  70.       if (not TBinit) then begin
  71.         initgraphic;
  72.         exgraphic;
  73.         TBinit := TRUE;
  74.       end;
  75.       Ngraphchar := 40;
  76.       Gxmin := 10;
  77.       Gymin := 5;
  78.       Gxmax := Xscreenmaxglb - 10;
  79.       Gymax := Ymaxglb - 5;
  80.       Ncolors := 1;
  81.     end;
  82.     ATT: begin
  83.       { Initialize the graphics first }
  84.       if (not TBinit) then begin
  85.         initgraphic;
  86.         exgraphic;
  87.         TBinit := TRUE;
  88.       end;
  89.       Ngraphchar := 0;
  90.       Gxmin := 10;
  91.       Gymin := 5;
  92.       Gxmax := Xscreenmaxglb - 10;
  93.       Gymax := Ymaxglb - 5;
  94.       Ncolors := 15;
  95.     end;
  96.     IBM3270: begin
  97.       { Initialize the graphics first }
  98.       if (not TBinit) then begin
  99.         initgraphic;
  100.         exgraphic;
  101.         TBinit := TRUE;
  102.       end;
  103.       Ngraphchar := 0;
  104.       Gxmin := 10;
  105.       Gymin := 5;
  106.       Gxmax := Xscreenmaxglb - 10;
  107.       Gymax := Ymaxglb - 5;
  108.       Ncolors := 15;
  109.     end;
  110.     QUAD480: begin
  111.       Ncolors := 15;
  112.       Ngraphchar := 80;
  113.       Gxmin := 5;
  114.       Gxmax := 635;
  115.       Gymin := 5;
  116.       Gymax := 475;
  117.     end;
  118.     QUAD752: begin
  119.       Ncolors := 15;
  120.       Ngraphchar := 80;
  121.       Gxmin := 5;
  122.       Gxmax := 747;
  123.       Gymin := 5;
  124.       Gymax := 405;
  125.     end;
  126.   end; { case System }
  127. end; { procedure SETSYS }
  128.