--- ray/src/rt/msmouse.c 1992/10/09 15:24:02 2.2 +++ ray/src/rt/msmouse.c 2003/02/22 02:07:28 2.6 @@ -1,13 +1,12 @@ -/* Copyright (c) 1992 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: msmouse.c,v 2.6 2003/02/22 02:07:28 greg Exp $"; #endif - #include #include #include "driver.h" +#define NULL 0 + #define M_RIGHTBUTT 0x8 #define M_LEFTBUTT 0x2 #define M_MOTION 0x1 @@ -27,7 +26,7 @@ static void _loadds far mouse_handler (int max, int mc #pragma aux mouse_handler parm [EAX] [ECX] [EDX] mouse_event = max; mouse_xpos = mcx; - mouse_ypos = mdx * (long)ydispsize / 200; /* kludge */ + mouse_ypos = mdx; } #pragma on (check_stack) @@ -153,6 +152,17 @@ struct driver *dp; ydispsize = dp->ysiz; crad = dp->ysiz/40; + /* set screen limits */ + + inregs.w.ax = 0x7; /* horizontal resolution */ + inregs.w.cx = 0; + inregs.w.dx = xdispsize-1; + int386x( 0x33, &inregs, &outregs, &sregs ); + inregs.w.ax = 0x8; /* vertical resolution */ + inregs.w.cx = 0; + inregs.w.dx = ydispsize-1; + int386x( 0x33, &inregs, &outregs, &sregs ); + /* install watcher */ inregs.w.ax = 0xC; @@ -164,3 +174,21 @@ struct driver *dp; dp->getcur = ms_getcur; } + +void +ms_gcdone( dp ) +struct driver *dp; +{ + union REGS inregs, outregs; + + if (dp->getcur != ms_getcur) + return; /* not installed */ + + dp->getcur = NULL; + + /* uninstall watcher */ + + inregs.w.ax = 0; + int386 (0x33, &inregs, &outregs); +} +