; MyMouse, Driver processing, Copr. 1993,94 Matthias K”ppe

		INCLUDE	mymodef.asm

		PUBLIC	DrvMouseArea, DrvMousePos, \
			ChangeSense, RestoreSense, \
			SetSensitivity, GetSensitivity

CODE		SEGMENT BYTE PUBLIC

DrvMouseArea	PROC NEAR
		MOV	AX, 07h
		MOV	CX, MouseArea.A.x
		MOV	DX, MouseArea.B.x
		DEC	DX
		cmp	cx, dx
		jl	SHORT @@1
		mov	dx, cx
@@1:
		test	MouseMode, mmAltMul
		jz	SHORT @@4
		sal	cx, 3
		sal	dx, 3
@@4:
		INT	33h
		MOV	AX, 08h
		MOV	CX, MouseArea.A.y
		MOV	DX, MouseArea.B.y
		DEC	DX
		cmp	cx, dx
		jl	SHORT @@2
		mov	dx, cx
@@2:
		test	MouseMode, mmAltMul
		jz	SHORT @@3
		sal	cx, 3
		sal	dx, 3
@@3:
		INT	33h
		retn
DrvMouseArea	ENDP

DrvMousePos	PROC NEAR
		MOV	AX, 04H
		MOV	CX, MouseWhere.x
		MOV	DX, MouseWhere.y
		test	MouseMode, mmAltMul
		jz	SHORT @@2
		sal	cx, 3
		sal	dx, 3
@@2:
		INT	33h
		retn
DrvMousePos	ENDP

ChangeSense     PROC NEAR
		mov 	ax, 001Bh
		int	33h
		mov	SenseX, bx
		mov	SenseY, cx
		mov	DoubleSpeedTreshold, dx
		sal	bx, 3
		sal	cx, 3
		mov	ax, 001Ah
		int	33h
		retn
ChangeSense	ENDP

RestoreSense    PROC NEAR
		mov	bx, SenseX
		mov	cx, SenseY
		mov	dx, DoubleSpeedTreshold
		mov	ax, 001Ah
		int	33h
		ret
RestoreSense	ENDP

SetSensitivity	PROC FAR
		ARG	sy: WORD, sx: WORD = ArgSize
		push	bp
		mov	bp, sp
		mov	dx, DoubleSpeedTreshold
		mov	bx, sx
		mov	cx, sy
		mov	ax, 001Ah
		int	33h
		leave
		ret	ArgSize
SetSensitivity	ENDP

GetSensitivity	PROC FAR
		ARG	sy: DWORD, sx: DWORD = ArgSize
		push	bp
		mov	bp, sp
		mov	ax, 001Bh
		int	33h
		les	di, sx
		mov	es:[di], bx
		les	di, sy
		mov	es:[di], cx
		leave
		retf	ArgSize
GetSensitivity	ENDP

CODE		ENDS

		END
