1 |
– |
/* Copyright (c) 1992 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
#include <i86.h> |
5 |
|
#include <graph.h> |
6 |
|
#include "driver.h" |
7 |
|
|
8 |
+ |
#define NULL 0 |
9 |
+ |
|
10 |
|
#define M_RIGHTBUTT 0x8 |
11 |
|
#define M_LEFTBUTT 0x2 |
12 |
|
#define M_MOTION 0x1 |
26 |
|
#pragma aux mouse_handler parm [EAX] [ECX] [EDX] |
27 |
|
mouse_event = max; |
28 |
|
mouse_xpos = mcx; |
29 |
< |
mouse_ypos = mdx * (long)ydispsize / 200; /* kludge */ |
29 |
> |
mouse_ypos = mdx; |
30 |
|
} |
31 |
|
#pragma on (check_stack) |
32 |
|
|
152 |
|
ydispsize = dp->ysiz; |
153 |
|
crad = dp->ysiz/40; |
154 |
|
|
155 |
+ |
/* set screen limits */ |
156 |
+ |
|
157 |
+ |
inregs.w.ax = 0x7; /* horizontal resolution */ |
158 |
+ |
inregs.w.cx = 0; |
159 |
+ |
inregs.w.dx = xdispsize-1; |
160 |
+ |
int386x( 0x33, &inregs, &outregs, &sregs ); |
161 |
+ |
inregs.w.ax = 0x8; /* vertical resolution */ |
162 |
+ |
inregs.w.cx = 0; |
163 |
+ |
inregs.w.dx = ydispsize-1; |
164 |
+ |
int386x( 0x33, &inregs, &outregs, &sregs ); |
165 |
+ |
|
166 |
|
/* install watcher */ |
167 |
|
|
168 |
|
inregs.w.ax = 0xC; |
174 |
|
|
175 |
|
dp->getcur = ms_getcur; |
176 |
|
} |
177 |
+ |
|
178 |
+ |
void |
179 |
+ |
ms_gcdone( dp ) |
180 |
+ |
struct driver *dp; |
181 |
+ |
{ |
182 |
+ |
union REGS inregs, outregs; |
183 |
+ |
|
184 |
+ |
if (dp->getcur != ms_getcur) |
185 |
+ |
return; /* not installed */ |
186 |
+ |
|
187 |
+ |
dp->getcur = NULL; |
188 |
+ |
|
189 |
+ |
/* uninstall watcher */ |
190 |
+ |
|
191 |
+ |
inregs.w.ax = 0; |
192 |
+ |
int386 (0x33, &inregs, &outregs); |
193 |
+ |
} |
194 |
+ |
|