home *** CD-ROM | disk | FTP | other *** search
- { =========================================================================== }
- { Cursor10.pas - Restores cursor for any video card. ver 1.0, 02-18-88 }
- { by James H. LeMay, CIS 76011,217 }
- { 6341 Klamath Rd. }
- { Ft. Worth, TX 76116 }
- { 1-817-735-4833 }
- { }
- { This program will let you restore your cursor automatically on whatever }
- { system you have: }
- { }
- { Usage: Cursor << Underline cursor }
- { Cursor [-bh?] << Block cursor or help }
- { Cursor [TopScanLine BottomScanLine] << Custom shape }
- { No parameters makes an underline cursor. }
- { -b makes a block cursor. }
- { Two decimal parameters shape the scan lines. }
- { Anything else just displays the usage. }
- { }
- { For more information on cursor shapes for different video devices, get }
- { QWIK40.ARC. QWIK.TPU is required to compile this program which is also in }
- { QWIK40.ARC. CURSOR10.EXE was compiled with a modified version of }
- { QWIK40.TPU. This source code is public domain, but QWIK is shareware. }
- { QWIK is initialized in the unit and detects your video system including: }
- { }
- { IBM PC, XT, AT, PCjr, PC convertible, all PS/2 models, 3270 PC. }
- { MDA, CGA, EGA, MCGA, VGA, 8214/A, all Hercules. }
- { And all compatibles. }
- { Operating in all text modes, column modes, and row modes. }
- { }
- { QWIK turns on the cursor emulation mode for the VGA. }
- { }
- { EXAMPLES: }
- { cursor -b << Restores block cursor }
- { cursor -h << Displays help }
- { cursor 0 13 << Makes a block-type cursor (MDA) }
- { =========================================================================== }
-
- program RestoreCursor;
-
- {$M 3000, 0, 0}
- {$R-,S-,I-,D-,T-,F-,V-,B-,N-,L+ }
-
- uses Crt,Qwik; { QWIK.TPU is found in QWIK40.ARC or a later version. }
-
- var
- CursorMode, { High byte is top scan line; low byte is bottom. }
- OldCursor: word;
- ParameterError: boolean;
-
- procedure GetBlockCursor;
- begin
- if (pos('b',ParamStr(1))>0) or (pos('B',ParamStr(1))>0) then
- case ActiveDispDev of
- MdaMono: CursorMode:=$000D;
- CgaColor,McgaMono..McgaColor: CursorMode:=$0007;
- EgaColor..VgaColor: CursorMode:=pred(EgaFontSize);
- end
- else ParameterError:=true; { Show command usage. }
- end;
-
- procedure GetCustomCursor;
- var
- Error1,Error2: integer;
- TopScanLine,BottomScanLine: byte;
- begin
- val (ParamStr(1),TopScanLine ,Error1);
- val (ParamStr(2),BottomScanLine,Error2);
- if Error1+Error2=0 then
- CursorMode:=TopScanLine shl 8 + BottomScanLine
- else ParameterError:=true; { Show command usage. }
- end;
-
- procedure GetUnderlineCursor;
- var BottomScanLine: byte;
- begin
- case ActiveDispDev of
- MdaMono: CursorMode:=$0B0C;
- CgaColor,McgaMono..McgaColor: CursorMode:=$0607;
- EgaColor..VgaColor:
- begin
- BottomScanLine:=EgaFontSize-2;
- CursorMode:=(pred(BottomScanLine) shl 8) + BottomScanLine;
- end;
- end;
- end;
-
- begin
- ParameterError:=false;
- case ParamCount of
- 1: GetBlockCursor;
- 2: GetCustomCursor;
- else GetUnderlineCursor;
- end;
- if ParameterError then
- begin
- CheckSnow:=Qsnow;
- writeln ('CURSOR 1.0 (c) 1988 James H. LeMay');
- writeln ('Restores default cursor on any system.');
- writeln ('Usage: Cursor');
- writeln (' Cursor [-bh?]');
- writeln (' Cursor [TopScanLine BottomScanLine]');
- writeln ('No parameters makes an underline cursor.');
- writeln ('-b makes a block cursor.');
- writeln ('Two decimal parameters shape the scan lines.');
- end
- else CursorChange (CursorMode,OldCursor);
- end.