support for new ATI chips

git-svn-id: svn://kolibrios.org@630 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2007-09-20 11:19:03 +00:00
parent 84bce0d4d8
commit 0313ceaa28
5 changed files with 328 additions and 101 deletions

View File

@ -55,6 +55,7 @@ iglobal
szClearEvent db 'ClearEvent',0 szClearEvent db 'ClearEvent',0
szLoadCursor db 'LoadCursor',0 szLoadCursor db 'LoadCursor',0
szSelectHwCursor db 'SelectHwCursor',0
szSetHwCursor db 'SetHwCursor',0 szSetHwCursor db 'SetHwCursor',0
szHwCursorRestore db 'HwCursorRestore', 0 szHwCursorRestore db 'HwCursorRestore', 0
szHwCursorCreate db 'HwCursorCreate', 0 szHwCursorCreate db 'HwCursorCreate', 0
@ -121,8 +122,9 @@ kernel_export:
dd szClearEvent , clear_event dd szClearEvent , clear_event
dd szLoadCursor , load_cursor dd szLoadCursor , load_cursor
dd szSetHwCursor , set_hw_cursor dd szSelectHwCursor , select_hw_cursor ;indirect
dd szHwCursorRestore , hw_restore dd szSetHwCursor , set_hw_cursor ;indirect
dd szHwCursorRestore , hw_restore ;indirect
dd szHwCursorCreate , create_cursor dd szHwCursorCreate , create_cursor
dd szSysMsgBoardStr , sys_msg_board_str dd szSysMsgBoardStr , sys_msg_board_str

View File

@ -284,10 +284,12 @@ scr_width rd 1
scr_height rd 1 scr_height rd 1
create_cursor rd 1 create_cursor rd 1
select_hw_cursor rd 1
set_hw_cursor rd 1 set_hw_cursor rd 1
hw_restore rd 1 hw_restore rd 1
def_cursor rd 1 def_cursor rd 1
current_cursor rd 1
hw_cursor rd 1 hw_cursor rd 1
cur_def_interl rd 1 cur_def_interl rd 1
cur_saved_base rd 1 cur_saved_base rd 1

View File

