8 |
|
#include <graph.h> |
9 |
|
#include "driver.h" |
10 |
|
|
11 |
+ |
#define NULL 0 |
12 |
+ |
|
13 |
|
#define M_RIGHTBUTT 0x8 |
14 |
|
#define M_LEFTBUTT 0x2 |
15 |
|
#define M_MOTION 0x1 |
29 |
|
#pragma aux mouse_handler parm [EAX] [ECX] [EDX] |
30 |
|
mouse_event = max; |
31 |
|
mouse_xpos = mcx; |
32 |
< |
mouse_ypos = mdx * (long)ydispsize / 200; /* kludge */ |
32 |
> |
mouse_ypos = mdx; |
33 |
|
} |
34 |
|
#pragma on (check_stack) |
35 |
|
|
155 |
|
ydispsize = dp->ysiz; |
156 |
|
crad = dp->ysiz/40; |
157 |
|
|
158 |
+ |
/* set screen limits */ |
159 |
+ |
|
160 |
+ |
inregs.w.ax = 0x7; /* horizontal resolution */ |
161 |
+ |
inregs.w.cx = 0; |
162 |
+ |
inregs.w.dx = xdispsize-1; |
163 |
+ |
int386x( 0x33, &inregs, &outregs, &sregs ); |
164 |
+ |
inregs.w.ax = 0x8; /* vertical resolution */ |
165 |
+ |
inregs.w.cx = 0; |
166 |
+ |
inregs.w.dx = ydispsize-1; |
167 |
+ |
int386x( 0x33, &inregs, &outregs, &sregs ); |
168 |
+ |
|
169 |
|
/* install watcher */ |
170 |
|
|
171 |
|
inregs.w.ax = 0xC; |
177 |
|
|
178 |
|
dp->getcur = ms_getcur; |
179 |
|
} |
180 |
+ |
|
181 |
+ |
void |
182 |
+ |
ms_gcdone( dp ) |
183 |
+ |
struct driver *dp; |
184 |
+ |
{ |
185 |
+ |
union REGS inregs, outregs; |
186 |
+ |
|
187 |
+ |
if (dp->getcur != ms_getcur) |
188 |
+ |
return; /* not installed */ |
189 |
+ |
|
190 |
+ |
dp->getcur = NULL; |
191 |
+ |
|
192 |
+ |
/* uninstall watcher */ |
193 |
+ |
|
194 |
+ |
inregs.w.ax = 0; |
195 |
+ |
int386 (0x33, &inregs, &outregs); |
196 |
+ |
} |
197 |
+ |
|