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 path0049.pas
More file actions
224 lines (202 loc) · 7.11 KB
/
Copy path0049.pas
File metadata and controls
224 lines (202 loc) · 7.11 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
Unit Mouse;
{
██████████████████████████████████████████████████
███▌▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▐███▒▒
███▌██ ██▐███▒▒
███▌██ Mouse driver ██▐███▒▒
███▌██ ██▐███▒▒
███▌██ Aleksandar Dlabac ██▐███▒▒
███▌██ (C)1993-1996. Dlabac Bros. Company ██▐███▒▒
███▌██ ------------------------------ ██▐███▒▒
███▌██ adlabac@urcpg.urc.cg.ac.yu ██▐███▒▒
███▌██ adlabac@urcpg.pmf.cg.ac.yu ██▐███▒▒
███▌██ ██▐███▒▒
███▌▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▐███▒▒
██████████████████████████████████████████████████▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
}
Interface
Type CursorMask = Record
Mask : array [1..32] of word;
HotX, HotY : word
End;
Const ArrowMask : CursorMask =
(Mask:(16383,8191,4095,2047,1023,511,255,127,63,31,511,4351,12543,63615,63615,64639,
0,16384,24576,28672,30720,31744,32256,32512,32640,31744,27648,17920,1536,768,768,0);
HotX:0;HotY:0);
WaitMask : CursorMask =
(Mask:(0,0,0,0,49155,49155,57351,61455,61455,57351,49155,49155,0,0,0,0,
0,32766,28686,4104,5128,2768,1440,832,576,1056,2320,4808,5032,30558,32766,0);
HotX:7;HotY:7);
ZoomMask : CursorMask =
(Mask: {$I ZOOM.CUR} HotX:5;HotY:5);
Var MouseOK, Visible : Boolean;
Function MouseInstalled : Boolean;
Procedure ResetMouse;
Procedure HercReset (Page:byte);
Procedure ShowCursor;
Procedure HideCursor;
Function LeftButton : Boolean;
Function RightButton : Boolean;
Function GetMouseX : integer;
Function GetMouseY : integer;
Procedure SetMouseCursor (Mask:CursorMask);
Procedure SetMouseSensitivity (X,Y:integer);
Procedure SetMouseWindow (X1,Y1,X2,Y2:integer);
Implementation
Uses Dos;
Var Regs : registers;
Function MouseInstalled : Boolean;
Begin
With Regs do
Begin
Visible:=False;
AX:=$0000;
Intr ($33,Regs);
MouseInstalled:=not AX=0
End
End;
Procedure ResetMouse;
Begin
If MouseOK then
With Regs do
Begin
Visible:=False;
AX:=$0000;
Intr ($33,Regs)
End
End;
Procedure HercReset (Page:byte); { This procedure is for Hercules }
Begin { Graphics Card, only. It must be }
If MouseOK then { used to display cursor correctly }
With Regs do { in graphics mode. Page is graphics }
Begin { page on which cursor will be }
Visible:=False; { displayed (usually 0). }
If Page=0 then { Should not be used for text mode! }
Mem [$0000:$0449]:=6
else
Mem [$0000:$0449]:=5;
AX:=$0000;
Intr ($33,Regs)
End
End;
Procedure ShowCursor;
Begin
If MouseOK and not Visible then
With Regs do
Begin
Visible:=True;
AX:=$0001;
Intr ($33,Regs)
End
End;
Procedure HideCursor;
Begin
If MouseOK and Visible then
With Regs do
Begin
Visible:=False;
AX:=$0002;
Intr ($33,Regs)
End
End;
Function LeftButton : Boolean;
Var T : Boolean;
Begin
T:=False;
If MouseOK then
With Regs do
Begin
AX:=$0003;
Intr ($33,Regs);
T:=BX in [1,3]
End;
LeftButton:=T
End;
Function RightButton : Boolean;
Var T : Boolean;
Begin
T:=False;
If MouseOK then
With Regs do
Begin
AX:=$0003;
Intr ($33,Regs);
T:=BX in [2,3]
End;
RightButton:=T
End;
Function GetMouseX : integer;
Var T : integer;
Begin
T:=-1;
If MouseOK then
With Regs do
Begin
AX:=$0003;
Intr ($33,Regs);
T:=CX
End;
GetMouseX:=T
End;
Function GetMouseY : integer;
Var T : integer;
Begin
T:=-1;
If MouseOK then
With Regs do
Begin
AX:=$0003;
Intr ($33,Regs);
T:=DX
End;
GetMouseY:=T
End;
Procedure SetMouseCursor (Mask:CursorMask);
Begin
If MouseOK then
With Regs do
Begin
AX:=$0009;
BX:=Mask.HotX;
CX:=Mask.HotY;
ES:=Seg (Mask.Mask);
DX:=Ofs (Mask.Mask);
Intr ($33,Regs)
End
End;
Procedure SetMouseSensitivity (X,Y:integer);
Begin
If MouseOK then
With Regs do
Begin
AX:=$001A;
BX:=X;
CX:=Y;
DX:=0;
Intr ($33,Regs)
End
End;
Procedure SetMouseWindow (X1,Y1,X2,Y2:integer);
Begin
If MouseOK then
With Regs do
Begin
AX:=$0007;
CX:=X1;
DX:=X2;
Intr ($33,Regs);
AX:=$0008;
CX:=Y1;
DX:=Y2;
Intr ($33,Regs)
End
End;
Begin
MouseOK:=MouseInstalled
End.
You should also create a file ZOOM.CUR and insert this two lines in it:
(61695,49215,32799,32799,15,15,15,15,32799,32799,49167,61447,65411,65473,65505,65523,
0,3840,4224,9280,20000,17440,16416,18208,8256,4288,4064,112,56,28,12,0);
Cursor data in ZOOM.CUR file is created with MOUSEDIT program, made by same
author (also available in SWAG).