@ -14,6 +14,8 @@ API_VERSION equ 0x01000100
DEBUG equ 1 DEBUG equ 1
STRIDE equ 8
VID_ATI equ 0x1002 VID_ATI equ 0x1002
LOAD_FROM_FILE equ 0 LOAD_FROM_FILE equ 0
@ -60,22 +62,9 @@ end virtual
CURSOR_SIZE equ 32 CURSOR_SIZE equ 32
R8500 equ 0x514C ;R200
R9000 equ 0x4966 ;RV250
R9200 equ 0x5961 ;RV280
R9200SE equ 0x5964 ;RV280
R9500 equ 0x4144 ;R300
R9500P equ 0x4E45 ;R300
R9550 equ 0x4153 ;RV350
R9600 equ 0x4150 ;RV350
R9600XT equ 0x4152 ;RV360
R9700P equ 0x4E44 ;R300
R9800 equ 0x4E49 ;R350
R9800P equ 0x4E48 ;R350
R9800XT equ 0x4E4A ;R360
OS_BASE equ 0x80000000 OS_BASE equ 0x80000000
SLOT_BASE equ (OS_BASE+0x0080000) SLOT_BASE equ (OS_BASE+0x0080000)
LFB_BASE equ 0xFE000000
PG_SW equ 0x003 PG_SW equ 0x003
PG_NOCACHE equ 0x018 PG_NOCACHE equ 0x018
@ -94,16 +83,19 @@ virtual at 0
end virtual end virtual
;MMIO equ 0F9000000h ;MMIO equ 0F9000000h
RD_RB3D_CNTL equ 1c3ch RD_RB3D_CNTL equ 1c3ch
RD_MEM_CNTL equ 0140h RD_MEM_CNTL equ 0140h
RD_CRTC_GEN_CNTL equ 0050h RD_CRTC_GEN_CNTL equ 0050h
RD_CRTC_CUR_EN equ 10000h RD_CRTC_CUR_EN equ 10000h
RD_DISPLAY_BASE_ADDR equ 023ch RD_DISPLAY_BASE_ADDR equ 023ch
RD_DEFAULT_OFFSET equ 16e0h RD_DEFAULT_OFFSET equ 16e0h
CUR_HORZ_VERT_OFF equ 0268h CUR_HORZ_VERT_OFF equ 0268h
CUR_HORZ_VERT_POSN equ 0264h CUR_HORZ_VERT_POSN equ 0264h
CUR_OFFSET equ 0260h CUR_OFFSET equ 0260h
RD_RB3D_CNTL equ 1c3ch RD_RB3D_CNTL equ 1c3ch
RD_RBBM_STATUS equ 0e40h RD_RBBM_STATUS equ 0e40h
RD_RBBM_FIFOCNT_MASK equ 007fh RD_RBBM_FIFOCNT_MASK equ 007fh
@ -179,7 +171,7 @@ section '.flat' code readable align 16
proc START stdcall, state:dword proc START stdcall, state:dword
cmp [state], 1 cmp [state], 1
jne .exit jne .restore
if DEBUG if DEBUG
mov esi, msgInit mov esi, msgInit
@ -190,9 +182,17 @@ proc START stdcall, state:dword
test eax, eax test eax, eax
jz .fail jz .fail
call init_ati mov ebx, [SelectHwCursor]
test eax, eax mov ecx, [SetHwCursor]
jz .fail mov edx, [HwCursorRestore]
mov esi, [HwCursorCreate]
mov [oldSelect], ebx
mov [oldSet], ecx
mov [oldRestore], edx
mov [oldCreate], esi
call eax
or eax, -1 or eax, -1
mov [cursor_map], eax mov [cursor_map], eax
@ -204,21 +204,38 @@ proc START stdcall, state:dword
stdcall RegService, sz_ati_srv, service_proc stdcall RegService, sz_ati_srv, service_proc
test eax, eax test eax, eax
jz .fail jz .restore
mov dword [SetHwCursor], drvCursorPos ;enable hardware cursor
mov ebx, [fnSelect]
mov ecx, [fnSet]
mov [SelectHwCursor], ebx
mov [SetHwCursor], ecx
mov dword [HwCursorRestore], drv_restore mov dword [HwCursorRestore], drv_restore
mov dword [HwCursorCreate], ati_cursor mov dword [HwCursorCreate], ati_cursor
ret ret
.restore:
mov eax, [oldSelect]
mov ebx, [oldSet]
mov ecx, [oldRestore]
mov edx, [oldCreate]
mov [SelectHwCursor], eax
mov [SetHwCursor], ebx
mov [HwCursorRestore], ecx
mov [HwCursorCreate], edx
xor eax, eax
ret
.fail: .fail:
if DEBUG if DEBUG
mov esi, msgFail mov esi, msgFail
call SysMsgBoardStr call SysMsgBoardStr
end if end if
.exit:
xor eax, eax xor eax, eax
; mov ebx, SetHwCursor
; mov dword [ebx], eax ;force disable hardware cursor
ret ret
endp endp
@ -286,9 +303,8 @@ proc detect_ati
cmp eax, ebx cmp eax, ebx
je .found je .found
add edi, 4 add edi, STRIDE
jmp @B jmp @B
.next: .next:
inc [devfn] inc [devfn]
cmp [devfn], 256 cmp [devfn], 256
@ -301,8 +317,7 @@ proc detect_ati
xor eax, eax xor eax, eax
ret ret
.found: .found:
xor eax, eax mov eax, [edi+4]
inc eax
ret ret
.err: .err:
xor eax, eax xor eax, eax
@ -310,7 +325,7 @@ proc detect_ati
endp endp
align 4 align 4
proc init_ati proc init_r200
stdcall AllocKernelSpace, dword 0x10000 stdcall AllocKernelSpace, dword 0x10000
test eax, eax test eax, eax
@ -346,19 +361,105 @@ proc init_ati
or eax, ebx or eax, ebx
mov [edi+0x50], eax mov [edi+0x50], eax
call drvShowCursor call r200_ShowCursor
mov [fnSelect], r200_SelectCursor
mov [fnSet], r200_SetCursor
xor eax, eax xor eax, eax
inc eax inc eax
.fail: .fail:
ret ret
endp endp
align 4
proc init_r500
stdcall AllocKernelSpace, dword 0x10000
test eax, eax
jz .fail
mov [ati_io], eax
stdcall PciRead32, [bus], [devfn], dword 0x18
and eax, 0xFFFF0000
mov esi, eax
mov edi, [ati_io]
mov edx, 16
@@:
stdcall MapPage,edi,esi,PG_SW+PG_NOCACHE
add edi, 0x1000
add esi, 0x1000
dec edx
jnz @B
mov [fnSelect], r500_SelectCursor
mov [fnSet], r500_SetCursor
rdr eax, 0x6110
mov [r500_LFB], eax
wrr 0x6410, 0x001F001F
wrr 0x6400, dword (3 shl 8)
xor eax, eax
inc eax
.fail:
ret
endp
align 4 align 4
drv_restore: drv_restore:
ret 8 ret 8
align 4 align 4
drvShowCursor: proc r500_SelectCursor stdcall,hcursor:dword
mov esi, [hcursor]
mov edx, [esi+CURSOR.base]
sub edx, LFB_BASE
add edx, [r500_LFB]
wrr 0x6408, edx
mov eax, [esi+CURSOR.hot_x]
shl eax, 16
mov ax, word [esi+CURSOR.hot_y]
wrr 0x6418, eax
ret
endp
align 4
proc r500_SetCursor stdcall, hcursor:dword, x:dword, y:dword
pushfd
cli
mov esi, [hcursor]
mov edi, [ati_io]
mov eax, [x]
shl eax, 16
mov ax, word [y]
mov [edi+0x6414], eax
or dword [edi+0x6400], 1
popfd
ret
endp
align 4
r500_ShowCursor:
mov edi, [ati_io]
or dword [edi+0x6400], 1
ret
align 4
r200_ShowCursor:
mov edi, [ati_io] mov edi, [ati_io]
mov eax, [edi+RD_CRTC_GEN_CNTL] mov eax, [edi+RD_CRTC_GEN_CNTL]
@ -366,8 +467,15 @@ drvShowCursor:
mov [edi+RD_CRTC_GEN_CNTL], eax mov [edi+RD_CRTC_GEN_CNTL], eax
ret ret
align 4 align 4
proc drvCursorPos stdcall, hcursor:dword, x:dword, y:dword proc r200_SelectCursor stdcall,hcursor:dword
ret
endp
align 4
proc r200_SetCursor stdcall, hcursor:dword, x:dword, y:dword
pushfd pushfd
cli cli
@ -816,6 +924,7 @@ proc engFlush
ret ret
endp endp
align 4 align 4
engWaitForFifo: engWaitForFifo:
cnt equ bp+8 cnt equ bp+8
@ -858,6 +967,7 @@ proc engWaitForIdle
ret ret
endp endp
align 4 align 4
proc engRestore proc engRestore
@ -924,83 +1034,175 @@ proc engRestore
ret ret
endp endp
align 4
engSetupSolidFill:
push ebp
mov ebp, esp
push dword 3
call engWaitForFifo
wrr RD_DP_GUI_MASTER_CNTL, cmdSolidFill
mov eax, [ebp+8]
wrr RD_DP_BRUSH_FRGD_CLR,eax
mov edi, [ati_io]
mov dword [edi+RD_DP_CNTL],(RD_DST_X_LEFT_TO_RIGHT or RD_DST_Y_TOP_TO_BOTTOM)
leave
ret 4
align 4 align 4
drvSolidFill: dword2str:
;x:word,y:word,w:word,h:word,color:dword mov esi, hex_buff
push ebp mov ecx, -8
mov ebp, esp @@:
x equ ebp+8 rol eax, 4
y equ ebp+12 mov ebx, eax
w equ ebp+16 and ebx, 0x0F
h equ ebp+20 mov bl, [ebx+hexletters]
color equ ebp+24 mov [8+esi+ecx], bl
inc ecx
jnz @B
ret
push dword [ebp+24] hexletters db '0123456789ABCDEF'
call engSetupSolidFill hex_buff db 8 dup(0),13,10,0
push dword 2 R8500 equ 0x514C ;R200
call engWaitForFifo R9000 equ 0x4966 ;RV250
R9200 equ 0x5961 ;RV280
R9200SE equ 0x5964 ;RV280
R9500 equ 0x4144 ;R300
R9500P equ 0x4E45 ;R300
R9550 equ 0x4153 ;RV350
R9600 equ 0x4150 ;RV350
R9600XT equ 0x4152 ;RV360
R9700P equ 0x4E44 ;R300
R9800 equ 0x4E49 ;R350
R9800P equ 0x4E48 ;R350
R9800XT equ 0x4E4A ;R360
mov edi, [ati_io]
mov eax, [y]
mov ebx, [x]
shl eax,16
or eax, ebx
mov ecx, [w]
mov edx, [h]
shl ecx,16
or ecx, edx
mov [edi+RD_DST_Y_X], eax
mov [edi+RD_DST_WIDTH_HEIGHT], ecx
call engFlush
leave
ret 20
align 4 align 4
devices dd (R8500 shl 16)+VID_ATI
dd (R9000 shl 16)+VID_ATI devices dd (R8500 shl 16)+VID_ATI, init_r200
dd (R9200 shl 16)+VID_ATI dd (R9000 shl 16)+VID_ATI, init_r200
dd (R9200SE shl 16)+VID_ATI dd (R9200 shl 16)+VID_ATI, init_r200
dd (R9500 shl 16)+VID_ATI dd (R9200SE shl 16)+VID_ATI, init_r200
dd (R9500P shl 16)+VID_ATI dd (R9500 shl 16)+VID_ATI, init_r200
dd (R9550 shl 16)+VID_ATI dd (R9500P shl 16)+VID_ATI, init_r200
dd (R9600 shl 16)+VID_ATI dd (R9550 shl 16)+VID_ATI, init_r200
dd (R9600XT shl 16)+VID_ATI
dd (R9700P shl 16)+VID_ATI dd (R9600 shl 16)+VID_ATI, init_r200
dd (R9800 shl 16)+VID_ATI dd (R9600XT shl 16)+VID_ATI, init_r200
dd (R9800P shl 16)+VID_ATI dd (0x4155 shl 16)+VID_ATI, init_r200 ;RV350 9600
dd (R9800XT shl 16)+VID_ATI dd (0x4151 shl 16)+VID_ATI, init_r200 ;RV350 9600
dd (0x4E51 shl 16)+VID_ATI, init_r200 ;RV350 9600
dd (R9700P shl 16)+VID_ATI, init_r200
dd (0x4148 shl 16)+VID_ATI, init_r200 ;R350 9800
dd (R9800 shl 16)+VID_ATI, init_r200
dd (R9800P shl 16)+VID_ATI, init_r200
dd (R9800XT shl 16)+VID_ATI, init_r200
dd (0x5B60 shl 16)+VID_ATI, init_r200 ;RV370 X300/X550
dd (0x5B63 shl 16)+VID_ATI, init_r200 ;RV370 X550
dd (0x5B62 shl 16)+VID_ATI, init_r200 ;RV380x X600
dd (0x3E50 shl 16)+VID_ATI, init_r200 ;RV380 X600/X550
dd (0x5B4F shl 16)+VID_ATI, init_r200 ;RV410 X700
dd (0x5B4D shl 16)+VID_ATI, init_r200 ;RV410 X700
dd (0x5B4B shl 16)+VID_ATI, init_r200 ;RV410 X700
dd (0x5B4C shl 16)+VID_ATI, init_r200 ;RV410 X700
dd (0x4a49 shl 16)+VID_ATI, init_r200 ;R420 X800 PRO/GTO
dd (0x4a4B shl 16)+VID_ATI, init_r200 ;R420 X800
dd (0x5549 shl 16)+VID_ATI, init_r200 ;R423 X800
dd (0x4a4A shl 16)+VID_ATI, init_r200 ;R420 X800
dd (0x554F shl 16)+VID_ATI, init_r200 ;R430 X800
dd (0x554D shl 16)+VID_ATI, init_r200 ;R430 X800
dd (0x554E shl 16)+VID_ATI, init_r200 ;R430 X800
dd (0x5D57 shl 16)+VID_ATI, init_r200 ;R423 X800 XT
dd (0x4A50 shl 16)+VID_ATI, init_r200 ;R420 X800 XT
dd (0x554A shl 16)+VID_ATI, init_r200 ;R423 X800 XT
dd (0x5D4F shl 16)+VID_ATI, init_r200 ;R423 X800/X850
dd (0x554B shl 16)+VID_ATI, init_r200 ;R423 X800 GT
dd (0x4B4B shl 16)+VID_ATI, init_r200 ;R481 X850
dd (0x4B49 shl 16)+VID_ATI, init_r200 ;R481 X850
dd (0x4B4C shl 16)+VID_ATI, init_r200 ;R481 X850
dd (0x5D4D shl 16)+VID_ATI, init_r200 ;R480 X850
dd (0x5D52 shl 16)+VID_ATI, init_r200 ;R480 X850
dd (0x791E shl 16)+VID_ATI, init_r500 ;RS690 X1200
dd (0x7140 shl 16)+VID_ATI, init_r500 ;RV515 X1300
dd (0x7142 shl 16)+VID_ATI, init_r500 ;RV515 X1300
dd (0x7146 shl 16)+VID_ATI, init_r500 ;RV515 X1300
dd (0x714D shl 16)+VID_ATI, init_r500 ;RV515 X1300
dd (0x714E shl 16)+VID_ATI, init_r500 ;RV515 X1300
dd (0x7183 shl 16)+VID_ATI, init_r500 ;RV515 X1300
dd (0x7187 shl 16)+VID_ATI, init_r500 ;RV515 X1300
dd (0x718F shl 16)+VID_ATI, init_r500 ;RV515 X1300
dd (0x7143 shl 16)+VID_ATI, init_r500 ;RV515 X1550
dd (0x7147 shl 16)+VID_ATI, init_r500 ;RV515 X1550
dd (0x715F shl 16)+VID_ATI, init_r500 ;RV515 X1550
dd (0x7193 shl 16)+VID_ATI, init_r500 ;RV515 X1550
dd (0x719F shl 16)+VID_ATI, init_r500 ;RV515 X1550
dd (0x71C0 shl 16)+VID_ATI, init_r500 ;RV530 X1600
dd (0x71C1 shl 16)+VID_ATI, init_r500 ;RV535 X1650
dd (0x71C2 shl 16)+VID_ATI, init_r500 ;RV530 X1600
dd (0x71C3 shl 16)+VID_ATI, init_r500 ;RV535 X1600
dd (0x71C6 shl 16)+VID_ATI, init_r500 ;RV530 X1600
dd (0x71C7 shl 16)+VID_ATI, init_r500 ;RV534 X1650
dd (0x7181 shl 16)+VID_ATI, init_r500 ;RV515 X1600
dd (0x71CD shl 16)+VID_ATI, init_r500 ;RV530 X1600
dd (0x7291 shl 16)+VID_ATI, init_r500 ;R580 X1650
dd (0x7293 shl 16)+VID_ATI, init_r500 ;R580 X1650
dd (0x7100 shl 16)+VID_ATI, init_r500 ;RV520 X1800
dd (0x7109 shl 16)+VID_ATI, init_r500 ;RV520 X1800
dd (0x710A shl 16)+VID_ATI, init_r500 ;RV520 X1800 GTO
dd (0x7249 shl 16)+VID_ATI, init_r500 ;RV580 X1900
dd (0x724B shl 16)+VID_ATI, init_r500 ;RV580 X1900 GT
dd (0x7240 shl 16)+VID_ATI, init_r500 ;RV580 X1950
dd (0x7244 shl 16)+VID_ATI, init_r500 ;RV580 X1950
dd (0x7248 shl 16)+VID_ATI, init_r500 ;RV580 X1950
dd (0x7288 shl 16)+VID_ATI, init_r500 ;R580 X1950 GT
dd (0x7280 shl 16)+VID_ATI, init_r500 ;R580 X1950 PRO
dd (0x94C3 shl 16)+VID_ATI, init_r500 ;RV610 HD 2400 PRO
dd (0x94C1 shl 16)+VID_ATI, init_r500 ;RV610 HD 2400 XT
dd (0x9589 shl 16)+VID_ATI, init_r500 ;RV630 HD 2600 PRO
dd (0x958A shl 16)+VID_ATI, init_r500 ;RV630 HD 2600 X2
dd (0x9588 shl 16)+VID_ATI, init_r500 ;RV630 HD 2600 XT
dd (0x9403 shl 16)+VID_ATI, init_r500 ;R600 HD 2900 PRO
dd (0x9409 shl 16)+VID_ATI, init_r500 ;R600 HD 2900 XT
dd 0 ;terminator dd 0 ;terminator
version dd (5 shl 16) or (API_VERSION and 0xFFFF) version dd (5 shl 16) or (API_VERSION and 0xFFFF)
sz_ati_srv db 'HWCURSOR',0 sz_ati_srv db 'HWCURSOR',0
msgInit db 'detect hardware...',13,10,0 msgInit db 'detect hardware...',13,10,0
msgPCI db 'PCI accsess not supported',13,10,0 msgPCI db 'PCI accsess not supported',13,10,0
msgFail db 'device not found',13,10,0 msgFail db 'device not found',13,10,0
msg_neg db 'neg ecx',13,10,0 msg_neg db 'neg ecx',13,10,0
if 0
msg6100 db '6100: ',0
msg6104 db '6104: ',0
msg6108 db '6108: ',0
msg6110 db '6110: ',0
msg6120 db '6120: ',0
msg6124 db '6124: ',0
msg6128 db '6128: ',0
msg612C db '612C: ',0
msg6130 db '6130: ',0
msg6134 db '6134: ',0
msg6138 db '6138: ',0
end if
buff db 8 dup(0) buff db 8 dup(0)
db 13,10, 0 db 13,10, 0
@ -1012,6 +1214,15 @@ cursor_map rd 2
cursor_start rd 1 cursor_start rd 1
cursor_end rd 1 cursor_end rd 1
fnSelect rd 1
fnSet rd 1
oldSelect rd 1
oldSet rd 1
oldRestore rd 1
oldCreate rd 1
r500_LFB rd 1
bus dd ? bus dd ?
devfn dd ? devfn dd ?
ati_io dd ? ati_io dd ?

