-
Notifications
You must be signed in to change notification settings - Fork 0
/
mouse.inc
132 lines (116 loc) · 2.6 KB
/
mouse.inc
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
;/*!
; @file
;
; @brief Mouse driver Macro Library
;
; (c) osFree Project 2002-2022, <http://www.osFree.org>
; for licence see licence.txt in root directory, or project website
;
; @author Yuri Prokushev (yuri.prokushev@gmail.com)
;
; This is macros for Mouse INT 33H. This file is new, not found in MASM or related assemblers
;
; Documentation: http://osfree.org/doku/en:docs:macrolib
;
;*/
IFNDEF MOUSE_DEFINED
MOUSE_DEFINED EQU 1
@MOU_CALL MACRO FUNC
IF (OPATTR (FUNC)) AND 00000100B ; Constant
IF FUNC LT 100H ; BYTE
MOV AX,FUNC
ELSE ; WORD
MOV AX,FUNC
ENDIF
ELSEIF (OPATTR (FUNC)) AND 00010000B ; Register
IF TYPE (FUNC) EQ 1 ; BYTES (1 BYTE)
MOV AX,FUNC
ELSEIF TYPE (FUNC) EQ 2 ; WORD (2 BYTE)
IFDIFI <FUNC>, <AX>
MOV AX,FUNC
ENDIF
ENDIF
ELSE
.ERR 1 Unsupported argument type
ENDIF
INT 33H
ENDM
;-----------------------------------------------------------------------------
;
; AL = 00h Init driver
;
; Documentation: http://osfree.org/doku/en:docs:macrolib:mouinit
;
@MouInit MACRO
@MOU_CALL 0
ENDM
;-----------------------------------------------------------------------------
;
; AL = 01h Show Mouse Cursor
;
; Documentation: http://osfree.org/doku/en:docs:macrolib:moushowpointer
;
@MouShowPointer MACRO
@MOU_CALL 1
ENDM
;-----------------------------------------------------------------------------
;
; AL = 03h Mouse Cursor Status
;
; Documentation: http://osfree.org/doku/en:docs:macrolib:moustatus
;
@MouStatus MACRO
@MOU_CALL 3
ENDM
;-----------------------------------------------------------------------------
;
; AL = 04h Set Mouse Cursor Position
;
; Documentation: http://osfree.org/doku/en:docs:macrolib:mousetpos
;
@MouSetPos MACRO X, Y
IFDIFI <X>, <CX>
MOV CX, X
ENDIF
IFDIFI <Y>, <DX>
MOV DX, Y
ENDIF
@MOU_CALL 4
ENDM
;-----------------------------------------------------------------------------
;
; AL = 0Fh Set Mouse Mickey/Pixel ratio
;
; Documentation: http://osfree.org/doku/en:docs:macrolib:mousetmickey
;
@MouSetMickey MACRO X, Y
IFDIFI <X>, <CX>
MOV CX, X
ENDIF
IFDIFI <Y>, <DX>
MOV DX, Y
ENDIF
@MOU_CALL 4
ENDM
;-----------------------------------------------------------------------------
;
; AL = 10h Mouse Cursor Region
;
; Documentation: http://osfree.org/doku/en:docs:macrolib:mouregion
;
@MouRegion MACRO UCX, UCY, LCX, LCY
IFDIFI <UCX>, <CX>
MOV CX, UCX
ENDIF
IFDIFI <UCY>, <DX>
MOV DX, UCY
ENDIF
IFDIFI <LCX>, <SI>
MOV SI, LCX
ENDIF
IFDIFI <LCY>, <DI>
MOV DI, LCY
ENDIF
@MOU_CALL 010h
ENDM
ENDIF