home *** CD-ROM | disk | FTP | other *** search
- (*
- * Programmer:
- * Eric Fogelin
- * June 1, 1987
- *
- * Purpose:
- * Using Microsoft Pascal to program mouse support for the Hercules
- * Monochrome Graphics Card (HGC).
- *
- * Arguments:
- * None
- *
- * Limits:
- * Must link with MOUSE.LIB and INITPAS.OBJ to resolve mouse function
- * calls and HGC display routine references.
- *
- * History:
- * 6/1/87 - Created
- *)
-
- program mouse_hgc;
-
- (* External references to mouse library and HGC screen routines *)
- procedure mouses (vars m1, m2, m3, m4:word);extern;
- procedure GMODE;extern;
- procedure TMODE;extern;
-
- var
- adsbyte: ads of char; (* 32 bit pointer, segment and offset *)
- m1, m2, m3, m4: word; (* Standard mouse parameters *)
- videomode: char; (* Used to save/restore video mode *)
-
- begin
- (* Point to byte which holds Video BIOS mode *)
- adsbyte.s := 16#0000;
- adsbyte.r := 16#0449;
- (* Save current screen mode value *)
- videomode := adsbyte^;
- (* Put HGC into graphics mode using modified Hercules INIT.ASM routine *)
- GMODE;
- (* Put byte value of 6 to direct graphics mouse cursor to HGC page 0 *)
- adsbyte^ := chr(6);
-
- (* Reset mouse driver. HGC 720x348 resolution is recognized *)
- m1 := 0;
- mouses (m1, m2, m3, m4);
-
- (* Turn on default graphics mouse cursor *)
- m1 := 1;
- mouses (m1, m2, m3, m4);
-
- (* Loop until either mouse button pressed *)
- repeat
- m1 := 3;
- mouses (m1, m2, m3, m4);
- until (m2 <> 0);
-
- (* Turn off mouse cursor *)
- m1 := 2;
- mouses (m1, m2, m3, m4);
-
- (* Set HGC back to text mode *)
- TMODE;
- (* Restore state of Video BIOS mode value *)
- adsbyte^ := videomode;
-
- end.
-