home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / MOUSE / MSMOUSE1.ZIP / PAS.ZIP / MOUSHGCP.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-02-10  |  2.0 KB  |  85 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. *   Make file:
  18. *
  19. *       moushgcp.obj: moushgcp.pas
  20. *           pas1 moushgcp;
  21. *           pas2;
  22. *
  23. *       initpas.obj: initpas.asm
  24. *           masm initpas.asm;
  25. *
  26. *       moushgcp.exe: moushgcp.obj initpas.obj
  27. *           link moushgcp+initpas,,,mouse.lib;
  28. *
  29. *   History:
  30. *       6/1/87 - Created
  31. *)
  32.  
  33. program mouse_hgc;
  34.  
  35. (* External references to mouse library and HGC screen routines *)
  36. procedure mousel (vars m1, m2, m3, m4:word);extern;
  37. procedure GMODE;extern;
  38. procedure TMODE;extern;
  39.  
  40. var
  41.     adsbyte: ads of char;   (* 32 bit pointer, segment and offset *)
  42.     m1, m2, m3, m4: word;   (* Standard mouse parameters *)
  43.     videomode: char;        (* Used to save/restore video mode *)
  44.  
  45. begin
  46.  
  47.     (* Point to byte which holds Video BIOS mode *)
  48.     adsbyte.s := 16#0000;
  49.     adsbyte.r := 16#0449;
  50.  
  51.     (* Save current screen mode value *)
  52.     videomode := adsbyte^;
  53.  
  54.     (* Put HGC into graphics mode using modified Hercules INIT.ASM routine *)
  55.     GMODE;
  56.  
  57.     (* Put byte value of 6 to direct graphics mouse cursor to HGC page 0 *)
  58.     adsbyte^ := chr(6);
  59.  
  60.     (* Reset mouse driver.  HGC 720 x 348 resolution is recognized *)
  61.     m1 := 0;
  62.     mousel (m1, m2, m3, m4);
  63.  
  64.     (* Turn on default graphics mouse cursor *)
  65.     m1 := 1;
  66.     mousel (m1, m2, m3, m4);
  67.  
  68.     (* Loop until either mouse button pressed *)
  69.     repeat
  70.       m1 := 3;
  71.       mousel (m1, m2, m3, m4);
  72.     until (m2 <> 0);
  73.  
  74.     (* Reset mouse driver *)
  75.     m1 := 0;
  76.     mousel (m1, m2, m3, m4);
  77.  
  78.     (* Set HGC back to text mode *)
  79.     TMODE;
  80.  
  81.     (* Restore state of Video BIOS mode value *)
  82.     adsbyte^ := videomode;
  83.  
  84. end.
  85.