View File

@ -126,6 +126,10 @@ end if
if used LoadCursor if used LoadCursor
extrn LoadCursor extrn LoadCursor
end if end if
if used SelectHwCursor
extrn SelectHwCursor
end if
if used SetHwCursor if used SetHwCursor
extrn SetHwCursor extrn SetHwCursor
end if end if

View File

@ -98,7 +98,7 @@ mres:
save_draw_mouse: save_draw_mouse:
cmp [set_hw_cursor], 0 cmp [set_hw_cursor], 0
jz @F jz .no_hw_cursor
pushad pushad
mov [X_UNDER],ax mov [X_UNDER],ax
@ -116,23 +116,31 @@ save_draw_mouse:
shl edx, 8 shl edx, 8
mov ecx, [edx+SLOT_BASE+APPDATA.cursor] mov ecx, [edx+SLOT_BASE+APPDATA.cursor]
cmp ecx, [current_cursor]
je .draw
cmp [ecx+CURSOR.magic], 'CURS' cmp [ecx+CURSOR.magic], 'CURS'
jne .fail jne .fail
push ecx
call [select_hw_cursor]
mov [current_cursor], ecx
; cmp [ecx+CURSOR.size], CURSOR_SIZE ; cmp [ecx+CURSOR.size], CURSOR_SIZE
; jne .fail ; jne .fail
push ecx
call [set_hw_cursor] .draw:
stdcall [set_hw_cursor], ecx
popad popad
ret ret
.fail: .fail:
mov ecx, [def_cursor] mov ecx, [def_cursor]
mov [edx+SLOT_BASE+APPDATA.cursor], ecx mov [edx+SLOT_BASE+APPDATA.cursor], ecx
push ecx stdcall [set_hw_cursor], ecx
call [set_hw_cursor]
popad popad
ret ret
@@: .no_hw_cursor:
pushad pushad
; save & draw ; save & draw
mov [X_UNDER],ax mov [X_UNDER],ax
@ -391,7 +399,7 @@ nodmp:
ret ret
proc set_mouse_data stdcall, BtnState:dword, XMoving:dword, YMoving:dword, VScroll:dword, HScroll:dword proc set_mouse_data stdcall, BtnState:dword, XMoving:dword, YMoving:dword, VScroll:dword, HScroll:dword
mov eax,[BtnState] mov eax,[BtnState]
mov [BTN_DOWN],eax mov [BTN_DOWN],eax
@ -429,7 +437,7 @@ proc set_mouse_data stdcall, BtnState:dword, XMoving:dword, YMoving:dword, VScro
mov eax,[VScroll] mov eax,[VScroll]
add [MOUSE_SCROLL_V],ax add [MOUSE_SCROLL_V],ax
mov eax,[HScroll] mov eax,[HScroll]
add [MOUSE_SCROLL_H],ax add [MOUSE_SCROLL_H],ax