Listing: 1 (* Release 3.10 *) 2 (*-------------------------------------------------------------------------* 3 * * 4 * MSMOUSE.MOD - Microsoft mouse drivers * 5 * * 6 * COPYRIGHT (C) 1989..1992 Clarion Software Corporation. * 7 * All Rights Reserved * 8 * * 9 *--------------------------------------------------------------------------*) 10 11 (*%F _fdata *) 12 (*# call(seg_name => null) *) 13 (*# data(seg_name => null) *) 14 (*%E *) 15 (*# module(implementation=>off) *) 16 (*# call(o_a_copy => off) *) 17 (*# check(stack=>off, 18 index=>off, 19 range=>off, 20 overflow=>off, 21 nil_ptr=>off) *) 22 23 IMPLEMENTATION MODULE MsMouse; 24 25 (* MSDOS Only *) 26 27 IMPORT Lib, SYSTEM, CoreMain; 28 29 PROCEDURE Reset(): INTEGER; 30 31 VAR 32 r: SYSTEM.Registers; ***** ^ not supported yet 33 status: CARDINAL; 34 BEGIN 35 r.AX:=0; ***** ^ not supported yet ***** ^ not supported yet 36 Lib.Intr(r, 33H); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 37 status:=r.AX; ***** ^ not supported yet ***** ^ not supported yet 38 IF status = MAX(CARDINAL) THEN ***** ^ undeclared identifier ***** ^ not supported yet 39 RETURN(r.BX); ***** ^ not supported yet ***** ^ not supported yet 40 END; 41 RETURN MAX(INTEGER); ***** ^ undeclared identifier ***** ^ not supported yet 42 END Reset; ***** ^ not supported yet 43 44 PROCEDURE Cursor(Mode: BOOLEAN); 45 46 VAR 47 r: SYSTEM.Registers; ***** ^ not supported yet 48 BEGIN 49 IF Mode = _MS_HIDE THEN ***** ^ undeclared identifier 50 r.AX:=2; ***** ^ not supported yet ***** ^ not supported yet 51 ELSIF Mode = _MS_SHOW THEN ***** ^ undeclared identifier 52 r.AX:=1; ***** ^ not supported yet ***** ^ not supported yet 53 ELSE 54 RETURN; 55 END; 56 Lib.Intr(r, 33H); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 57 RETURN; 58 END Cursor; ***** ^ not supported yet 59 60 PROCEDURE GetStatus(VAR mp: MsData); ***** ^ undeclared identifier 61 62 VAR 63 r: SYSTEM.Registers; ***** ^ not supported yet 64 BEGIN 65 r.AX:=3; ***** ^ not supported yet ***** ^ not supported yet 66 Lib.Intr(r, 33H); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 67 mp.row:=r.DX; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 68 mp.col:=r.CX; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 69 mp.left_pressed:=0 IN BITSET(r.BX); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 70 mp.right_pressed:=1 IN BITSET (r.BX); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 71 mp.middle_pressed:=2 IN BITSET(r.BX); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 72 RETURN; 73 END GetStatus; ***** ^ not supported yet 74 75 PROCEDURE SetPosition(Row, Col: INTEGER); 76 77 VAR 78 r: SYSTEM.Registers; ***** ^ not supported yet 79 BEGIN 80 r.AX:=4; ***** ^ not supported yet ***** ^ not supported yet 81 r.CX:=Col; ***** ^ not supported yet ***** ^ not supported yet 82 r.DX:=Row; ***** ^ not supported yet ***** ^ not supported yet 83 Lib.Intr(r, 33H); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 84 RETURN; 85 END SetPosition; ***** ^ not supported yet 86 87 PROCEDURE GetPress(Button: INTEGER; VAR mp: MsData); ***** ^ undeclared identifier 88 89 VAR 90 r: SYSTEM.Registers; ***** ^ not supported yet 91 BEGIN 92 r.AX:=5; ***** ^ not supported yet ***** ^ not supported yet 93 r.BX:=Button; ***** ^ not supported yet ***** ^ not supported yet 94 Lib.Intr(r, 33H); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 95 mp.row:=r.DX; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 96 mp.col:=r.CX; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 97 mp.left_pressed:=0 IN BITSET(r.AX); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 98 mp.right_pressed:=1 IN BITSET(r.AX); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 99 mp.middle_pressed:=2 IN BITSET(r.AX); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 100 mp.actions:=r.BX; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 101 RETURN; 102 END GetPress; ***** ^ not supported yet 103 104 PROCEDURE GetRelease(Button: INTEGER; VAR mp: MsData); ***** ^ undeclared identifier 105 106 VAR 107 r: SYSTEM.Registers; ***** ^ not supported yet 108 BEGIN 109 r.AX:=6; ***** ^ not supported yet ***** ^ not supported yet 110 r.BX:=Button; ***** ^ not supported yet ***** ^ not supported yet 111 Lib.Intr(r, 33H); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 112 mp.row:=r.DX; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 113 mp.col:=r.CX; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 114 mp.left_pressed:=0 IN BITSET(r.AX); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 115 mp.right_pressed:=1 IN BITSET (r.AX); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 116 mp.middle_pressed:=2 IN BITSET(r.AX); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 117 mp.actions:=r.BX; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 118 RETURN; 119 END GetRelease; ***** ^ not supported yet 120 121 PROCEDURE SetRange(mp: MsRange); ***** ^ undeclared identifier 122 123 VAR 124 r: SYSTEM.Registers; ***** ^ not supported yet 125 BEGIN 126 r.AX:=7; ***** ^ not supported yet ***** ^ not supported yet 127 r.CX:=mp.min_col; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 128 r.DX:=mp.max_col; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 129 Lib.Intr(r, 33H); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 130 r.AX:=8; ***** ^ not supported yet ***** ^ not supported yet 131 r.CX:=mp.min_row; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 132 r.DX:=mp.max_row; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 133 Lib.Intr(r, 33H); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 134 RETURN; 135 END SetRange; ***** ^ not supported yet 136 137 PROCEDURE SetGraphCursor(VAR mp: MsGraphcur); ***** ^ undeclared identifier 138 139 VAR 140 r: SYSTEM.Registers; ***** ^ not supported yet 141 BEGIN 142 r.AX:=9; ***** ^ not supported yet ***** ^ not supported yet 143 r.BX:=mp.col; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 144 r.CX:=mp.row; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 145 r.DX:=Ofs(mp.screen_mask); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 146 r.ES:=Seg(mp.screen_mask); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 147 Lib.Intr(r, 33H); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 148 RETURN; 149 END SetGraphCursor; ***** ^ not supported yet 150 151 PROCEDURE SetTextCursor(mp: MsTextCur); ***** ^ undeclared identifier 152 153 VAR 154 r: SYSTEM.Registers; ***** ^ not supported yet 155 BEGIN 156 r.AX:=0AH; ***** ^ not supported yet ***** ^ not supported yet 157 r.BX:=CARDINAL(mp.type); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 158 IF mp.type = _MS_HARD THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier 159 r.CX:=mp.H.start_scan; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 160 r.DX:=mp.H.end_scan; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 161 ELSE 162 r.CX:=mp.S.screen_mask; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 163 r.DX:=mp.S.cursor_mask; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 164 END; 165 Lib.Intr(r, 33H); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 166 RETURN; 167 END SetTextCursor; ***** ^ not supported yet 168 169 PROCEDURE GetMotion(VAR mp: MsMotion); ***** ^ undeclared identifier 170 171 VAR 172 r: SYSTEM.Registers; ***** ^ not supported yet 173 BEGIN 174 r.AX:=0BH; ***** ^ not supported yet ***** ^ not supported yet 175 Lib.Intr(r, 33H); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 176 mp.horiz:=r.CX; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 177 mp.vert:=r.DX; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 178 RETURN; 179 END GetMotion; ***** ^ not supported yet 180 181 TYPE 182 tr = RECORD 183 CASE : BOOLEAN OF ***** ^ not supported yet ***** ^ 'POINTER' expected 184 | TRUE : IFunc: MouseFuncType; 185 | FALSE : A: ARRAY [0..1] OF CARDINAL; 186 END; 187 END; 188 189 PROCEDURE SetInterrupt(VAR mp: MsInterrupt); 190 191 VAR 192 r: SYSTEM.Registers; 193 temp: tr; 194 BEGIN 195 temp.IFunc := mp.IntFunc; 196 r.AX:=0CH; 197 r.CX:=mp.mask; 198 r.DX:=temp.A[0]; 199 r.ES:=temp.A[1]; 200 Lib.Intr(r, 33H); 201 RETURN; 202 END SetInterrupt; 203 204 PROCEDURE SwapInterrupt(VAR mp: MsInterrupt); 205 206 VAR 207 r: SYSTEM.Registers; 208 temp: tr; 209 BEGIN 210 temp.IFunc := mp.IntFunc; 211 r.AX:=14H; 212 r.CX:=mp.mask; 213 r.DX:=temp.A[0]; 214 r.ES:=temp.A[1]; 215 Lib.Intr(r, 33H); 216 mp.mask:=r.CX; 217 mp.IntFunc:=MouseFuncType([r.ES: r.DX]); 218 RETURN; 219 END SwapInterrupt; 220 221 PROCEDURE LightPen(Mode: BOOLEAN); 222 223 VAR 224 r: SYSTEM.Registers; 225 BEGIN 226 IF Mode = _MS_ON THEN 227 r.AX:=0DH; 228 ELSE 229 r.AX:=0EH; 230 END; 231 Lib.Intr(r, 33H); 232 RETURN; 233 END LightPen; 234 235 PROCEDURE SetMickeys(Vert, Horiz: INTEGER); 236 237 VAR 238 r: SYSTEM.Registers; 239 BEGIN 240 r.AX:=0FH; 241 r.CX:=Horiz; 242 r.DX:=Vert; 243 Lib.Intr(r, 33H); 244 RETURN; 245 END SetMickeys; 246 247 PROCEDURE UpdateScreen(x1, y1, x2, y2: INTEGER); 248 249 VAR 250 r: SYSTEM.Registers; 251 BEGIN 252 r.AX:=10H; 253 r.CX:=x1; 254 r.DX:=y1; 255 r.SI:=x2; 256 r.DI:=y2; 257 Lib.Intr(r, 33H); 258 RETURN; 259 END UpdateScreen; 260 261 PROCEDURE SetDouble(Threshold: INTEGER); 262 263 VAR 264 r: SYSTEM.Registers; 265 BEGIN 266 r.AX:=13H; 267 r.DX:=Threshold; 268 Lib.Intr(r, 33H); 269 RETURN; 270 END SetDouble; 271 272 PROCEDURE DriverSize(): CARDINAL; 273 274 VAR 275 r: SYSTEM.Registers; 276 BEGIN 277 r.AX:=15H; 278 Lib.Intr(r, 33H); 279 RETURN(r.BX); 280 END DriverSize; 281 282 PROCEDURE SaveDriver(Buffer: ADDRESS); 283 284 VAR 285 r: SYSTEM.Registers; 286 BEGIN 287 r.AX:=16H; 288 r.DX:=Ofs(Buffer^); 289 r.ES:=Seg(Buffer^); 290 Lib.Intr(r, 33H); 291 RETURN; 292 END SaveDriver; 293 294 PROCEDURE RestoreDriver(Buffer: ADDRESS); 295 296 VAR 297 r: SYSTEM.Registers; 298 BEGIN 299 r.AX:=017H; 300 r.DX:=Ofs(Buffer^); 301 r.ES:=Seg(Buffer^); 302 Lib.Intr(r, 33H); 303 RETURN; 304 END RestoreDriver; 305 306 PROCEDURE GetSensitivity(VAR mp: MsSense); 307 308 VAR 309 r: SYSTEM.Registers; 310 BEGIN 311 r.AX:=01BH; 312 Lib.Intr(r, 33H); 313 mp.v_speed:=r.CX; 314 mp.h_speed:=r.BX; 315 mp.threshold:=r.DX; 316 RETURN; 317 END GetSensitivity; 318 319 PROCEDURE SetSensitivity(mp: MsSense); 320 321 VAR 322 r: SYSTEM.Registers; 323 BEGIN 324 r.AX:=01AH; 325 r.BX:=mp.h_speed; 326 r.CX:=mp.v_speed; 327 r.DX:=mp.threshold; 328 Lib.Intr(r, 33H); 329 RETURN; 330 END SetSensitivity; 331 332 PROCEDURE SetPage(Page: CARDINAL); 333 334 VAR 335 r: SYSTEM.Registers; 336 BEGIN 337 r.AX:=01DH; 338 r.BX:=Page; 339 Lib.Intr(r, 33H); 340 RETURN; 341 END SetPage; 342 343 PROCEDURE GetPage(): CARDINAL; 344 345 VAR 346 r: SYSTEM.Registers; 347 BEGIN 348 r.AX:=01EH; 349 Lib.Intr(r, 33H); 350 RETURN(r.BX); 351 END GetPage; 352 353 354 END MsMouse. 261 errors