home *** CD-ROM | disk | FTP | other *** search
- { Qinit.inc - initialization for Q screen utilities ver 2.0, 11-24-86 }
- { This initialization routine checks for the type of video card and sets the
- limits for the utilities: address, wait-for-retrace, and number of pages. }
-
- type Str80 = string[80]; { Type for Qwrites.inc }
-
- var
- Vmode: byte absolute $0040:$0049; { Video mode - Mono=7, Color<>7 }
- Page0seg, { Segment for page 0 }
- Qseg: integer; { Segment for Q writing }
- MaxPage: byte; { Maximum possible page }
- CardWait, { Wait for retrace for video card }
- Qwait: boolean; { Wait for retrace while Q writing }
-
- { EGAcheck - check for EGA card ver 1.4, 11-13-86 }
- { This is the reliable method recommended by IBM. }
- Function EGAcheck: Boolean;
- begin
- Inline(
- $B4/$12 { MOV AH,$12 ;Set AH for alt select}
- /$BB/$10/$FF { MOV BX,$FF10 ;Set BX for EGA info}
- /$CD/$10 { INT $10 ;Interrupt}
- /$80/$EF/$FF { SUB BH,$FF ;Check if BH changed}
- /$74/$02 { JZ NoEGA ;BH=false if no EGA}
- /$B7/$01 { MOV BH,$01 ;Set BH=true ($01)}
- /$88/$7E/$04 {NoEGA: MOV [BP+$04],BH ;EGAcheck: $01 or $00}
- );
- end;
-
- { Qinit - initializes Q global variables ver 2.0, 11-24-86 }
- { Written in Turbo so you can change it to fit your needs. }
- procedure Qinit;
- begin
- if Vmode=7 then
- begin
- Page0seg:=$B000; { Segment for Monochrome monitors }
- CardWait:=false;
- MaxPage:=0
- end
- else
- begin
- Page0seg:=$B800; { Segment for Color monitors }
- CardWait:=true;
- if (Vmode=0) or (Vmode=1) then MaxPage:=7 else MaxPage:=3
- end;
- if EGAcheck=true then
- begin
- CardWait:=false;
- MaxPage:=7
- end;
- Qseg:=Page0seg;
- Qwait:=CardWait;
- end;
-