1. faster GUI: calculatescreen

2. fixed sysfunc 1 - put pixel which was completely broken

git-svn-id: svn://kolibrios.org@112 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Ivan Poddubny 2006-08-01 14:09:42 +00:00
parent fca11d7700
commit 849b393cad
4 changed files with 133 additions and 56 deletions

View File

@ -978,10 +978,10 @@ terminate: ; terminate application
; call systest ; call systest
sti ; .. and life goes on sti ; .. and life goes on
; movzx eax,word [dlx] mov eax, [dlx]
; movzx ebx,word [dly] mov ebx, [dly]
; movzx ecx,word [dlxe] mov ecx, [dlxe]
; movzx edx,word [dlye] mov edx, [dlye]
call calculatescreen call calculatescreen
xor eax, eax xor eax, eax
xor esi, esi xor esi, esi

View File

@ -47,18 +47,17 @@ setwindowdefaults:
; ecx = ex ; ecx = ex
; edx = ey ; edx = ey
; èäåÿ: ïåðåáðàòü âñå îêíà, íà÷èíàÿ ñ ñàìîãî íèæíåãî, ; èäåÿ: ïåðåáðàòü âñå îêíà, íà÷èíàÿ ñ ñàìîãî íèæíåãî,
; è äëÿ êàæäîãî âûçâàòü setscreen ; è äëÿ ïîïàâøèõ â çàäàííóþ îáëàñòü
; ÷àñòåé îêîí âûçâàòü setscreen
align 4 align 4
calculatescreen: calculatescreen:
pushad pushad
pushfd pushfd
cli cli
push edx ecx ebx eax
mov esi, 1 mov esi, 1
xor eax, eax
xor ebx, ebx
mov ecx, [0xFE00]
mov edx, [0xFE04]
call setscreen call setscreen
mov ebp, [0x3004] ; number of processes mov ebp, [0x3004] ; number of processes
@ -73,23 +72,55 @@ calculatescreen:
je .not_wnd je .not_wnd
add edi, window_data add edi, window_data
test [edi+WDATA.fl_wstate],WSTATE_MINIMIZED test [edi+WDATA.fl_wstate], WSTATE_MINIMIZED
jnz .not_wnd jnz .not_wnd
mov eax,[edi+WDATA.left]
mov ebx,[edi+WDATA.top] mov eax, [edi+WDATA.left]
mov ecx,[edi+WDATA.width] cmp eax, [esp+RECT.right]
add ecx,eax ja .out_of_bounds
mov edx,[edi+WDATA.height] mov ebx, [edi+WDATA.top]
add edx,ebx cmp ebx, [esp+RECT.bottom]
ja .out_of_bounds
mov ecx, [edi+WDATA.width]
add ecx, eax
cmp ecx, [esp+RECT.left]
jb .out_of_bounds
mov edx, [edi+WDATA.height]
add edx, ebx
cmp edx, [esp+RECT.top]
jb .out_of_bounds
cmp eax, [esp+RECT.left]
jae @f
mov eax, [esp+RECT.left]
@@:
cmp ebx, [esp+RECT.top]
jae @f
mov ebx, [esp+RECT.top]
@@:
cmp ecx, [esp+RECT.right]
jbe @f
mov ecx, [esp+RECT.right]
@@:
cmp edx, [esp+RECT.bottom]
jbe @f
mov edx, [esp+RECT.bottom]
@@:
push esi push esi
movzx esi, word [0xC400 + esi * 2] movzx esi, word [0xC400 + esi * 2]
call setscreen call setscreen
pop esi pop esi
.not_wnd: .not_wnd:
.out_of_bounds:
inc esi inc esi
dec ebp dec ebp
jnz .new_wnd jnz .new_wnd
.finish: .finish:
pop eax ebx ecx edx
popfd popfd
popad popad
ret ret
@ -97,6 +128,9 @@ ret
virtual at esp virtual at esp
ff_x dd ?
ff_y dd ?
ff_width dd ?
ff_xsz dd ? ff_xsz dd ?
ff_ysz dd ? ff_ysz dd ?
ff_scale dd ? ff_scale dd ?
@ -186,15 +220,12 @@ pushad
push eax push eax
mov eax, [0xFE00] ; screen_sx mov eax, [0xFE00] ; screen_sx
inc eax inc eax
imul eax, ebx ;ebx imul eax, ebx
add eax, [esp] ;eax add eax, [esp]
add eax, WinMapAddress add eax, WinMapAddress
mov ebp, eax mov ebp, eax
mov edi, [edi] mov edi, [edi]
; mov eax, esi
; shl eax, 5
; add edi, [eax+0x3000+0x10]
pop eax pop eax
; eax = x_start ; eax = x_start
@ -204,16 +235,30 @@ pushad
; esi = process_number ; esi = process_number
; edi = &shape ; edi = &shape
; [scale] ; [scale]
push edx ecx ;ebx eax push edx ecx ; for loop - x,y size
xor ebx, ebx
align 4 mov ecx, esi
shl ecx, 5
mov edx, [window_data+ecx+WDATA.top]
push [window_data+ecx+WDATA.width] ; for loop - width
mov ecx, [window_data+ecx+WDATA.left]
sub ebx, edx
sub eax, ecx
push ebx eax ; for loop - x,y
add [ff_xsz], eax
add [ff_ysz], ebx
mov ebx, [ff_y]
.ff_new_y: .ff_new_y:
xor edx, edx mov edx, [ff_x]
align 4
.ff_new_x: .ff_new_x:
; -- body -- ; -- body --
mov ecx, [ff_scale] mov ecx, [ff_scale]
mov eax, [ff_xsz] mov eax, [ff_width]
inc eax
shr eax, cl shr eax, cl
push ebx edx push ebx edx
shr ebx, cl shr ebx, cl
@ -221,13 +266,11 @@ pushad
imul eax, ebx imul eax, ebx
add eax, edx add eax, edx
pop edx ebx pop edx ebx
add eax, edi ;[ff_shape] add eax, edi
call .read_byte call .read_byte
; cmp byte [eax], 1
; jne @f
test al,al test al,al
jz @f jz @f
mov eax, esi ; [ff_proc] mov eax, esi
mov [ebp], al mov [ebp], al
@@: @@:
; -- end body -- ; -- end body --
@ -236,14 +279,14 @@ pushad
cmp edx, [ff_xsz] cmp edx, [ff_xsz]
jb .ff_new_x jb .ff_new_x
sub ebp, [ff_xsz] sub ebp, [ff_xsz]
add ebp, [ff_x]
add ebp, [0xFE00] ; screen.x add ebp, [0xFE00] ; screen.x
inc ebp inc ebp
inc ebx inc ebx
cmp ebx, [ff_ysz] cmp ebx, [ff_ysz]
jb .ff_new_y jb .ff_new_y
pop ecx edx ; eax ebx first add esp, 24
add esp, 4
popad popad
ret ret
@ -389,6 +432,10 @@ display_settings:
jg .lp2 jg .lp2
mov [screen_workarea.bottom],ebx mov [screen_workarea.bottom],ebx
.lp2: call repos_windows .lp2: call repos_windows
mov eax, 0
mov ebx, 0
mov ecx, [0xfe00]
mov edx, [0xfe04]
call calculatescreen call calculatescreen
; jmp redraw_screen_direct ; jmp redraw_screen_direct
.exit: .exit:
@ -436,7 +483,13 @@ display_settings:
mov ecx,(64*512)/4 mov ecx,(64*512)/4
rep movsd rep movsd
call parse_skin_data call parse_skin_data
pushad
mov eax, 0
mov ebx, 0
mov ecx, [0xfe00]
mov edx, [0xfe04]
call calculatescreen call calculatescreen
popad
mov dword[esp+32+36],0 mov dword[esp+32+36],0
jmp redraw_screen_direct jmp redraw_screen_direct
.exit: .exit:
@ -1006,15 +1059,18 @@ minimize_window:
cli cli
or [eax+WDATA.fl_wstate], WSTATE_MINIMIZED or [eax+WDATA.fl_wstate], WSTATE_MINIMIZED
mov edi, eax mov edi, eax
call calculatescreen ;call calculatescreen
mov eax, [edi+WDATA.left] mov eax, [edi+WDATA.left]
mov [dlx], eax mov [dlx], eax
add eax, [edi+WDATA.width] mov ecx, eax
mov [dlxe], eax add ecx, [edi+WDATA.width]
mov eax, [edi+WDATA.top] mov [dlxe], ecx
mov [dly], eax mov ebx, [edi+WDATA.top]
add eax, [edi+WDATA.height] mov [dly], ebx
mov [dlye], eax mov edx, ebx
add edx, [edi+WDATA.height]
mov [dlye], edx
call calculatescreen
xor esi, esi xor esi, esi
xor eax, eax xor eax, eax
call redrawscreen call redrawscreen
@ -1046,6 +1102,12 @@ restore_minimized_window:
call setscreen call setscreen
jmp .done jmp .done
.no_uppermost: .no_uppermost:
mov eax, [edi+WDATA.left]
mov ebx, [edi+WDATA.top]
mov ecx, eax
mov edx, ebx
add ecx, [edi+WDATA.width]
add edx, [edi+WDATA.height]
call calculatescreen call calculatescreen
.done: .done:
mov [0xfff4],byte 0 ; no mouse under mov [0xfff4],byte 0 ; no mouse under
@ -1482,10 +1544,18 @@ checkwindows:
cmp [reposition],0 cmp [reposition],0
je retwm je retwm
mov [edi+WDATA.fl_redraw],1
mov [0xfff5],byte 1 ; no mouse mov [0xfff5],byte 1 ; no mouse
push eax ebx ecx edx push eax ebx ecx edx
mov eax,[edi+00]
mov ebx,[edi+04]
mov ecx,[edi+8]
mov edx,[edi+12]
add ecx,eax
add edx,ebx
call calculatescreen
mov eax,[oldc+00] mov eax,[oldc+00]
mov ebx,[oldc+04] mov ebx,[oldc+04]
mov ecx,[oldc+8] mov ecx,[oldc+8]
@ -1498,6 +1568,9 @@ checkwindows:
mov eax,edi mov eax,edi
call redrawscreen call redrawscreen
mov [edi+WDATA.fl_redraw],1
mov ecx,100 ; wait to avoid mouse residuals mov ecx,100 ; wait to avoid mouse residuals
waitre2: waitre2:
mov [0xfff5],byte 1 mov [0xfff5],byte 1

View File

@ -4667,9 +4667,9 @@ syscall_setpixel: ; SetPixel
mov edx,[0x3010] mov edx,[0x3010]
add eax,[edx-twdw] add eax,[edx-twdw]
add ebx,[edx-twdw+4] add ebx,[edx-twdw+4]
; xor edi,edi ; no force xor edi,edi ; no force
mov edi,1 ;mov edi,1
; call [disable_mouse] call [disable_mouse]
jmp [putpixel] jmp [putpixel]
align 4 align 4

View File

@ -36,6 +36,10 @@ endg
sub [screen_workarea.bottom],ebx sub [screen_workarea.bottom],ebx
call repos_windows call repos_windows
mov eax, 0
mov ebx, 0
mov ecx, [0xfe00]
mov edx, [0xfe04]
call calculatescreen call calculatescreen
.resolution_wasnt_changed: .resolution_wasnt_changed: