forked from KolibriOS/kolibrios
VESA putimage speedup +30% above the r.2430
git-svn-id: svn://kolibrios.org@2435 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
c856b49825
commit
e89bf78ced
@ -1926,21 +1926,7 @@ sys_end:
|
|||||||
; restore default cursor before killing
|
; restore default cursor before killing
|
||||||
pusha
|
pusha
|
||||||
mov ecx, [current_slot]
|
mov ecx, [current_slot]
|
||||||
mov eax, [def_cursor]
|
call restore_default_cursor_before_killing
|
||||||
mov [ecx+APPDATA.cursor], eax
|
|
||||||
|
|
||||||
movzx eax, word [MOUSE_Y]
|
|
||||||
movzx ebx, word [MOUSE_X]
|
|
||||||
mov ecx, [Screen_Max_X]
|
|
||||||
inc ecx
|
|
||||||
mul ecx
|
|
||||||
add eax, [_WinMapAddress]
|
|
||||||
movzx edx, byte [ebx+eax]
|
|
||||||
shl edx, 8
|
|
||||||
mov esi, [edx+SLOT_BASE+APPDATA.cursor]
|
|
||||||
push esi
|
|
||||||
call [_display.select_cursor]
|
|
||||||
mov [current_cursor], esi
|
|
||||||
popa
|
popa
|
||||||
@@:
|
@@:
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
@ -1959,7 +1945,25 @@ sys_end:
|
|||||||
mov ebx, 100
|
mov ebx, 100
|
||||||
call delay_hs
|
call delay_hs
|
||||||
jmp waitterm
|
jmp waitterm
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
|
restore_default_cursor_before_killing:
|
||||||
|
mov eax, [def_cursor]
|
||||||
|
mov [ecx+APPDATA.cursor], eax
|
||||||
|
|
||||||
|
movzx eax, word [MOUSE_Y]
|
||||||
|
movzx ebx, word [MOUSE_X]
|
||||||
|
mov ecx, [Screen_Max_X]
|
||||||
|
inc ecx
|
||||||
|
mul ecx
|
||||||
|
add eax, [_WinMapAddress]
|
||||||
|
movzx edx, byte [ebx+eax]
|
||||||
|
shl edx, 8
|
||||||
|
mov esi, [edx+SLOT_BASE+APPDATA.cursor]
|
||||||
|
push esi
|
||||||
|
call [_display.select_cursor]
|
||||||
|
mov [current_cursor], esi
|
||||||
|
ret
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
iglobal
|
iglobal
|
||||||
align 4
|
align 4
|
||||||
sys_system_table:
|
sys_system_table:
|
||||||
@ -2035,21 +2039,8 @@ sysfn_terminate: ; 18.2 = TERMINATE
|
|||||||
pusha
|
pusha
|
||||||
mov ecx, [esp+32]
|
mov ecx, [esp+32]
|
||||||
shl ecx, 8
|
shl ecx, 8
|
||||||
mov eax, [def_cursor]
|
add ecx, SLOT_BASE
|
||||||
mov [ecx+SLOT_BASE+APPDATA.cursor], eax
|
call restore_default_cursor_before_killing
|
||||||
|
|
||||||
movzx eax, word [MOUSE_Y]
|
|
||||||
movzx ebx, word [MOUSE_X]
|
|
||||||
mov ecx, [Screen_Max_X]
|
|
||||||
inc ecx
|
|
||||||
mul ecx
|
|
||||||
add eax, [_WinMapAddress]
|
|
||||||
movzx edx, byte [ebx+eax]
|
|
||||||
shl edx, 8
|
|
||||||
mov esi, [edx+SLOT_BASE+APPDATA.cursor]
|
|
||||||
push esi
|
|
||||||
call [_display.select_cursor]
|
|
||||||
mov [current_cursor], esi
|
|
||||||
popa
|
popa
|
||||||
@@:
|
@@:
|
||||||
add esp, 4
|
add esp, 4
|
||||||
|
@ -243,13 +243,15 @@ align 4
|
|||||||
mov ebx, [CURRENT_TASK]
|
mov ebx, [CURRENT_TASK]
|
||||||
cmp byte [ScreenBPP], 32
|
cmp byte [ScreenBPP], 32
|
||||||
je put_image_end_32
|
je put_image_end_32
|
||||||
;put_image_end_24:
|
;--------------------------------------
|
||||||
|
put_image_end_24:
|
||||||
mov edi, [putimg.real_sy]
|
mov edi, [putimg.real_sy]
|
||||||
|
cmp [_display.select_cursor], 0
|
||||||
|
jne put_image_end_24_new
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
align 4
|
align 4
|
||||||
.new_line:
|
.new_line:
|
||||||
mov ecx, [putimg.real_sx]
|
mov ecx, [putimg.real_sx]
|
||||||
; push ebp edx
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
align 4
|
align 4
|
||||||
.new_x:
|
.new_x:
|
||||||
@ -268,7 +270,7 @@ align 4
|
|||||||
sub ecx, edi
|
sub ecx, edi
|
||||||
|
|
||||||
; check mouse area for putpixel
|
; check mouse area for putpixel
|
||||||
call [_display.check_mouse]
|
call check_mouse_area_for_putpixel
|
||||||
pop ecx
|
pop ecx
|
||||||
; store to real LFB
|
; store to real LFB
|
||||||
mov [LFB_BASE+edx], ax
|
mov [LFB_BASE+edx], ax
|
||||||
@ -277,16 +279,15 @@ align 4
|
|||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
align 4
|
align 4
|
||||||
.skip:
|
.skip:
|
||||||
; add esi, 3 ;[putimg.source_bpp]
|
|
||||||
add edx, 3
|
add edx, 3
|
||||||
inc ebp
|
inc ebp
|
||||||
dec ecx
|
dec ecx
|
||||||
jnz .new_x
|
jnz .new_x
|
||||||
; pop edx ebp
|
|
||||||
add esi, [putimg.line_increment]
|
add esi, [putimg.line_increment]
|
||||||
add edx, [putimg.screen_newline];[BytesPerScanLine]
|
add edx, [putimg.screen_newline];[BytesPerScanLine]
|
||||||
add ebp, [putimg.winmap_newline];[Screen_Max_X]
|
add ebp, [putimg.winmap_newline];[Screen_Max_X]
|
||||||
; inc ebp
|
|
||||||
cmp [putimg.ebp], putimage_get1bpp
|
cmp [putimg.ebp], putimage_get1bpp
|
||||||
jz .correct
|
jz .correct
|
||||||
cmp [putimg.ebp], putimage_get2bpp
|
cmp [putimg.ebp], putimage_get2bpp
|
||||||
@ -309,15 +310,93 @@ align 4
|
|||||||
add esp, putimg.stack_data
|
add esp, putimg.stack_data
|
||||||
popad
|
popad
|
||||||
ret
|
ret
|
||||||
;------------------------------------------------------------------------------
|
;--------------------------------------
|
||||||
align 4
|
align 4
|
||||||
put_image_end_32:
|
put_image_end_24_new:
|
||||||
mov edi, [putimg.real_sy]
|
;--------------------------------------
|
||||||
|
align 4
|
||||||
|
.new_line:
|
||||||
|
mov ecx, [putimg.real_sx]
|
||||||
|
;--------------------------------------
|
||||||
|
align 4
|
||||||
|
.new_x:
|
||||||
|
push [putimg.edi]
|
||||||
|
mov eax, [putimg.ebp+4]
|
||||||
|
call eax
|
||||||
|
cmp [ebp], bl
|
||||||
|
jne .skip
|
||||||
|
;--------------------------------------
|
||||||
|
push ecx
|
||||||
|
mov ecx, [putimg.real_sy_and_abs_cy + 4]
|
||||||
|
sub ecx, edi
|
||||||
|
;--------------------------------------
|
||||||
|
; check for Y
|
||||||
|
cmp cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||||
|
jb .no_mouse_area
|
||||||
|
|
||||||
|
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
|
||||||
|
jae .no_mouse_area
|
||||||
|
|
||||||
|
rol ecx, 16
|
||||||
|
add ecx, [putimg.real_sx_and_abs_cx + 4]
|
||||||
|
sub ecx, [esp]
|
||||||
|
;--------------------------------------
|
||||||
|
; check for X
|
||||||
|
cmp cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||||
|
jb .no_mouse_area
|
||||||
|
|
||||||
|
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||||
|
jae .no_mouse_area
|
||||||
|
;--------------------------------------
|
||||||
|
; check mouse area for putpixel
|
||||||
|
call check_mouse_area_for_putpixel_new.1
|
||||||
|
;--------------------------------------
|
||||||
|
align 4
|
||||||
|
.no_mouse_area:
|
||||||
|
pop ecx
|
||||||
|
; store to real LFB
|
||||||
|
mov [LFB_BASE+edx], ax
|
||||||
|
shr eax, 16
|
||||||
|
mov [LFB_BASE+edx+2], al
|
||||||
|
;--------------------------------------
|
||||||
|
align 4
|
||||||
|
.skip:
|
||||||
|
add edx, 3
|
||||||
|
inc ebp
|
||||||
|
dec ecx
|
||||||
|
jnz .new_x
|
||||||
|
|
||||||
|
add esi, [putimg.line_increment]
|
||||||
|
add edx, [putimg.screen_newline];[BytesPerScanLine]
|
||||||
|
add ebp, [putimg.winmap_newline];[Screen_Max_X]
|
||||||
|
|
||||||
|
cmp [putimg.ebp], putimage_get1bpp
|
||||||
|
jz .correct
|
||||||
|
cmp [putimg.ebp], putimage_get2bpp
|
||||||
|
jz .correct
|
||||||
|
cmp [putimg.ebp], putimage_get4bpp
|
||||||
|
jnz @f
|
||||||
|
;--------------------------------------
|
||||||
|
align 4
|
||||||
|
.correct:
|
||||||
|
mov eax, [putimg.edi]
|
||||||
|
mov byte [eax], 80h
|
||||||
|
;--------------------------------------
|
||||||
|
align 4
|
||||||
|
@@:
|
||||||
|
dec edi
|
||||||
|
jnz .new_line
|
||||||
|
jmp put_image_end_24.finish
|
||||||
|
;------------------------------------------------------------------------------
|
||||||
|
align 4
|
||||||
|
put_image_end_32:
|
||||||
|
mov edi, [putimg.real_sy]
|
||||||
|
cmp [_display.select_cursor], 0
|
||||||
|
jne put_image_end_32_new
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
align 4
|
align 4
|
||||||
.new_line:
|
.new_line:
|
||||||
mov ecx, [putimg.real_sx]
|
mov ecx, [putimg.real_sx]
|
||||||
; push ebp edx
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
align 4
|
align 4
|
||||||
.new_x:
|
.new_x:
|
||||||
@ -336,23 +415,22 @@ align 4
|
|||||||
sub ecx, edi
|
sub ecx, edi
|
||||||
|
|
||||||
; check mouse area for putpixel
|
; check mouse area for putpixel
|
||||||
call [_display.check_mouse]
|
call check_mouse_area_for_putpixel
|
||||||
pop ecx
|
pop ecx
|
||||||
; store to real LFB
|
; store to real LFB
|
||||||
mov [LFB_BASE+edx], eax
|
mov [LFB_BASE+edx], eax
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
align 4
|
align 4
|
||||||
.skip:
|
.skip:
|
||||||
; add esi, [putimg.source_bpp]
|
|
||||||
add edx, 4
|
add edx, 4
|
||||||
inc ebp
|
inc ebp
|
||||||
dec ecx
|
dec ecx
|
||||||
jnz .new_x
|
jnz .new_x
|
||||||
; pop edx ebp
|
|
||||||
add esi, [putimg.line_increment]
|
add esi, [putimg.line_increment]
|
||||||
add edx, [putimg.screen_newline];[BytesPerScanLine]
|
add edx, [putimg.screen_newline];[BytesPerScanLine]
|
||||||
add ebp, [putimg.winmap_newline];[Screen_Max_X]
|
add ebp, [putimg.winmap_newline];[Screen_Max_X]
|
||||||
; inc ebp
|
|
||||||
cmp [putimg.ebp], putimage_get1bpp
|
cmp [putimg.ebp], putimage_get1bpp
|
||||||
jz .correct
|
jz .correct
|
||||||
cmp [putimg.ebp], putimage_get2bpp
|
cmp [putimg.ebp], putimage_get2bpp
|
||||||
@ -377,6 +455,81 @@ align 4
|
|||||||
call VGA__putimage
|
call VGA__putimage
|
||||||
mov [EGA_counter], 1
|
mov [EGA_counter], 1
|
||||||
ret
|
ret
|
||||||
|
;--------------------------------------
|
||||||
|
align 4
|
||||||
|
put_image_end_32_new:
|
||||||
|
;--------------------------------------
|
||||||
|
align 4
|
||||||
|
.new_line:
|
||||||
|
mov ecx, [putimg.real_sx]
|
||||||
|
;--------------------------------------
|
||||||
|
align 4
|
||||||
|
.new_x:
|
||||||
|
push [putimg.edi]
|
||||||
|
mov eax, [putimg.ebp+4]
|
||||||
|
call eax
|
||||||
|
cmp [ebp], bl
|
||||||
|
jne .skip
|
||||||
|
;--------------------------------------
|
||||||
|
push ecx
|
||||||
|
mov ecx, [putimg.real_sy_and_abs_cy + 4]
|
||||||
|
sub ecx, edi
|
||||||
|
;--------------------------------------
|
||||||
|
; check for Y
|
||||||
|
cmp cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||||
|
jb .no_mouse_area
|
||||||
|
|
||||||
|
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
|
||||||
|
jae .no_mouse_area
|
||||||
|
|
||||||
|
rol ecx, 16
|
||||||
|
add ecx, [putimg.real_sx_and_abs_cx + 4]
|
||||||
|
sub ecx, [esp]
|
||||||
|
;--------------------------------------
|
||||||
|
; check for X
|
||||||
|
cmp cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||||
|
jb .no_mouse_area
|
||||||
|
|
||||||
|
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||||
|
jae .no_mouse_area
|
||||||
|
;--------------------------------------
|
||||||
|
; check mouse area for putpixel
|
||||||
|
call check_mouse_area_for_putpixel_new.1
|
||||||
|
;--------------------------------------
|
||||||
|
align 4
|
||||||
|
.no_mouse_area:
|
||||||
|
pop ecx
|
||||||
|
; store to real LFB
|
||||||
|
mov [LFB_BASE+edx], eax
|
||||||
|
;--------------------------------------
|
||||||
|
align 4
|
||||||
|
.skip:
|
||||||
|
add edx, 4
|
||||||
|
inc ebp
|
||||||
|
dec ecx
|
||||||
|
jnz .new_x
|
||||||
|
|
||||||
|
add esi, [putimg.line_increment]
|
||||||
|
add edx, [putimg.screen_newline];[BytesPerScanLine]
|
||||||
|
add ebp, [putimg.winmap_newline];[Screen_Max_X]
|
||||||
|
|
||||||
|
cmp [putimg.ebp], putimage_get1bpp
|
||||||
|
jz .correct
|
||||||
|
cmp [putimg.ebp], putimage_get2bpp
|
||||||
|
jz .correct
|
||||||
|
cmp [putimg.ebp], putimage_get4bpp
|
||||||
|
jnz @f
|
||||||
|
;--------------------------------------
|
||||||
|
align 4
|
||||||
|
.correct:
|
||||||
|
mov eax, [putimg.edi]
|
||||||
|
mov byte [eax], 80h
|
||||||
|
;--------------------------------------
|
||||||
|
align 4
|
||||||
|
@@:
|
||||||
|
dec edi
|
||||||
|
jnz .new_line
|
||||||
|
jmp put_image_end_32.finish
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
align 4
|
align 4
|
||||||
__sys_putpixel:
|
__sys_putpixel:
|
||||||
|
Loading…
Reference in New Issue
Block a user