home *** CD-ROM | disk | FTP | other *** search
- DOSSEG
- .MODEL LARGE
-
- .DATA
-
- .CODE
-
- version dw 0
- msarea db 1024 dup (0)
- msthere db 0
-
- public _show
- _show:
- cmp byte ptr cs:msthere,0 ;is the mouse installed?
- je S1
- mov ax,1 ;AX = show mouse function num
- int 33h ;show the mouse
- S1: retf
-
- public _hide
- _hide:
- cmp byte ptr cs:msthere,0 ;is the mouse installed?
- je H1
- mov ax,2 ;AX = hide mouse function num
- int 33h ;hide the mouse
- H1: retf
-
- public _button
- _button:
- xor ax,ax ;return NO BUTTON by default
- cmp byte ptr cs:msthere,0 ;mouse there?
- je B1
- mov ax,3 ;AX = get button info func num
- int 33h ;BX = get button info in
- mov ax,bx ;AX = button status
- B1:
- retf
-
- public _savemouse
- _savemouse:
- push di
- push si
- push ds
-
- xor ax,ax
- mov es,ax ;ES = 0
- mov al,'m'; ;undoc call to get mouse area
- int 33h ;get mouse save area
- mov ax,es
- or ax,ax ;any change?
- jz SM1
-
- mov al,1
- mov cs:msthere,al
-
- cli
- mov ax,es:[di]
- mov cs:version,ax
-
- mov si,es:[di+8]
-
- mov di,offset cs:msarea
-
- push es
- push cs
- pop es
- pop ds
-
- ;ES:DI = destination for mouse stuff
- ;DS:SI = source
-
- SM2:
- mov bx,[si]
- mov cx,[si+2]
- mov si,[si+4]
-
- rep movsb
- mov si,bx
- or bx,bx
- jnz SM2
-
- ;disable user defined sub-routine
-
- mov ax,12
- mov cx,0
- int 33h
-
- sti
-
- SM1:
- pop ds
- pop si
- pop di
- retf
-
-
-
- public _restoremouse
- _restoremouse:
- push si
- push di
- push ds
-
- cmp byte ptr cs:msthere,0
- je RM1
-
- cli
-
- mov ax,'m'
- int 33h
-
- mov si,es:[di+8]
- mov di,offset cs:msarea
-
- xchg di,si
-
- push cs
- pop ds
-
- ;DS:SI = local mouse storage
- ;ES:DI = mouse area
-
- RM2:
- mov bx,es:[di]
- mov cx,es:[di+2]
- mov di,es:[di+4]
-
- rep movsb
-
- mov di,bx
- or bx,bx
- jnz RM2
-
- sti
- RM1:
- pop ds
- pop di
- pop si
- retf
-
- END