home *** CD-ROM | disk | FTP | other *** search
- ; VMOUSE ver 0.1
- ;
- ; ¥Γa »poúpa¼¼a íδ½a ¡a»¿ca¡a »o ¼oΓ¿óa¼ ¿ºóecΓ¡oúo »a¬eΓa NU.
- ; Haτa½ ∩ φΓπ »poúpa¼¼π úoña ñóa ¡aºañ, oñ¡a¬o, ¬aªñδ⌐ paº ío½ee
- ; cpoτ¡δe ¿ ¡eoΓ½oª¡δe ñe½a »pepδóa½¿ paíoΓπ. Åoxoªe, τΓo ∩ oτe¡∞
- ; ¡e c¬opo ¡a⌐ñπ ópe¼∩ ñoóecΓ¿ VMOUSE ño ñe⌐cΓó¿Γe½∞¡o »p¿½¿τ¡oúo
- ; ó¿ña. ÅoφΓo¼π ∩ peΦ¿½ óδ»πcΓ¿Γ∞ VMOUSE ¬a¬ Multiware product.
- ; Bc∩¬¿⌐ ªe½aεΘ¿⌐ ¼oªeΓ ¬a¬ e¼π πúoñ¡o »epeñe½δóaΓ∞ ¿cxoñ¡δ⌐
- ; Γe¬cΓ »poúpa¼¼δ ¿ ¿¼eeΓ »paóo ño»o½¡¿Γ∞ c»¿co¬ coaóΓopoó.
- ; Åpoúpa¼¼a ¼oªeΓ pac»pocΓpa¡∩Γ∞c∩ Γo½∞¬o ó¼ecΓe c ee ¿cxoñ¡δ¼
- ; Γe¬cΓo¼ ¿ ¡e ¼oªeΓ íδΓ∞ ¿c»o½∞ºoóa¡a ó ¬o¼¼epτec¬¿x µe½∩x.
- ;
- ; Version 0.1 - Vladimir Volynsky
- ; Version 0.2 - <────── Cεña Bδ ¼oªeΓe ó»¿caΓ∞ cóoe ¿¼∩.
- ; Version 0.3 -
- ; ....
- ;
- ; VMOUSE φΓo ¡e ¼δΦ¿¡δ⌐ ñpa⌐óep, a ¡aóec¬a ¡añ ¼δΦ¿¡δ¼ ñpa⌐óepo¼.
- ; Åπc¬aΓ∞ ee c½eñπeΓ _»oc½e_ oíδτ¡oúo ¼δΦ¿¡oúo ñpa⌐óepa. O¡a ºa¼e¡∩eΓ
- ; cΓa¡ñapΓ¡δ⌐ ¼δΦ¿¡δ⌐ ¬πpcop ó Γe¬cΓoóo⌐ ¼oñe ¡a cΓpe½¬π »o Γ¿»π Γoúo,
- ; ¬oΓopδ⌐ Bδ ó¿ñe½¿ ó Norton Utility. Op¿e¡Γ¿poóa¡a o¡a ¡a VGA,
- ; oñ¡a¬o, ¡op¼a½∞¡o paíoΓaeΓ ¿ ¡a EGA, ec½¿ ºaúpπªe¡δ VGA Σo¡Γδ
- ; (¡a»p¿¼ep, »poúpa¼¼o⌐ VGAGA).
- ;
-
- MY_CHAR equ 0DBh ;0DCh ;0DBh ;0D3h
- MY_CHAR1 equ 008h ;0B2h ;0F1h
- MY_CHAR2 equ 0DEh ;00Ah ;0DFh ;0D1h
- MY_CHAR3 equ 00Ah ;0DEh ;0F2h
-
- ATT_MASK equ 077h
-
- .286
-
- code segment byte public
- assume cs:code, ds:code
- org 0A0h
- _cx dw ?
- _dx dw ?
- _x dw ?
- _di dw ?
- _si dw ?
- _xx dw ?
- _xxx dw ?
- _y dw ?
- _yy dw ?
- _yyy dw ?
- char_address dw ?
- char_att db ?
- char_att1 db ?
- char_att2 db ?
- char_att3 db ?
- h_mask dw ?
- cur_mask dw ?
- flag db ?
- video_base dw ?
-
- org 100h
- start: jmp init
- ;──────────────────────────────────────────────────────────────────────────
- int33: cmp ax,0000h
- jnz no_stop_drv
- turn_off_all: mov cs:h_mask,0
- turn_off_my: mov cs:flag,0
- call restore
- temp: jmp int33_old
- no_stop_drv: cmp ax,0002h
- jz turn_off_my
- cmp ax,0021h
- jz turn_off_all
- cmp ax,0001h
- jz init_drv
- cmp ax,000Ch
- jz new_drv
- int33_old:
- db 0EAh ; jmp int33
- int33_off dw 0
- int33_seg dw 0
- iret33: retf 2
- new_drv: mov cs:h_mask,cx
- mov cs:h_off,dx
- mov cs:h_seg,es
- jmp int33_old
-
- init_drv: push ds
- push es
- push ax
- push bx
- push cx
- push dx
- push si
- push di
- push bp
- mov ax,000Ch
- mov cx,007Fh
- mov dx,offset handler
- push cs
- pop es
- pushf
- call cs: dword ptr offset int33_off
- cmp cs:flag,1
- jz no_save
- call save
- call set_char_font
- no_save: mov cs:flag,1
- pop bp
- pop di
- pop si
- pop dx
- pop cx
- pop bx
- pop ax
- pop es
- pop ds
- iret
- ;──────────────────────────────────────────────────────────────────────────
- handler: cmp cs:flag,0
- jnz si0
- kbd_emulation: cmp bl,1
- jnz no_left
- mov cx,1C0Bh ; CR
- jmp short int16_5
- no_left: cmp bl,2
- jnz no_rigth
- mov cx,5200h ; Ins Key
- jmp short int16_5
- no_rigth: cmp bl,4
- jnz no_middle
- mov cx,5300h ; Del Key
- jmp short int16_5
- no_middle: shr cx,1
- shr cx,1
- shr cx,1
- cmp cx,cs:_xx
- mov cs:_xx,cx
- jz cx00
- ja cx_plus0
- cx_minus0: mov cx,4B00h ; Left arror
- jmp short int16_5
- cx_plus0: mov cx,4D00h ; Right arror
- int16_5: mov ah,5
- int 16h
- cx00: shr dx,1
- shr dx,1
- shr dx,1
- cmp dx,cs:_yy
- mov cs:_yy,dx
- jz dx00
- ja dx_plus0
- dx_minus0: mov cx,4800h ; Up arror
- jmp short int16_5_dx
- dx_plus0: mov cx,5000h ; Down arror
- int16_5_dx: mov ah,5
- int 16h
- dx00: retf
- ;-------------------------------------------
- si0: call restore
- test cs:h_mask,ax
- jz ignore_h
- push ax
- push bx
- push cx
- push dx
- db 09Ah ; call handler
- h_off dw 0
- h_seg dw 0
- pop dx
- pop cx
- pop bx
- pop ax
- ignore_h: shr cx,1
- shr cx,1
- shr cx,1
- cmp cx,cs:_xx
- jz cx0
- ja cx_plus
- cx_minus: mov cs:_si,si
- mov cs:_xxx,7
- cx0: cmp cx,0
- jz cx_plus
- no_cx_plus: cmp cx,79
- jnz cx_no_big
- cx_plus: mov cs:_xxx,0
- mov cs:_si,si
- cx_no_big: mov ax,si
- sub si,cs:_si
- add si,cs:_xxx
- and si,7h
- mov cs:_xxx,si
- mov cs:_si,ax
- mov cs:_xx,cx
- shr dx,1
- shr dx,1
- shr dx,1
- cmp dx,cs:_yy
- jz dx0
- ja dx_plus
- dx_minus: mov cs:_di,di
- mov cs:_yyy,00Fh
- dx0: cmp dx,0
- jz dx_plus
- cmp dx,24
- jnz dx_no_big
- dx_plus: mov cs:_di,di
- mov cs:_yyy,4
- dx_no_big: mov ax,di
- sub di,cs:_di
- add di,cs:_yyy
- and di,01Fh
- mov cs:_yyy,di
- mov cs:_di,ax
- mov cs:_yy,dx
- call save
- call set_char_font
- sti
- oks: retf
- ;──────────────────────────────────────────────────────────────────────────
- set_char_font: cli
- push ds
- push si
- push bx
- push ds
- xor ax,ax
- mov ds,ax
- cmp ds: byte ptr [485h],10h ;scan lines / char
- jz standart
- mov cs:cur_mask,offset cursor_mask ; ???_8
- mov cs:cur_msk,offset cursor_msk ; ???
- jmp short ok_cur
- standart: mov cs:cur_mask,offset cursor_mask
- mov cs:cur_msk,offset cursor_msk
- ok_cur: pop ds
- open_font: mov dx,3C4h ; sequencer
- mov ax,0402h
- out dx,ax
- mov ax,0704h
- out dx,ax
- mov dl,0CEh ; graph
- mov ax,0005h
- out dx,ax
- mov ax,0406h
- out dx,ax
- mov ax,0204h
- out dx,ax
- push si
- mov ax,0A000h
- mov es,ax
- mov ds,ax
- mov di,MY_CHAR*20h
- mov al,cs:char_att
- call convert1
- f_cikl: push cx
- lodsb
- mov ah,cs:[bx]
- mov cx,cs:_xxx
- shr ah,cl
- or al,ah
- mov ah,cs:[bp]
- shr ah,cl
- call convert3
- pop cx
- loop f_cikl
- pop si
- push si
- mov di,MY_CHAR1*20h
- mov al,cs:char_att1
- call convert1
- f_cikl1: push cx
- lodsb
- mov ah,cs:[bx]
- mov cx,8
- sub cx,cs:_xxx
- shl ah,cl
- or al,ah
- mov ah,cs:[bp]
- shl ah,cl
- call convert3
- pop cx
- loop f_cikl1
- pop si
- push si
- mov di,MY_CHAR2*20h
- mov al,cs:char_att2
- call convert2
- f_cikl2: push cx
- lodsb
- mov ah,cs:[bx]
- mov cx,cs:_xxx
- shr ah,cl
- or al,ah
- mov ah,cs:[bp]
- shr ah,cl
- call convert3
- pop cx
- loop f_cikl2
- pop si
- mov di,MY_CHAR3*20h
- mov al,cs:char_att3
- call convert2
- f_cikl3: push cx
- lodsb
- mov ah,cs:[bx]
- mov cx,8
- sub cx,cs:_xxx
- shl ah,cl
- or al,ah
- mov ah,cs:[bp]
- shl ah,cl
- call convert3
- pop cx
- loop f_cikl3
- close_font: mov dx,3C4h ; sequencer
- mov ax,0302h
- out dx,ax
- mov al,04h
- out dx,ax
- mov dl,0CEh ; graph
- mov ax,1005h
- out dx,ax
- mov ax,0E06h
- out dx,ax
- mov ax,0004h
- out dx,ax
- pop bx
- pop si
- pop ds
- ret
- ;──────────────────────────────────────────────────────────────────────────
- convert3: inc bx
- inc bp
- not ah
- and al,ah
- stosb
- ret
- ;──────────────────────────────────────────────────────────────────────────
- convert2: call convert1
- add bx,16
- add bp,16
- ret
- ;──────────────────────────────────────────────────────────────────────────
- convert1: mov ah,0
- mov cl,5
- shl ax,cl
- mov si,ax
- mov cx,20h
- mov bx,cs:cur_mask
- sub bx,cs:_yyy
- mov bp,cs:cur_msk
- sub bp,cs:_yyy
- ret
- ;──────────────────────────────────────────────────────────────────────────
- save: cli
- cld
- mov ax,cs:_yy
- mov cx,cs:_xx
- xor dx,dx
- mov bx,80*2
- mul bx
- shl cx,1
- add ax,cx
- mov si,ax
- mov ax,cs:video_base
- mov ds,ax
- mov bl,ds:[si] ; save char & attrib
- mov cs:char_att,bl
- mov cs:char_address,si
- mov ds: byte ptr [si],MY_CHAR
- mov bl,ds:[si+2]
- mov cs:char_att1,bl
- mov ds: byte ptr [si+2],MY_CHAR1
- mov bl,ds:[si+80*2]
- mov cs:char_att2,bl
- mov ds: byte ptr [si+80*2],MY_CHAR2
- mov bl,ds:[si+80*2+2]
- mov cs:char_att3,bl
- mov ds: byte ptr [si+80*2+2],MY_CHAR3
- ret
- ;──────────────────────────────────────────────────────────────────────────
- restore: cli
- push ds
- push ax
- push bx
- mov ax,cs:video_base
- mov ds,ax
- mov bx,cs:char_address ; restore char & attrib
- cmp ds:byte ptr [bx],MY_CHAR
- jnz rest1
- mov al,cs:char_att
- mov ds:[bx],al
- rest1: cmp ds:byte ptr [bx+2],MY_CHAR1
- jnz rest2
- mov al,cs:char_att1
- mov ds:[bx+2],al
- rest2: cmp ds:byte ptr [bx+80*2],MY_CHAR2
- jnz rest3
- mov al,cs:char_att2
- mov ds:[bx+80*2],al
- rest3: cmp ds:byte ptr [bx+80*2+2],MY_CHAR3
- jnz rest4
- mov al,cs:char_att3
- mov ds:[bx+80*2+2],al
- rest4: pop bx
- pop ax
- pop ds
- ret
- ;──────────────────────────────────────────────────────────────────────────
- cur_msk dw 0
- db 060h,090h,088h,084h,082h,081h,080h,082h
- db 092h,069h,069h,006h,000h,000h,000h,000h
- db 000h,000h,000h,000h,000h,000h,000h,000h
- db 000h,000h,000h,000h,000h,000h,000h,000h
- cursor_msk db 060h,090h,088h,084h,082h,081h,080h,082h
- db 092h,069h,069h,006h,000h,000h,000h,000h
- db 000h,000h,000h,000h,000h,000h,000h,000h
- db 000h,000h,000h,000h,000h,000h,000h ;,000h
-
- db 000h,060h,070h,078h,07Ch,07Eh,07Fh,07Ch
- db 06Ch,006h,006h,000h,000h,000h,000h,000h
- db 000h,000h,000h,000h,000h,000h,000h,000h
- db 000h,000h,000h,000h,000h,000h,000h,000h
- cursor_mask db 000h,060h,070h,078h,07Ch,07Eh,07Fh,07Ch
- db 06Ch,006h,006h,000h,000h,000h,000h,000h
- db 000h,000h,000h,000h,000h,000h,000h,000h
- db 000h,000h,000h,000h,000h,000h,000h,000h
- db 0,0
- ;──────────────────────────────────────────────────────────────────────────
- init: mov ah,9
- mov dx,offset copy_mess
- int 21h
- mov cx,(100h-90h)/2
- mov di,90h
- xor ax,ax
- rep stosw
- mov flag,1
- mov video_base,0B800h
- mov ax,0021h
- int 33h ; Enable mouse cursor
- mov ax,0000h
- int 33h ; Enable mouse cursor
- mov ax,0004h
- xor cx,cx
- xor dx,dx
- int 33h ; Set pointer
- mov ax,0002h
- int 33h ; Enable mouse cursor
- ; mov ax,000Fh
- ; mov cx,0
- ; mov dx,1
- ; int 33h ; Enable mouse cursor
- mov ax,0008h
- mov cx,0
- mov dx,0C7h
- int 33h ; Enable mouse cursor
- mov ax,000Ch
- mov cx,0001h
- mov dx,offset handler
- int 33h
- xor ax,ax
- mov ds,ax
- les ax,ds:[33h*4]
- mov cs:int33_off,ax
- mov cs:int33_seg,es
- mov ds: word ptr [33h*4],offset int33
- mov ds: word ptr [33h*4+2],cs
- mov dx,offset init
- int 27h
- ms_cikl: mov ax,0003h
- int 33h
- test bx,1
- jz ms_cikl
- done: mov ax,0002h
- int 33h ; Hide mouse cursor
- mov ax,000Ch
- mov cx,0000h
- mov dx,offset handler
- int 33h
- int 20h
- ;──────────────────────────────────────────────────────────────────────────
- copy_mess db "VMOUSE Multiware Ver 0.1. V.V.Volynsky,...",13,10,'$'
- ; ^
- ; │
- ; Cóoe ¿¼∩ Bδ ¼oªeΓe ó»¿caΓ∞ cεña ────┘
- code ends
- end start