home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / MOUSE / MSMOUSE1.ZIP / HGC.ZIP / PASCAL.ZIP / MOUSEHGC.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1989-02-10  |  1.6 KB  |  68 lines

  1. (*
  2. *   Programmer: 
  3. *    Eric Fogelin
  4. *       June 1, 1987
  5. *
  6. *   Purpose:
  7. *       Using Microsoft Pascal to program mouse support for the Hercules
  8. *       Monochrome Graphics Card (HGC).
  9. *
  10. *   Arguments:
  11. *    None
  12. *
  13. *   Limits:
  14. *    Must link with MOUSE.LIB and INITPAS.OBJ to resolve mouse function
  15. *       calls and HGC display routine references.
  16. *
  17. *   History:
  18. *       6/1/87 - Created
  19. *)
  20.  
  21. program mouse_hgc;
  22.  
  23. (* External references to mouse library and HGC screen routines *)
  24. procedure mouses (vars m1, m2, m3, m4:word);extern;
  25. procedure GMODE;extern;
  26. procedure TMODE;extern;
  27.  
  28. var
  29.   adsbyte: ads of char;   (* 32 bit pointer, segment and offset *)
  30.   m1, m2, m3, m4: word;   (* Standard mouse parameters *)
  31.   videomode: char;        (* Used to save/restore video mode *)
  32.  
  33. begin
  34.   (* Point to byte which holds Video BIOS mode *)
  35.   adsbyte.s := 16#0000;
  36.   adsbyte.r := 16#0449;
  37.   (* Save current screen mode value *)
  38.   videomode := adsbyte^;
  39.   (* Put HGC into graphics mode using modified Hercules INIT.ASM routine *)
  40.   GMODE;  
  41.   (* Put byte value of 6 to direct graphics mouse cursor to HGC page 0 *)
  42.   adsbyte^ := chr(6);
  43.  
  44.   (* Reset mouse driver.  HGC 720x348 resolution is recognized *)
  45.   m1 := 0;
  46.   mouses (m1, m2, m3, m4);
  47.  
  48.   (* Turn on default graphics mouse cursor *)
  49.   m1 := 1;
  50.   mouses (m1, m2, m3, m4);
  51.  
  52.   (* Loop until either mouse button pressed *)
  53.   repeat
  54.     m1 := 3;
  55.     mouses (m1, m2, m3, m4);
  56.   until (m2 <> 0);
  57.  
  58.   (* Turn off mouse cursor *)
  59.   m1 := 2;
  60.   mouses (m1, m2, m3, m4);
  61.  
  62.   (* Set HGC back to text mode *)
  63.   TMODE;
  64.   (* Restore state of Video BIOS mode value *)
  65.   adsbyte^ := videomode;
  66.  
  67. end.
  68.