home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / pascal / swag / screen.swg / 0004_DUALOUT1.PAS.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-05-28  |  2.5 KB  |  65 lines

  1. {
  2. > Who knows how to detect and access dual display's?
  3.  
  4. As this feature is only available if you're using VGA as the primary adapter
  5. you can get information about a second adapter by interrupt 10h.
  6.  
  7.         Get primary/secondary video adapter:
  8.         interrupt:      10h
  9.         input:          AH = 1Ah
  10.                         AL = 00h                               (subFunction)
  11.         output:         AL = 1Ah                (indicates Function support)
  12.                         BL = code For active card              (primary one)
  13.                         BH = code For inactive card
  14.  
  15.                         where following codes are valid:
  16.                         00h     no card
  17.                         01h     MDA With monochrome display
  18.                         02h     CGA With CGA display
  19.                         03h     reserved
  20.                         04h     EGA With EGA or multiscan display
  21.                         05h     EGA With monochrome display
  22.                         06h     reserved
  23.                         07h     VGA With monochrome display
  24.                         08h     VGA With VGA or multiscan display
  25.                         09h     reserved
  26.                         0Ah     MCGA With CGA display (PS/2)
  27.                         0Bh     MCGA With monochrome display (PS/2)
  28.                         0Ch     MCGA With color display (PS/2)
  29.                         FFh     unknown
  30.  
  31.         Set primary/secondary video adapter:
  32.         interrupt:      10h
  33.         input:          AH = 1Ah
  34.                         AL = 01h                                (subFunction)
  35.                         BL = code For active card        (here secondary one)
  36.                         BH = code For inactive card
  37.         output:         AH = 1Ah                 (indicates Function support)
  38.  
  39. First you call subFunction 00h to get the code of your primary and secondary
  40. video adapter. Then you can toggle between them by using subFunction 01h.
  41.  
  42. To get back ontopic (Pascal code is needed ;-)) here's a simple example For a
  43. toggle Procedure:
  44. }
  45. Uses Dos;
  46.  
  47. Procedure ToggleAdapters;
  48. Var Regs            : Registers;
  49.     Active,Inactive : Byte;
  50. begin
  51.   Regs.AH := $1A;
  52.   Regs.AL := $00;
  53.   Intr($10,Regs);
  54.   If Regs.AL=$1A Then           { is Function supported? (is VGA?) }
  55.  begin
  56.    Active   := Regs.BL;                      { exchange both codes }
  57.    Inactive := Regs.BH;
  58.    Regs.AH  := $1A;
  59.    Regs.AL  := $01;
  60.    Regs.BL  := Inactive;
  61.    Regs.BH  := Active;
  62.    Intr($10,Regs);                           { now you can't see me }
  63.  end;
  64. end;
  65.