Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 2987 → Rev 2465

/kernel/branches/Kolibri-acpi/video/cursors.inc
353,8 → 353,6
 
stdcall init_cursor, eax, esi
 
align 4
.add_cursor:
mov ecx, [.hcursor]
lea ecx, [ecx+CURSOR.list_next]
lea edx, [_display.cr_list.next]
365,6 → 363,9
popfd
 
mov eax, [.hcursor]
;--------------------------------------
align 4
.check_hw:
cmp [_display.init_cursor], 0
je .fail
 
384,14 → 385,14
shr ebx, 16
movzx ecx, bh
movzx edx, bl
mov [edi+CURSOR.hot_x], ecx
mov [edi+CURSOR.hot_y], edx
mov [eax+CURSOR.hot_x], ecx
mov [eax+CURSOR.hot_y], edx
 
xchg edi, eax
mov ecx, 1024
cld
rep movsd
jmp .add_cursor
jmp .check_hw
;------------------------------------------------------------------------------
align 4
proc load_cursor stdcall, src:dword, flags:dword
618,7 → 619,9
mov [_dy], edx
 
; mul dword [BytesPerScanLine]
mov eax, [BPSLine_calc_area+eax*4]
mov eax, [d_width_calc_area + eax*4]
lea eax, [eax + eax*2]
 
lea edx, [LFB_BASE+ecx*3]
add edx, eax
mov [cur_saved_base], edx
642,8 → 645,6
sub edi, [y]
inc ebx
inc edi
sub ebx, [_dx]
sub edi, [_dy]
 
mov [cur.w], ebx
mov [cur.h], edi
737,7 → 738,9
mov [_dy], edx
 
; mul dword [BytesPerScanLine]
mov eax, [BPSLine_calc_area+eax*4]
mov eax, [d_width_calc_area + eax*4]
shl eax, 2
 
lea edx, [LFB_BASE+eax+ecx*4]
mov [cur_saved_base], edx
 
760,8 → 763,6
sub edi, [y]
inc ebx
inc edi
sub ebx, [_dx]
sub edi, [_dy]
 
mov [cur.w], ebx
mov [cur.h], edi
839,10 → 840,10
;--------------------------------------
push eax ebx
; offset X
movzx ecx, word [X_UNDER_subtraction_CUR_hot_x]
mov ecx, [X_UNDER_subtraction_CUR_hot_x]
sub eax, ecx ; x1
; offset Y
movzx ecx, word [Y_UNDER_subtraction_CUR_hot_y]
mov ecx, [Y_UNDER_subtraction_CUR_hot_y]
sub ebx, ecx ; y1
;--------------------------------------
; ebx = offset y
878,26 → 879,31
; eax = new color
;--------------------------------------
; 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
 
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
jb .no_mouse_area
 
rol ecx, 16
;--------------------------------------
; 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
 
sub cx, [X_UNDER_subtraction_CUR_hot_x]
jb .no_mouse_area
 
ror ecx, 16
;--------------------------------------
align 4
.1:
push eax
; offset X
mov ax, [X_UNDER_subtraction_CUR_hot_x]
sub cx, ax ; x1
ror ecx, 16
; offset Y
mov ax, [Y_UNDER_subtraction_CUR_hot_y]
sub cx, ax ; y1
;--------------------------------------
; ecx = (offset x) shl 16 + (offset y)
push ebx
904,23 → 910,10
mov ebx, ecx
shr ebx, 16 ; x
and ecx, 0xffff ; y
 
cmp ecx, [cur.h]
jae @f
 
cmp ebx, [cur.w]
jb .ok
;--------------------------------------
align 4
@@:
; DEBUGF 1, "K : SHIT HAPPENS: %x %x \n", ecx,ebx
pop ebx
jmp .sh ; SORRY! SHIT HAPPENS!
;--------------------------------------
align 4
.ok:
; ecx = offset y
; ebx = offset x
mov eax, [esp + 4]
 
push ebx ecx
imul ecx, [cur.w] ;y
add ecx, ebx
956,14 → 949,10
test eax, 0xFF000000
jz @f
 
add esp, 4
pop ecx
ret
;--------------------------------------
align 4
.sh:
mov ecx, -1
;--------------------------------------
align 4
@@:
pop eax
;--------------------------------------
1030,8 → 1019,6
;--------------------------------------
align 4
@@:
stdcall load_cursor, clock_arrow, dword LOAD_FROM_MEM
mov [def_cursor_clock], eax
stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM
mov [def_cursor], eax
ret
1047,8 → 1034,4
def_arrow:
file 'arrow.cur'
;------------------------------------------------------------------------------
align 4
clock_arrow:
file 'arrow_clock.cur'
;------------------------------------------------------------------------------