forked from dybuk87/asm_vesa_640x480_16bpp_lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mouse.inc
61 lines (49 loc) · 827 Bytes
/
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
;-----------------------------------------
; WE: Brak
; WY: BX - button state; CX - X; DX - Y
; info: Get mouse position and button state
;-----------------------------------------
MousePos:
push ax
mov ax, 03
int 33h
push cx
mov ax, dx
mov cx, 480
mul cx
mov cx, 200
div cx
mov dx, ax
pop cx
pop ax
ret
MOUSE_TIMAGE dd 0
; SI - TIMAGE structure for mouse pointer
initMouse:
mov MOUSE_TIMAGE, ESI
ret
ShowMouse:
push ds
push es
pushad
mov esi, MOUSE_TIMAGE
cmp esi, 0
je .no_mouse_img
xor ecx, ecx
xor edx, edx
call MousePos
lea edi, SCREEN_BUFFER
mov esi, MOUSE_TIMAGE
push dword ptr 0
push dword ptr 0
push ecx
push edx
push dword ptr 32
push dword ptr 32
push word ptr 0F81Fh
call PutPartSpriteProc
.no_mouse_img:
popad
pop es
pop ds
ret