home *** CD-ROM | disk | FTP | other *** search
- { QWIK41.PAS - Unit for quick, direct screen writing ver 4.1, 05-01-88 }
- { (c)1988 James H. LeMay }
- { For documentation on this file see QWIK41.DOC, QINIT.DOC and CURSOR.DOC. }
-
- {$R-,S-,I-,D-,T-,F-,V-,B-,N-,L+ }
-
- UNIT Qwik;
-
- INTERFACE
- var
- VideoMode: byte absolute $0040:$0049; { Video mode: Mono=7, Color=0-3 }
- VideoPage: byte absolute $0040:$0062; { Video page number }
- EgaRows: byte absolute $0040:$0084; { Rows on screen (0-based) }
- EgaFontSize: word absolute $0040:$0085; { Character cell height (1-based) }
- EgaInfo: byte absolute $0040:$0087; { EGA info. See QINIT.DOC }
- CRTcolumns: word absolute $0040:$004A; { Number of CRT columns (1-based) }
-
- SystemID, { Equipment ID. See QINIT.DOC }
- SubModelID, { Equipment ID. See QINIT.DOC }
- CRTrows, { Global variable of Rows/EgaRows (1-based!)}
- CRTcols: byte; { Global variable of CRTcolumns (1-based) }
- QnextOfs, { Offset available for Q*More procedures }
- CardSeg, { Segment for page 0 for video card }
- Page0seg, { Segment for page 0 for video card/buffer }
- Qseg: word; { Segment for Q writing }
- MaxPage: byte; { Maximum possible page }
- CardSnow, { Wait-for-retrace (snow) for video card }
- Qsnow, { Wait-for-retrace (snow) while Q writing }
- HavePS2, { Using some type of IBM PS/2 equip }
- Have3270: boolean; { Using IBM 3270 PC workstation hard/software }
- EgaSwitches, { EGA card and monitor setup }
- ActiveDispDev, { Active Display Device }
- ActiveDispDev3270, { Active Display Device for IBM 3270 PC }
- AltDispDev: byte; { Alternate Display Device }
- AltDispDevPCC: word; { Alt Display Device for PC Convertible }
- HercModel, { Model of Hercules card. }
- CpuID: byte; { Model number of Intel CPU }
-
- const
- { Constants assigned by IBM: } { Arbitrarily assigned constants: }
- NoDisplay = $00; VgaMono = $07; NoHerc = 0;
- MdaMono = $01; VgaColor = $08; HgcMono = 1;
- CgaColor = $02; DCC9 = $09; HgcPlus = 2;
- DCC3 = $03; DCC10 = $0A; HercInColor = 3;
- EgaColor = $04; McgaMono = $0B;
- EgaMono = $05; McgaColor = $0C;
- PgcColor = $06; Unknown = $FF;
-
- Cpu8086 = $00; Cpu80286 = $02;
- Cpu80186 = $01; Cpu80386 = $03;
-
- { The following are background color constants. With Turbo's constant
- folding, you can do the following example:
- Qwrite (1,1,white+BlueBG,'My string');
- instead of
- Qwrite (1,1,Attr(white,blue),'My string');
- This saves code (it's only one byte!) and is the fastest possible method
- and not to mention it is WYSIWYG. I would recommend using it over the
- old Attr function. You can also deliberately add "blink" without being
- masked. }
- BlackBG = $00; { Only needed for source code clarity. }
- BlueBG = $10;
- GreenBG = $20;
- CyanBG = $30;
- RedBG = $40;
- MagentaBG = $50;
- BrownBG = $60;
- LightGrayBG = $70;
- SameAttr = -1; { This will keep the attributes "as is" on the CRT }
- { Works for all QWIK attribute parameters. }
-
- { The following duplicates the TP4 CRT unit text color constants which }
- { will automatically be used if the CRT unit is not USEd. }
- Black = $00; DarkGray = $08;
- Blue = $01; LightBlue = $09;
- Green = $02; LightGreen = $0A;
- Cyan = $03; LightCyan = $0B;
- Red = $04; LightRed = $0C;
- Magenta = $05; LightMagenta = $0D;
- Brown = $06; Yellow = $0E;
- LightGray = $07; White = $0F;
- Blink = $80;
-
- procedure Qinit;
-
- procedure Qwrite (Row,Col: byte; Attr: integer; aStr: string);
- procedure QwriteC (Row,ColL,ColR: byte; Attr: integer; aStr: string);
- procedure QwriteA (Row,Col: byte; Attr: integer; ArrayLength: word; VAR aStr);
- procedure QwriteMore (Attr: integer; aStr: string);
- procedure QwriteMoreA (Attr: integer; ArrayLength: word; VAR aStr);
-
- procedure Qfill (Row,Col,Rows,Cols: byte; Attr: integer; Ch: char);
- procedure Qattr (Row,Col,Rows,Cols: byte; Attr: integer);
- procedure QfillC (Row,ColL,ColR,Rows,Cols: byte; Attr: integer; Ch: char);
- procedure QattrC (Row,ColL,ColR,Rows,Cols: byte; Attr: integer);
- procedure QfillMore (Rows,Cols: byte; Attr: integer; Ch: char);
- procedure QattrMore (Rows,Cols: byte; Attr: integer);
-
- procedure QstoreToMem (Row,Col,Rows,Cols: byte; VAR Dest);
- procedure QstoreToScr (Row,Col,Rows,Cols: byte; VAR Source);
-
- procedure QviewPage (PageNum: byte);
- procedure QwritePage (PageNum: byte);
-
- procedure GotoRC (Row,Col: byte);
- procedure CursorChange (New: word; VAR Old: word);
- procedure CursorOff;
- procedure CursorOn;
- function WhereR: byte;
- function WhereC: byte;
-
- IMPLEMENTATION
-
- {$L qinit.obj}
- const
- FirstQinit: boolean = true; { True if Qinit is yet to be run }
- procedure Qinit; external;
- {$L qwrites.obj}
- procedure Qwrite; external;
- procedure QwriteC; external;
- procedure QwriteA; external;
- procedure QwriteMore; external;
- procedure QwriteMoreA; external;
- {$L qfills.obj}
- procedure Qfill; external;
- procedure Qattr; external;
- procedure QfillC; external;
- procedure QattrC; external;
- procedure QfillMore; external;
- procedure QattrMore; external;
- {$L qstores.obj}
- procedure QstoreToMem; external;
- procedure QstoreToScr; external;
- {$L qpages.obj}
- procedure QviewPage; external;
- procedure QwritePage; external;
- {$L cursor.obj}
- procedure GotoRC; external;
- procedure CursorChange; external;
- procedure CursorOff; external;
- procedure CursorOn; external;
- function WhereR; external;
- function WhereC; external;
- {$L cpuident.obj}
- procedure GetCpuID; external;
-
- BEGIN
- Qinit;
- GetCpuID; { Optional near procedure only }
- END.