This repository was archived by the owner on Oct 11, 2022. It is now read-only.
forked from nickelsworth/swag
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0028.pas
More file actions
88 lines (77 loc) · 2.4 KB
/
Copy path0028.pas
File metadata and controls
88 lines (77 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{
> Are you the DJ Murdoch that has a mouse fix for the TP IDE?
I wrote a little program to work around some bugs in some mouse drivers that
showed up in TP 6. You can find it as "MOUSEFIX.ZIP" in various places.
Here's the source in its entirety; you'll need TurboPower's Object Professional
library to recompile, or you can supply your own replacements for the various
TSR support routines.
}
program mousefix;
{ Program to intercept mouse calls; make sure that hide/show mouse calls
balance between saves/restores of the mouse state }
{ Usage: Run MOUSEFIX after loading your mouse driver, before running
the TP6 IDE. It's a 27K TSR; if you like it, you'll probably
want to rewrite it in assembler.
Written for the public domain by Duncan Murdoch. Send comments to me
at
dmurdoch@mast.queensu.ca (Internet)
DJ Murdoch at 1:249/1.5 (Fidonet)
71631,122 (Compuserve)
}
uses
opint,optsr;
const
mousehandle = 20;
var
hidecounter : integer;
procedure hidemouse;
var
regs : intregisters;
begin
regs.ax := 2;
emulateint(regs,israrray[mousehandle].origaddr);
end;
procedure showmouse;
var
regs : intregisters;
begin
regs.ax := 1;
emulateint(regs,israrray[mousehandle].origaddr);
end;
procedure mouseservice(bp : word); interrupt;
var
regs : intregisters absolute bp;
i : integer;
begin
with regs do
begin
if ah = 0 then
begin
case al of
0,$16,$21 : hidecounter := 0; { Reset, save state }
1 : dec(hidecounter); { show }
2 : inc(hidecounter); { hide }
$17 : begin { restore state }
if hidecounter > 0 then
for i:=1 to hidecounter do
showmouse
else if hidecounter < 0 then
for i:=-1 downto hidecounter do
hidemouse;
hidecounter := 0;
end;
end;
end;
end;
chainint(regs,israrray[mousehandle].origaddr);
end;
begin
if not initvector($33, MouseHandle, @Mouseservice) then
begin
writeln('Couldn''t get mouse vector!!!');
halt(99);
end;
stayres(ParagraphsToKeep,0);
writeln('Failed to go resident!!');
end.