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 path0048.pas
More file actions
268 lines (240 loc) · 6.12 KB
/
Copy path0048.pas
File metadata and controls
268 lines (240 loc) · 6.12 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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
Unit OwnMouse;
(*
=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=
=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=
=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=
=FE=FE=FE
=FE Bios mouse unit (Assembler code) =
=FE
=FE Totally coded by Lunatic/Lucifer =
=FE
=FE If you use this unit, please, give some credits for me, or atleast s=
end =FE
=FE copy of your program(or it's source) to lunatic@dlc.fi=
=FE
=FE -=C4=CD FREEWARE SOURCE FROM SWAG'S MOUSE.SWG =CD=
-- =FE
=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=
=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=
=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=FE=
=FE=FE=FE
*)
Interface
(* ---------------------- MOUSE PROCEDURES ---------------------------- *)
Procedure GetMouseData(var major,minor,mousetype,irq:byte);{Restores vers=
ion,
(major.minor)=
,
type of mouse=
and
mouse's IRQ}
Procedure TellAboutMouse; {Textmode ofcourse.. Tells somethin' about your=
mouse}
Procedure ShowMouse; {Show mouse cursor}
Procedure HideMouse; {Hide mouse cursor}
Procedure SetMOUSEXY(x,y:integer); {Set's mouse's coordinates t=
o
x,y}
Procedure MouseAREA(x1,y1,x2,y2:integer); {Set's mouses minimum=
and
maximum x,y}
Procedure SetSensitivity(xsens,ysens,dst:integer); {Set mouse sensitivity=
}
Procedure GetSensitivity(var xsens,ysens,dst:integer); {Get sensitivity}
{dst= double speed treshold xsens= xsensitivity ysens= ysensitivity}
(* ---------------------- MOUSE FUNCTIONS ---------------------------- *)
Function MouseInstalled:Boolean; {Returns TRUE if mouse has been installe=
d}
Function Buttons:integer; {Restores number of buttons}
Function MouseLanguage:Integer; {Restores the language =
of
mouse driver..}
Function MouseX:Integer; {Restores Mouse's X vector}
Function MouseY:Integer; {Restores Mouse's Y vector}
Function LeftPressed:Boolean; {Returns true if LeftButton of mouse is pre=
ssed}
Function LeftReleased:Boolean; {Returns true if LeftButton is not pressed=
}
Function RightPressed:Boolean; {Returns true if RightButton has been pres=
sed}
Function RightReleased:Boolean; {Returns true if Rightbutton hasn't been
pressed}
Implementation
Function MouseInstalled:Boolean;
Var inst:Integer;
Begin
Asm
Mov ax, 00h
Int 33h
Mov inst, ax
End;
If inst= $0000 Then MouseInstalled:= True;
If inst= $FFFF then MouseInstalled:= False;
End;
Function Buttons:integer;
var buttonnum:integer;
Begin
Asm
Mov ax, 00h
Int 33h
Mov buttonnum, bx
End;
Buttons:= buttonnum;
End;
Procedure GetMouseData(var major,minor,mousetype,irq:byte);
var v1,v2,mt,i:byte;
Begin
asm
Mov ax, 24h
Int 33h
Mov v1, bh
Mov v2, bl
Mov mt, ch
Mov i, cl
end;
major:= v1;minor:= v2;mousetype:= mt;irq:= i;
End;
Function MouseLanguage:Integer;var kieli:integer;
Begin Asm
Mov ax, 23h
Int 33h
Mov kieli, bx
End;
MouseLanguage:= kieli;
End;
Procedure TellAboutMouse; {Textmode ofcourse..}
var v1,v2,mt,irq:byte;lan:integer;
Begin
GetMouseData(v1,v2,mt,irq);
lan:= MouseLanguage;
Write('Mouse type: ');
If mt= 1 Then WriteLn('BUS mouse');
If mt= 2 Then WriteLn('Serial mouse');
If mt= 3 Then WriteLn('InPort mouse');
If mt= 4 Then WriteLn('PS/2 mouse');
If mt= 5 Then WriteLn('Hewlett Packard mouse');
WriteLn('Version: ',v1,'.',v2);
Write('Mouse IRQ: ');
If irq= 0 Then WriteLn('PS/2') else WriteLn(irq);
Write('Mouse language: ');
if lan= 0 Then WriteLn('english');
if lan= 1 Then WriteLn('french (F)');
if lan= 2 Then WriteLn('dutch (NL)');
if lan= 3 Then WriteLn('german (D)');
if lan= 4 Then WriteLn('swedish (S)');
if lan= 5 Then WriteLn('finnish (SF)');
if lan= 6 Then WriteLn('spanish (E)');
if lan= 7 Then WriteLn('portuguese (P)');
if lan= 8 Then WriteLn('Italian (I)');
End;
Procedure ShowMouse;Assembler;
Asm
Mov ax, 01h
Int 33h
End;
Procedure HideMouse;Assembler;
Asm
Mov ax, 02h
Int 33h
End;
Function MouseX:Integer;
var mx:integer;
Begin Asm
Mov ax, 03h
Int 33h
Mov mx, cx
End; MouseX:= mx; End;
Function MouseY:Integer;
var my:integer;
Begin Asm
Mov ax, 03h
Int 33h
Mov my, dx
End; MouseY:= my; End;
Procedure SetMOUSEXY(x,y:integer);Assembler;
Asm
Mov ax, 04h
Mov cx, x
Mov dx, y
Int 33h
End;
Function LeftPressed:Boolean;
var data:integer;
Begin
Asm
Mov ax, 05h
Mov bx, 0h
Int 33h
or ax, 0
mov data, ax
End;
if data= 1 Then LeftPressed:= True else LeftPressed:= False;
End;
Function LeftReleased:Boolean;
var data:integer;
Begin
Asm
Mov ax, 06h
Mov bx, 0h
Int 33h
or ax, 0
mov data, ax
End;
if data= 0 Then LeftReleased:= True else LeftReleased:= False;
End;
Function RightPressed:Boolean;
var data:integer;
Begin
Asm
Mov ax, 05h
Mov bx, 1h
Int 33h
or ax, 0h
mov data, ax
End;
if data= 2 Then RightPressed:= True else RightPressed:= False;
End;
Function RightReleased:Boolean;
var data:integer;
Begin
Asm
Mov ax, 06h
Mov bx, 1h
Int 33h
or ax, 0
mov data, ax
End;
if data= 0 Then RightReleased:= True else RightReleased:= False;
End;
Procedure MouseAREA(x1,y1,x2,y2:integer);Assembler;
Asm
Mov ax, 07h
Mov cx, x1
Mov dx, x2
Int 33h
Mov ax, 08h
Mov cx, y1
Mov dx, y2
Int 33h
End;
Procedure SetSensitivity(xsens,ysens,dst:integer);Assembler;Asm
Mov ax, 1Ah
Mov bx, xsens
Mov cx, ysens
Mov dx, dst
Int 33h
end;
Procedure GetSensitivity(var xsens,ysens,dst:integer);
var x,y,d:integer;
Begin
Asm
Mov ax,1B
Int 33h
Mov x, bx
Mov y, cx
Mov d, dx
End;
xsens:= x;ysens:= y;dst:= d;
End;
End.