home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
On Disk Monthly 62
/
odm62.zip
/
GDSOURCE.EXE
/
PASQWIK.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-10-14
|
20KB
|
778 lines
unit pasqwik;
{$R-,S-,L-,D-,I-,V-}
interface
USES dos;
TYPE ScreenCharAttr = RECORD
Ch: char;
At: byte;
END;
ScreenMap = array [1..2000] of ScreenCharAttr;
GetArrayType = RECORD
C,
R: byte;
CA: array [0..1999] of ScreenCharAttr;
END;
TYPE ByteArray = array [0..4000] of byte;
ByteBufferPtr = ^ByteArray;
TYPE BoxArray = array [1..9] of char;
GridArray = array [1..16] of char;
AdapterType = (MDA, CGA, MCGA, EGA, VGA);
CONST SameAttr = $55;
CONST SingleGrid : GridArray = ('┌', '─', '┬', '┐',
'│', '.', '│', '│',
'├', '─', '┼', '┤',
'└', '─', '┴', '┘');
CONST DoubleGrid : GridArray = ('╔', '═', '╦', '╗',
'║', ' ', '║', '║',
'╠', '═', '╬', '╣',
'╚', '═', '╩', '╝');
CONST SingleBox : BoxArray = ('┌', '─', '┐',
'│', ' ', '│',
'└', '─', '┘');
CONST DoubleBox : BoxArray = ('╔', '═', '╗',
'║', ' ', '║',
'╚', '═', '╝');
CONST SingleSide: BoxArray = ('╒', '═', '╕',
'│', ' ', '│',
'╘', '═', '╛');
CONST DoubleSide: BoxArray = ('╓', '─', '╖',
'║', ' ', '║',
'╙', '─', '╜');
CONST MarieBox : BoxArray = ('▄', '▄', '▄',
'█', ' ', '█',
'▀', '▀', '▀');
CONST GeorgeBox : BoxArray = ('▐', '▀', '▌',
'▐', ' ', '▌',
'▐', '▄', '▌');
CONST Button : BoxArray = ('┌', '─', '╖',
'│', ' ', '║',
'╘', '═', '╝');
CONST HappyBox : BoxArray = ('', '', '',
'', ' ', '',
'', '', '');
CONST EmptyBox : boxarray = (' ', ' ', ' ',
' ', ' ', ' ',
' ', ' ', ' ');
CONST ShadowBox : boxarray = (' ', ' ', '▄',
' ', ' ', '█',
' ', '▀', '▀');
VAR ScrOfs, { Screen Segment for writing }
ScrSeg : word; { Screen Offset for writing}
Screen : ^ScreenCharAttr absolute ScrOfs;
PagOfs : word;
CRTrows,
CRTcolumns : byte; { Number of Screen rows and columns}
VideoAdapter : AdapterType;
StartCursor : word;
(** use SameAttr to not rewrite the existing string attributes. **)
PROCEDURE SetCursor(Top, Bottom: byte);
FUNCTION GetCursor: word;
PROCEDURE GotoRC(Row, Col: byte);
PROCEDURE Qwrite(Row, Col, Attr: byte; St: string);
PROCEDURE QwriteS(Row, Col: byte; St: string);
PROCEDURE QwriteC(Row, ColL, ColR, Attr: byte; St: string);
PROCEDURE QwriteA(Attr: byte; St: string);
PROCEDURE QwriteL(Row, Col, Attr: byte; St: string; Start, Lengt: byte);
PROCEDURE QwriteV(Row, Col, Attr: byte; St: string);
PROCEDURE QwriteU(Row, Col, Attr: byte; St: string);
PROCEDURE Qfill(Row, Col, Rows, Cols, Attr: byte; Ch: char);
PROCEDURE QAttr(Row, Col, Rows, Cols, Attr: byte);
PROCEDURE QXorAttr(Row, Col, Rows, Cols, Attr: byte);
FUNCTION GetAttr(Row, Col: byte): byte;
PROCEDURE SetAttr(Row, Col, Attr: byte);
FUNCTION GetChar(Row, Col: byte): char;
PROCEDURE SetChar(Row, Col: byte; Ch: char);
PROCEDURE XorAttr(Row, Col, Attr: byte);
FUNCTION TextImageSize(Rows, Cols: byte): integer;
PROCEDURE TextGet(Row, Col, Rows, Cols: byte; VAR Arr);
PROCEDURE TextPut(Row, Col: byte; VAR Arr);
PROCEDURE TextSwap(Row, Col: byte; VAR Arr);
PROCEDURE Textrestore(Row, Col, Rows, Cols: byte; VAR Arr);
PROCEDURE Qbox(Row, Col, Rows, Cols, WindowAttr, BorderAttr: byte;
VAR BxArry: BoxArray);
PROCEDURE Qgrid(Row, Col: byte; VAR ZR; VAR ZC;
WindowAttr, BorderAttr: byte; VAR GdArry: GridArray);
FUNCTION GridSize(Arr: ByteArray): integer;
PROCEDURE ShadowedBox(Row, Col, Rows, Cols, WindowAttr, BorderAttr: byte;
VAR Box: BoxArray; ShadowAmount: byte);
PROCEDURE BoxMessage(Row, Col, Attr: byte; St: string; VAR Box: BoxArray);
PROCEDURE HalfShadowBox(Row, Col, Rows, Cols, BxAttr, Shdwattr: byte;
VAR Box: BoxArray);
PROCEDURE SetPage(NewPage: byte);
FUNCTION EGAcheck: BOOLEAN;
FUNCTION VGAcheck: BOOLEAN;
FUNCTION MCGAcheck: BOOLEAN;
implementation
VAR NextRow,
R,
C,
RW,
CW : integer;
CABorder,
CAWindow : ScreenCharAttr;
PageSize : word;
Page : byte;
PROCEDURE SetCursor(Top, Bottom: byte);
VAR Regs : Registers;
BEGIN
WITH Regs DO
BEGIN
AH := 1;
BH := 0;
CH := Top;
CL := Bottom;
END;
Intr($10, Regs);
END;
FUNCTION GetCursor: word;
VAR Regs : Registers;
BEGIN
WITH Regs DO
BEGIN
AH := 3;
BH := 0;
END;
Intr($10, Regs);
GetCursor := Regs.CX
END;
PROCEDURE GotoRC(Row, Col: byte);
VAR Regs : Registers;
BEGIN
WITH Regs DO
BEGIN
AH := 2;
BH := 0;
DH := Row;
DL := Col;
Dec(DX, $101);
END;
Intr($10, Regs);
END;
PROCEDURE Qwrite(Row, Col, Attr: byte; St: string);
BEGIN
ScrOfs := PagOfs + ((Pred(Row) * CRTcolumns) + Pred(Col)) SHL 1;
IF Attr <> SameAttr THEN
BEGIN
CAWindow.At := Attr;
FOR C := 1 TO Length(St) DO
BEGIN
CAWindow.Ch := St[C];
Screen^ := CAWindow;
Inc(word(Screen), 2);
END;
END
ELSE
BEGIN
FOR C := 1 TO Length(St) DO
BEGIN
Screen^.Ch := St[C];
Inc(word(Screen), 2);
END;
END;
CW := Col + Length(St);
RW := Row;
END;
PROCEDURE QwriteS(Row, Col: byte; St: string);
BEGIN
ScrOfs := PagOfs + ((Pred(Row) * CRTcolumns) + Pred(Col)) SHL 1;
FOR C := 1 TO Length(St) DO
BEGIN
Screen^.Ch := St[C];
Inc(word(Screen), 2);
END;
CW := Col + Length(St);
RW := Row;
END;
PROCEDURE QwriteC(Row, ColL, ColR, Attr: byte; St: string);
VAR Col: integer;
BEGIN
ScrOfs := PagOfs + (Pred(Row) * CRTcolumns) SHL 1 + (ColL + ColR - Length(St)) and $FFFE;
IF Attr <> SameAttr THEN
BEGIN
CAWindow.At := Attr;
FOR C := 1 TO Length(St) DO
BEGIN
CAWindow.Ch := St[C];
Screen^ := CAWindow;
Inc(word(Screen), 2);
END;
END
ELSE
BEGIN
FOR C := 1 TO Length(St) DO
BEGIN
Screen^.Ch := St[C];
Inc(word(Screen), 2);
END;
END;
CW := Col + Length(St);
RW := Row;
END;
PROCEDURE QwriteA(Attr: byte; St: string);
VAR Csave: integer;
BEGIN
ScrOfs := PagOfs + ((Pred(RW) * CRTcolumns) + Pred(CW)) SHL 1;
Csave := CW;
IF Attr <> SameAttr THEN
BEGIN
CAWindow.At := Attr;
FOR C := 1 TO Length(St) DO
BEGIN
CAWindow.Ch := St[C];
Screen^ := CAWindow;
Inc(word(Screen), 2);
END;
END
ELSE
BEGIN
FOR C := 1 TO Length(St) DO
BEGIN
Screen^.Ch := St[C];
Inc(word(Screen), 2);
END;
END;
CW := CW + length(st);
END;
PROCEDURE QwriteL(Row, Col, Attr: byte; St: string; Start, Lengt: byte);
BEGIN
ScrOfs := PagOfs + ((Pred(Row) * CRTcolumns) + Pred(Col)) SHL 1;
IF Attr <> SameAttr THEN
BEGIN
CAWindow.At := Attr;
FOR C := Start TO Pred(Start + Lengt) DO
BEGIN
CAWindow.Ch := St[C];
Screen^ := CAWindow;
Inc(word(Screen), 2);
END;
END
ELSE
BEGIN
FOR C := Start TO Pred(Start + Lengt) DO
BEGIN
Screen^.Ch := St[C];
Inc(word(Screen), 2);
END;
END;
CW := Succ(Col) + Lengt;
RW := Row;
END;
PROCEDURE QwriteV(Row, Col, Attr: byte; St: string);
BEGIN
ScrOfs := PagOfs + ((Pred(Row) * CRTcolumns) + Pred(Col)) SHL 1;
NextRow := CRTcolumns SHL 1;
IF Attr <> SameAttr THEN
BEGIN
CAWindow.At := Attr;
FOR C := 1 TO Length(St) DO
BEGIN
CAWindow.Ch := St[C];
Screen^ := CAWindow;
Inc(word(Screen), NextRow);
END;
END
ELSE
BEGIN
FOR C := 1 TO Length(St) DO
BEGIN
Screen^.Ch := St[C];
Inc(word(Screen), NextRow);
END;
END;
CW := Col + Length(St);
RW := Row;
END;
PROCEDURE QwriteU(Row, Col, Attr: byte; St: string);
BEGIN
ScrOfs := PagOfs + ((Pred(Row) * CRTcolumns) + Pred(Col)) SHL 1;
NextRow := CRTcolumns SHL 1;
IF Attr <> SameAttr THEN
BEGIN
CAWindow.At := Attr;
FOR C := 1 TO Length(St) DO
BEGIN
CAWindow.Ch := St[C];
Screen^ := CAWindow;
Dec(word(Screen), NextRow);
END;
END
ELSE
BEGIN
FOR C := 1 TO Length(St) DO
BEGIN
Screen^.Ch := St[C];
Dec(word(Screen), NextRow);
END;
END;
CW := Col + Length(St);
RW := Row;
END;
PROCEDURE Qfill(Row, Col, Rows, Cols, Attr: byte; Ch: char);
BEGIN
ScrOfs := PagOfs + ((Pred(Row) * CRTcolumns) + Pred(Col)) SHL 1;
CAWindow.Ch := Ch;
CAWindow.At := Attr;
NextRow := (CRTcolumns - Cols) SHL 1;
IF Attr <> SameAttr THEN
BEGIN
FOR R := 1 TO Rows DO
BEGIN
FOR C := 1 TO Cols DO
BEGIN
Screen^ := CAWindow;
Inc(word(Screen), 2);
END;
Inc(word(Screen), NextRow);
END;
END
ELSE
FOR R := 1 TO Rows DO
BEGIN
FOR C := 1 TO Cols DO
BEGIN
Screen^.Ch := Ch;
Inc(word(Screen), 2);
END;
Inc(word(Screen), NextRow);
END;
END;
PROCEDURE QAttr(Row, Col, Rows, Cols, Attr: byte);
BEGIN
ScrOfs := PagOfs + ((Pred(Row) * CRTcolumns) + Pred(Col)) SHL 1;
NextRow := (CRTcolumns - Cols) SHL 1;
FOR R := 1 TO Rows DO
BEGIN
FOR C := 1 TO Cols DO
BEGIN
Screen^.At := Attr;
Inc(word(Screen), 2);
END;
Inc(word(Screen), NextRow);
END;
END;
PROCEDURE QXorAttr(Row, Col, Rows, Cols, Attr: byte);
BEGIN
ScrOfs := PagOfs + ((Pred(Row) * CRTcolumns) + Pred(Col)) SHL 1;
NextRow := (CRTcolumns - Cols) SHL 1;
FOR R := 1 TO Rows DO
BEGIN
FOR C := 1 TO Cols DO
BEGIN
Screen^.At := Screen^.At XOR Attr;
Inc(word(Screen), 2);
END;
Inc(word(Screen), NextRow);
END;
END;
FUNCTION GetAttr(Row, Col: byte): byte;
BEGIN
ScrOfs := PagOfs + ((Pred(Row) * CRTcolumns) + Pred(Col)) SHL 1;
GetAttr := Screen^.At;
END;
PROCEDURE SetAttr(Row, Col, Attr: byte);
BEGIN
ScrOfs := PagOfs + ((Pred(Row) * CRTcolumns) + Pred(Col)) SHL 1;
Screen^.At := Attr;
END;
FUNCTION GetChar(Row, Col: byte): char;
BEGIN
ScrOfs := PagOfs + ((Pred(Row) * CRTcolumns) + Pred(Col)) SHL 1;
GetChar := Screen^.Ch;
END;
PROCEDURE SetChar(Row, Col: byte; Ch: char);
BEGIN
ScrOfs := PagOfs + ((Pred(Row) * CRTcolumns) + Pred(Col)) SHL 1;
Screen^.Ch := Ch;
END;
PROCEDURE XorAttr(Row, Col, Attr: byte);
BEGIN
ScrOfs := PagOfs + ((Pred(Row) * CRTcolumns) + Pred(Col)) SHL 1;
Screen^.At := Screen^.At XOR Attr;
END;
FUNCTION TextImageSize(Rows, Cols: byte): integer;
BEGIN
TextImageSize := Succ(Rows * Cols) SHL 1;
END;
PROCEDURE TextGet(Row, Col, Rows, Cols: byte; VAR Arr);
VAR MemoryBuffer : GetArrayType absolute Arr;
Position : word;
BytesToMove : word;
BEGIN
ScrOfs := PagOfs + ((Pred(Row) * CRTcolumns) + Pred(Col)) SHL 1;
NextRow := CRTcolumns SHL 1;
BytesToMove := Cols SHL 1;
MemoryBuffer.C := Cols;
MemoryBuffer.R := Rows;
Position := 0;
FOR R := 1 TO Rows DO
BEGIN
Move(Screen^, MemoryBuffer.CA[Position], BytesToMove);
Inc(word(Screen), NextRow);
Inc(Position, Cols);
END;
END;
PROCEDURE TextPut(Row, Col: byte; VAR Arr);
VAR MemoryBuffer : GetArrayType absolute Arr;
Position : word;
BytesToMove : word;
BEGIN
ScrOfs := PagOfs + ((Pred(Row) * CRTcolumns) + Pred(Col)) SHL 1;
NextRow := CRTcolumns SHL 1;
BytesToMove := MemoryBuffer.C SHL 1;
Position := 0;
FOR R := 1 TO MemoryBuffer.R DO
BEGIN
Move(MemoryBuffer.CA[Position], Screen^, BytesToMove);
Inc(word(Screen), NextRow);
Inc(Position, MemoryBuffer.C);
END;
END;
PROCEDURE TextSwap(Row, Col: byte; VAR Arr);
VAR LineBuff : array [1..80] of ScreenCharAttr;
MemoryBuffer : GetArrayType absolute Arr;
Position : word;
BytesToMove : word;
BEGIN
ScrOfs := PagOfs + ((Pred(Row) * CRTcolumns) + Pred(Col)) SHL 1;
NextRow := CRTcolumns SHL 1;
BytesToMove := MemoryBuffer.C SHL 1;
Position := 0;
FOR R := 1 TO MemoryBuffer.R DO
BEGIN
Move(Screen^, LineBuff, BytesToMove);
Move(MemoryBuffer.CA[Position], Screen^, BytesToMove);
Move(LineBuff, MemoryBuffer.CA[Position], BytesToMove);
Inc(word(Screen), NextRow);
Inc(Position, MemoryBuffer.C);
END;
END;
PROCEDURE Textrestore(Row, Col, Rows, Cols: byte; VAR Arr);
VAR MemoryBuffer : GetArrayType absolute Arr;
Position : word;
BytesToMove : word;
BEGIN
ScrOfs := PagOfs + ((Pred(Row) * CRTcolumns) + Pred(Col)) SHL 1;
NextRow := CRTcolumns SHL 1;
BytesToMove := Cols SHL 1;
Position := (Pred(Row) * MemoryBuffer.C + Pred(Col));
FOR R := 1 TO Rows DO
BEGIN
Move(MemoryBuffer.CA[Position], Screen^, BytesToMove);
Inc(word(Screen), NextRow);
Inc(Position, MemoryBuffer.C);
END;
END;
PROCEDURE Qbox(Row, Col, Rows, Cols, WindowAttr, BorderAttr: byte;
VAR BxArry: BoxArray);
VAR Rowm2,
Colm2: integer;
BEGIN
ScrOfs := PagOfs + ((Pred(Row) * CRTcolumns) + Pred(Col)) SHL 1;
NextRow := Succ(CRTcolumns - Cols) SHL 1;
Rowm2 := Rows - 2;
Colm2 := Cols - 2;
CABorder.At := BorderAttr;
CABorder.Ch := BxArry[1];
CAWindow.At := WindowAttr;
CAWindow.Ch := BxArry[5];
Screen^ := CABorder;
Inc(word(Screen), 2);
CABorder.Ch := BxArry[2];
FOR C := 1 TO Colm2 DO
BEGIN
Screen^ := CABorder;
Inc(word(Screen), 2);
END;
CABorder.Ch := BxArry[3];
Screen^ := CABorder;
Inc(word(Screen), NextRow);
IF WindowAttr <> SameAttr THEN
BEGIN
FOR R := 1 TO Rowm2 DO
BEGIN
CABorder.Ch := BxArry[4];
Screen^ := CABorder;
Inc(word(Screen), 2);
FOR C := 1 TO Colm2 DO
BEGIN
Screen^ := CAWindow;
Inc(word(Screen), 2);
END;
CABorder.Ch := BxArry[6];
Screen^ := CABorder;
Inc(word(Screen), NextRow);
END;
END
ELSE
BEGIN
FOR R := 1 TO Rowm2 DO
BEGIN
CABorder.Ch := BxArry[4];
Screen^ := CABorder;
Inc(word(Screen), Succ(Colm2) SHL 1);
CABorder.Ch := BxArry[6];
Screen^ := CABorder;
Inc(word(Screen), NextRow);
END;
END;
CABorder.Ch := BxArry[7];
R := Row + Rows - 1;
Screen^ := CABorder;
Inc(word(Screen), 2);
CABorder.Ch := BxArry[8];
FOR C := 1 TO Colm2 DO
BEGIN
Screen^ := CABorder;
Inc(word(Screen), 2);
END;
CABorder.Ch := BxArry[9];
Screen^ := CABorder;
END;
FUNCTION GridSize(Arr: ByteArray): integer;
VAR I: integer;
Result: word;
BEGIN
I := 0;
Result := 1;
WHILE Arr[I] <> 255 DO
BEGIN
Inc(Result);
Inc(Result, Arr[I]);
Inc(I);
END;
GridSize := Result;
END;
PROCEDURE Qgrid(Row, Col: byte; VAR ZR; VAR ZC;
WindowAttr, BorderAttr: byte; VAR GdArry: GridArray);
VAR Rows: bytearray absolute ZR;
Cols: bytearray absolute ZC;
CI,
RI,
AI: integer;
PROCEDURE DoOneRow;
BEGIN
CABorder.Ch := GdArry[AI];
Screen^ := CABorder;
Inc(word(Screen), 2);
Inc(AI);
CAWindow.Ch := GdArry[AI];
FOR C := 1 TO Cols[0] DO
BEGIN
Screen^ := CAWindow;
Inc(word(Screen), 2);
END;
CI := 1;
Inc(AI);
CABorder.Ch := GdArry[AI];
WHILE Cols[CI] <> 255 DO
BEGIN
Screen^ := CABorder;
Inc(word(Screen), 2);
FOR C := 1 TO Cols[CI] DO
BEGIN
Screen^ := CAWindow;
Inc(word(Screen), 2);
END;
Inc(CI);
END;
Inc(AI);
CABorder.Ch := GDArry[AI];
Screen^ := CABorder;
Inc(word(Screen), NextRow);
Dec(AI, 3);
END;
BEGIN
ScrOfs := PagOfs + ((Pred(Row) * CRTcolumns) + Pred(Col)) SHL 1;
NextRow := Succ(CRTcolumns - GridSize(Cols)) SHL 1;
CABorder.At := BorderAttr;
CAWindow.At := BorderAttr;
AI := 1;
DoOneRow;
FOR R := 1 TO Rows[0] DO
BEGIN
AI := 5;
CAWindow.At := WindowAttr;
DoOneRow;
END;
RI := 1;
WHILE rows[RI] <> 255 DO
BEGIN
AI := 9;
CAWindow.At := BorderAttr;
DoOneRow;
AI := 5;
CAWindow.At := WindowAttr;
FOR R := 1 TO rows[RI] DO
DoOneRow;
Inc(RI);
END;
AI := 13;
CAWindow.At := BorderAttr;
DoOneRow;
END;
PROCEDURE ShadowedBox(Row, Col, Rows, Cols, WindowAttr, BorderAttr: byte;
VAR Box: BoxArray; ShadowAmount: byte);
BEGIN
QBox(Row, Col, Rows, Cols, Windowattr, Borderattr, Box);
QAttr(Row + 1, Col + Cols, Rows, ShadowAmount, $08);
QAttr(Row + Rows, Col + ShadowAmount, 1, Cols, $08);
END;
PROCEDURE BoxMessage(Row, Col, Attr: byte; St: string; VAR Box: BoxArray);
BEGIN
QBox(Row, Col, 3, length(St) + 4, attr, attr, box);
QwriteS(Row + 1, Col + 2, St);
END;
PROCEDURE HalfShadowBox(Row, Col, Rows, Cols, BxAttr, Shdwattr: byte;
VAR Box: BoxArray);
BEGIN
Qbox(Row, Col, Succ(Rows), Succ(Cols), Shdwattr, Shdwattr, ShadowBox);
Qbox(Row, Col, Rows, Cols, BxAttr, BxAttr, box);
END;
PROCEDURE SetPage(NewPage: byte);
VAR Regs : Registers;
BEGIN
Page := NewPage;
ScrOfs := word(Page * PageSize);
WITH Regs DO
BEGIN
AH := 5;
AL := NewPage;
END;
Intr($10, Regs);
END;
FUNCTION EGAcheck: BOOLEAN;
VAR Regs : Registers;
BEGIN
WITH Regs DO
BEGIN
AH := $12;
BX := $FF10;
Intr($10, Regs);
EGAcheck := (BH <> $FF);
END;
END;
FUNCTION VGAcheck: BOOLEAN;
VAR Regs : Registers;
BEGIN
WITH Regs DO
BEGIN
AX := $1A00;
Intr($10, Regs);
VGAcheck := (AL = $1A);
END;
END;
FUNCTION MCGAcheck: BOOLEAN;
VAR Regs : Registers;
BEGIN
WITH Regs DO
BEGIN
AX := $1A00;
Intr($10, Regs);
MCGAcheck := (AL = $1A) and ((BH >= $B) and (BH <= $C));
END;
END;
VAR VidMode : byte absolute $0040:$0049; { Video mode - Mono=7, Color<>7 }
PROCEDURE QwikInit;
BEGIN
StartCursor := GetCursor;
CRTcolumns := Mem[0:$44A];
CRTrows := Succ(Mem[0:$484]);
PageSize := MemW[0:$44C];
Page := 0;
IF CRTrows = 1 THEN CRTrows := 25;
ScrOfs := 0;
PagOfs := 0;
IF VidMode = 7 THEN
BEGIN
ScrSeg := $B000; { Segment FOR Monochrome monitors }
VideoAdapter := MDA;
Exit;
END;
{ *****************************************************************
* Assume CGA at this point since we know it ain't no MDA.
***************************************************************** }
ScrSeg := $B800;
VideoAdapter := CGA;
IF EGAcheck THEN
BEGIN
IF VGAcheck THEN
IF MCGAcheck THEN
VideoAdapter := MCGA
ELSE
VideoAdapter := VGA
ELSE
VideoAdapter := EGA;
END;
END;
BEGIN { *** UNIT *** }
RW := 1;
CW := 1;
QwikInit;
END.