home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / QWIK13.ZIP / EGACHK.INC < prev    next >
Encoding:
Text File  |  1986-11-10  |  1.0 KB  |  20 lines

  1. { EGAcheck - check if EGA is in use                         ver 1.3, 11-10-86 }
  2. { If you want faster results with an EGA and also will use a CGA, this function
  3.   will check for existing EGA BIOS and use the faster loops that don't wait for
  4.   retrace as needed on the CGA.  }
  5.  
  6. var ToEGA: Boolean;      { Assign the result of EGAcheck to ToEGA as an }
  7.                          { initializing routine in your program!!!      }
  8.  
  9. Function EGAcheck: Boolean;
  10. begin
  11. Inline(
  12.   $B4/$12                {       MOV   AH,$12           ;Set AH for alt select}
  13.   /$BB/$10/$FF           {       MOV   BX,$FF10         ;Set BX for EGA info}
  14.   /$CD/$10               {       INT   $10              ;Interrupt}
  15.   /$80/$EF/$FF           {       SUB   BH,$FF           ;Check if BH changed}
  16.   /$74/$02               {       JZ    NoEGA            ;BH=false if no EGA}
  17.   /$B7/$01               {       MOV   BH,$01           ;Set BH=true ($01)}
  18.   /$88/$7E/$04           {NoEGA: MOV   [BP+$04],BH      ;EGAcheck: $01 or $00}
  19. );
  20. end;