PIXRATE equ 15
XLIM equ 7
YLIM equ 8
+READREL equ 0xb
PUSHA_EAX_OFFS equ 28
PUSHA_ECX_OFFS equ 24
pop ebp
ret
+; int read_mouse_bn(void)
+ global read_mouse_bn_
+ global _read_mouse_bn
+read_mouse_bn_:
+_read_mouse_bn:
+ pusha
+ mov ax, READ
+ int 0x33
+ xor eax, eax
+ mov ax, bx
+ popa
+ ret
+
; int read_mouse(int *xp, int *yp)
global read_mouse_
read_mouse_:
pop ebp
ret
+; void read_mouse_rel(int *xp, int *yp)
+ global read_mouse_rel_
+read_mouse_rel_:
+ pusha
+ mov esi, eax ; xp
+ mov edi, edx ; yp
+ mov ax, READREL
+ int 0x33
+ movsx eax, cx
+ mov [esi], eax
+ movsx eax, dx
+ mov [edi], eax
+ popa
+ ret
+
+ global _read_mouse_rel
+_read_mouse_rel:
+ push ebp
+ mov ebp, esp
+ push ebx
+ push esi
+ push edi
+ mov ax, READREL
+ int 0x33
+ mov ebx, [ebp + 8]
+ movsx eax, cx
+ mov [ebx], eax
+ mov ebx, [ebp + 12]
+ movsx eax, dx
+ mov [ebx], eax
+ pop edi
+ pop esi
+ pop ebx
+ pop ebp
+ ret
+
; void set_mouse(int x, int y)
global set_mouse_
set_mouse_:
int have_mouse(void);
void show_mouse(int show);
+int read_mouse_bn(void);
int read_mouse(int *xp, int *yp);
+void read_mouse_rel(int *xp, int *yp);
void set_mouse(int x, int y);
void set_mouse_limits(int xmin, int ymin, int xmax, int ymax);
void set_mouse_rate(int xrate, int yrate);