2010-10-01 13:21:55 +04:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; Includes source code by Kulakov Vladimir Gennadievich. ;;
;; Modified by Mario79 and Rus. ;;
2012-03-08 12:33:38 +04:00
;; 02.12.2009 <Lrz> ;;
2010-10-01 13:21:55 +04:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;driver sceletone
format MS COFF
DEBUG equ 0
include 'proc32.inc'
include 'imports.inc'
2012-03-08 12:33:38 +04:00
API_VERSION equ 5 ;debug
2010-10-01 13:21:55 +04:00
struc IOCTL
2012-03-08 12:33:38 +04:00
{ .handle dd ?
.io_code dd ?
.input dd ?
.inp_size dd ?
.output dd ?
.out_size dd ?
2010-10-01 13:21:55 +04:00
}
virtual at 0
IOCTL IOCTL
end virtual
public START
public version
DRV_ENTRY equ 1
DRV_EXIT equ - 1
2012-03-08 12:33:38 +04:00
STRIDE equ 4 ;size of row in devices table
2010-10-01 13:21:55 +04:00
2012-03-08 12:33:38 +04:00
SRV_GETVERSION equ 0
2010-10-01 13:21:55 +04:00
section '.flat' code readable al ign 16
proc START stdcall , state : dword
2012-03-08 12:33:38 +04:00
cmp [ state ], 1
jne .exit
2010-10-01 13:21:55 +04:00
.entry:
2012-03-08 12:33:38 +04:00
;Detect_COM_Mouse:
2010-10-01 13:21:55 +04:00
if DEBUG
2012-03-08 12:33:38 +04:00
mov esi , msgInit
call Boot_Log
2010-10-01 13:21:55 +04:00
end if
2012-03-08 12:33:38 +04:00
mov bx , 0x3f8
call MSMouseSearch
cmp AL , 'M'
jne @ f
;mov [com1_mouse_detected],1
;mov [irq_owner+4*4], 1 ; IRQ4 owner is System
mov dx , bx
inc dx ; 0x3f8 + 1
mov al , 1
out dx , al
stdcall AttachIntHandler , 4 , irq4_handler , dword 0
2010-10-01 13:21:55 +04:00
if DEBUG
2012-03-08 12:33:38 +04:00
test eax , eax
jne .label1
2010-10-01 13:21:55 +04:00
2012-03-08 12:33:38 +04:00
mov esi , msg_error_attach_int_handler
call Boot_Log
2010-10-01 13:21:55 +04:00
end if
.label1:
2012-03-08 12:33:38 +04:00
; mov eax, 0
; mov ebx, 0x3F8
; mov ecx, 0x3FF
xor ebx , ebx
mov ecx , 0x3F8
mov edx , 0x3FF
call ReservePortArea
2010-10-01 13:21:55 +04:00
if DEBUG
2012-03-08 12:33:38 +04:00
cmp eax , 1
jne .go
2010-10-01 13:21:55 +04:00
2012-03-08 12:33:38 +04:00
mov esi , msg_error_reserve_ports
call Boot_Log
2010-10-01 13:21:55 +04:00
.go:
2012-03-08 12:33:38 +04:00
mov esi , boot_setmouse_type
call Boot_Log
2010-10-01 13:21:55 +04:00
end if
@ @ :
2012-03-08 12:33:38 +04:00
mov bx , 0x2f8
call MSMouseSearch
cmp AL , 'M'
jne .resume
;mov [com2_mouse_detected],1
;mov [irq_owner+3*4], 1 ; IRQ3 owner is System
stdcall AttachIntHandler , 3 , irq3_handler , dword 0
; mov eax, 0
; mov ebx, 0x2F8
; mov ecx, 0x3F8
xor ebx , ebx
mov ecx , 0x2F8
mov edx , 0x3F8
call ReservePortArea
2010-10-01 13:21:55 +04:00
if DEBUG
2012-03-08 12:33:38 +04:00
cmp eax , 1
jne @ f
2010-10-01 13:21:55 +04:00
2012-03-08 12:33:38 +04:00
mov esi , msg_error_reserve_ports
call Boot_Log
2010-10-01 13:21:55 +04:00
@ @ :
2012-03-08 12:33:38 +04:00
mov esi , boot_setmouse_type + 22
call Boot_Log
2010-10-01 13:21:55 +04:00
end if
.resume:
2012-03-08 12:33:38 +04:00
stdcall RegService , my_service , service_proc
2010-10-01 13:21:55 +04:00
if DEBUG
2012-03-08 12:33:38 +04:00
test eax , eax
jne @ f
2010-10-01 13:21:55 +04:00
2012-03-08 12:33:38 +04:00
mov esi , msg_exit
call Boot_Log
2010-10-01 13:21:55 +04:00
end if
2012-03-08 12:33:38 +04:00
@ @ :
ret
2010-10-01 13:21:55 +04:00
.fail:
.exit:
if DEBUG
2012-03-08 12:33:38 +04:00
mov esi , msg_exit
call Boot_Log
2010-10-01 13:21:55 +04:00
end if
2012-03-08 12:33:38 +04:00
xor eax , eax
ret
2010-10-01 13:21:55 +04:00
endp
2012-03-08 12:33:38 +04:00
handle equ IOCTL.handle
io_code equ IOCTL.io_code
input equ IOCTL.input
inp_size equ IOCTL.inp_size
output equ IOCTL.output
out_size equ IOCTL.out_size
2010-10-01 13:21:55 +04:00
align 4
proc service_proc stdcall , ioctl : dword
2012-03-08 12:33:38 +04:00
mov ebx , [ ioctl ]
mov eax , [ ebx + io_code ]
cmp eax , SRV_GETVERSION
jne @ F
mov eax , [ ebx + output ]
cmp [ ebx + out_size ], 4
jne .fail
mov [ eax ], dword API_VERSION
xor eax , eax
ret
2010-10-01 13:21:55 +04:00
@ @ :
.fail:
2012-03-08 12:33:38 +04:00
or eax , - 1
ret
2010-10-01 13:21:55 +04:00
endp
align 4
MSMouseSearch:
2012-03-08 12:33:38 +04:00
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> COM-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD>
2010-10-01 13:21:55 +04:00
MouseSearch:
2012-03-08 12:33:38 +04:00
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> /<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1200 <20> <> <EFBFBD>
; in bx COM Port Base Address
mov DX , bx
add DX , 3
in AL , DX
or AL , 80h ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> DLAB
out DX , AL
mov DX , bx
mov AL , 60h ;1200 <20> <> <EFBFBD>
out DX , AL
inc DX
mov AL , 0
out DX , AL
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 7 <20> <> <EFBFBD> , 1 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> ,
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
mov DX , bx
add DX , 3
mov AL , 00000010b
out DX , AL
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
mov dx , bx
inc dx
mov AL , 0
out DX , AL
2010-10-01 13:21:55 +04:00
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> MSMouse
2012-03-08 12:33:38 +04:00
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
mov DX , bx
add EDX , 4 ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
mov AL , 0 ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> DTR, RTS <20> OUT2
out DX , AL
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 5 "<22> <> <EFBFBD> <EFBFBD> <EFBFBD> " (0,2 <20> )
mov ecx , 0xFFFF
loop $
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
mov al , 1
out dx , al
mov ecx , 0xFFFF
loop $
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
mov dx , bx
in AL , DX
add edx , 4
mov AL , 1011b ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> DTR <20> RTS <20> OUT2
out DX , AL
mov ecx , 0x1FFFF
2010-10-01 13:21:55 +04:00
; <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
WaitData:
2012-03-08 12:33:38 +04:00
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> 10 "<22> <> <EFBFBD> <EFBFBD> <EFBFBD> "
dec ecx
; cmp ecx,0
jz NoMouse
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
mov DX , bx
add DX , 5
in AL , DX
test AL , 1 ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ?
jz WaitData
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
mov DX , bx
in AL , DX
2010-10-01 13:21:55 +04:00
NoMouse:
2012-03-08 12:33:38 +04:00
ret
2010-10-01 13:21:55 +04:00
align 4
irq3_handler:
2012-03-08 12:33:38 +04:00
mov dx , 0x2f8
mov esi , com2_mouse
jmp irq_handler
2010-10-01 13:21:55 +04:00
align 4
irq4_handler:
2012-03-08 12:33:38 +04:00
mov dx , 0x3f8
mov esi , com1_mouse
2010-10-01 13:21:55 +04:00
irq_handler:
; in: esi -> COM_MOUSE_DATA struc, dx = base port (xF8h)
2012-03-08 12:33:38 +04:00
add edx , 5 ; xFDh
in al , dx
test al , 1 ; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ?
jz .Error
2010-10-01 13:21:55 +04:00
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2012-03-08 12:33:38 +04:00
sub edx , 5
in al , dx
2010-10-01 13:21:55 +04:00
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD>
2012-03-08 12:33:38 +04:00
and al , 01111111b
2010-10-01 13:21:55 +04:00
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
2012-03-08 12:33:38 +04:00
cmp [ esi + COM_MOUSE_DATA.MouseByteNumber ], 2
ja .Error
jz .ThirdByte
jp .SecondByte
2010-10-01 13:21:55 +04:00
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
.FirstByte:
2012-03-08 12:33:38 +04:00
test al , 1000000b ; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ?
jz .Error
mov [ esi + COM_MOUSE_DATA.FirstByte ], al
inc [ esi + COM_MOUSE_DATA.MouseByteNumber ]
jmp .EndMouseInterrupt
2010-10-01 13:21:55 +04:00
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
.SecondByte:
2012-03-08 12:33:38 +04:00
test al , 1000000b
jnz .Error
mov [ esi + COM_MOUSE_DATA.SecondByte ], al
inc [ esi + COM_MOUSE_DATA.MouseByteNumber ]
jmp .EndMouseInterrupt
2010-10-01 13:21:55 +04:00
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
.ThirdByte:
2012-03-08 12:33:38 +04:00
test al , 1000000b
jnz .Error
mov [ esi + COM_MOUSE_DATA.ThirdByte ], al
mov [ esi + COM_MOUSE_DATA.MouseByteNumber ], 0
2010-10-01 13:21:55 +04:00
; (<28> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ).
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
2012-03-08 12:33:38 +04:00
mov al , [ esi + COM_MOUSE_DATA.FirstByte ]
mov ah , al
shr al , 3
and al , 2
shr ah , 5
and ah , 1
add al , ah
movzx eax , al
mov [ BTN_DOWN ], eax
2010-10-01 13:21:55 +04:00
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> X <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> X
2012-03-08 12:33:38 +04:00
mov al , [ esi + COM_MOUSE_DATA.FirstByte ]
shl al , 6
or al , [ esi + COM_MOUSE_DATA.SecondByte ]
2010-10-01 13:21:55 +04:00
2012-03-08 12:33:38 +04:00
cbw
movzx eax , ax
mov [ MOUSE_X ], eax
2010-10-01 13:21:55 +04:00
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> Y <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Y
2012-03-08 12:33:38 +04:00
mov al , [ esi + COM_MOUSE_DATA.FirstByte ]
and al , 00001100b
shl al , 4
or al , [ esi + COM_MOUSE_DATA.ThirdByte ]
2010-10-01 13:21:55 +04:00
2012-03-08 12:33:38 +04:00
cbw
movzx eax , ax
neg eax
mov [ MOUSE_Y ], eax
2010-10-01 13:21:55 +04:00
2012-03-08 12:33:38 +04:00
stdcall SetMouseData , [ BTN_DOWN ], [ MOUSE_X ], [ MOUSE_Y ], 0 , 0
2010-10-01 13:21:55 +04:00
2012-03-08 12:33:38 +04:00
jmp .EndMouseInterrupt
2010-10-01 13:21:55 +04:00
.Error:
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <>
; <20> <> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2012-03-08 12:33:38 +04:00
mov [ esi + COM_MOUSE_DATA.MouseByteNumber ], 0
2010-10-01 13:21:55 +04:00
.EndMouseInterrupt:
2012-03-08 12:33:38 +04:00
mov al , 1
ret
2010-10-01 13:21:55 +04:00
;all initialized data place here
align 4
struc COM_MOUSE_DATA {
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
2012-03-08 12:33:38 +04:00
.MouseByteNumber db ?
2010-10-01 13:21:55 +04:00
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
2012-03-08 12:33:38 +04:00
.FirstByte db ?
.SecondByte db ?
.ThirdByte db ?
;.timer_ticks_com dd ?
2010-10-01 13:21:55 +04:00
}
virtual at 0
COM_MOUSE_DATA COM_MOUSE_DATA
end virtual
com1_mouse COM_MOUSE_DATA
com2_mouse COM_MOUSE_DATA
MOUSE_X dd 0
MOUSE_Y dd 0
BTN_DOWN dd 0
COMPortBaseAddr dw 3F8h
version dd ( 5 shl 16 ) or ( API_VERSION and 0xFFFF )
my_service db 'COM_Mouse' , 0 ;max 16 chars include zero
if DEBUG
2012-03-08 12:33:38 +04:00
msgInit db 'Preved bugoga!' , 13 , 10 , 0
boot_setmouse_type db 'Detected - COM1 mouse' , 13 , 10 , 0
db 'Detected - COM2 mouse' , 13 , 10 , 0
2010-10-01 13:21:55 +04:00
msg_error_reserve_ports db 'Error reserving ports!' , 13 , 10 , 0
msg_error_attach_int_handler db 'Error attach interrupt handler!' , 13 , 10 , 0
2012-03-08 12:33:38 +04:00
msg_exit db 'Exit!' , 13 , 10 , 0
2010-10-01 13:21:55 +04:00
end if
section '.data' data readable writable al ign 16
;all uninitialized data place here