[KERNEL] fixed a bug in rev 9917

git-svn-id: svn://kolibrios.org@9925 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Doczom 2023-06-22 03:32:33 +00:00
parent 91a9743099
commit 76202213a1
5 changed files with 45 additions and 48 deletions

View File

@ -977,7 +977,7 @@ proc set_app_params stdcall,slot:dword, params:dword, flags:dword
mov [SLOT_BASE + ebx + APPDATA.saved_esp0], eax
push ebx
stdcall kernel_alloc, maxPathLength
stdcall kernel_alloc, maxPathLength ;TODO
pop ebx
mov esi, [current_slot]
mov esi, [esi + APPDATA.cur_dir]
@ -1003,12 +1003,12 @@ proc set_app_params stdcall,slot:dword, params:dword, flags:dword
;set draw data to full screen
xor eax, eax
mov [ecx+0], dword eax
mov [ecx+4], dword eax
mov [ecx + RECT.left], eax
mov [ecx + RECT.top], eax
mov eax, [screen_workarea.right]
mov [ecx+8], eax
mov [ecx + RECT.right], eax
mov eax, [screen_workarea.bottom]
mov [ecx+12], eax
mov [ecx + RECT.bottom], eax
mov ebx, [pl0_stack]
mov esi, [params]
@ -1084,11 +1084,12 @@ pid_to_appdata:
.loop:
add ecx, sizeof.APPDATA
cmp [SLOT_BASE + ecx + APPDATA.state], TSTATE_FREE
jz .loop ;skip empty slots
jz @f ;skip empty slots
cmp [SLOT_BASE + ecx + APPDATA.tid], eax
jz .pid_found
;ecx = offset of current process info entry
;ebx = maximum permitted offset
@@:
cmp ecx, ebx
jb .loop

View File

@ -351,7 +351,7 @@ fpu_data:
rb 0xa80 ; bochs avx512
fpu_data_size = $ - fpu_data
draw_data:
rb 32*256
rb sizeof.WDATA*256
BPSLine_calc_area rd MAX_SCREEN_HEIGHT
d_width_calc_area rd MAX_SCREEN_HEIGHT
mouseunder rd 16*24

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2023. All rights reserved. ;;
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
@ -331,11 +331,11 @@ nosb8:
mov [background_defined], 1
mov [draw_data + sizeof.RECT + RECT.left], eax
mov [draw_data + sizeof.RECT + RECT.top], ebx
mov [draw_data + sizeof.WDATA + RECT.left], eax
mov [draw_data + sizeof.WDATA + RECT.top], ebx
mov [draw_data + sizeof.RECT + RECT.right], ecx
mov [draw_data + sizeof.RECT + RECT.bottom], edx
mov [draw_data + sizeof.WDATA + RECT.right], ecx
mov [draw_data + sizeof.WDATA + RECT.bottom], edx
inc [REDRAW_BACKGROUND]
call wakeup_osloop
@ -356,15 +356,15 @@ endg
align 4
force_redraw_background:
and [draw_data + sizeof.RECT + RECT.left], 0
and [draw_data + sizeof.RECT + RECT.top], 0
and [draw_data + sizeof.WDATA + RECT.left], 0
and [draw_data + sizeof.WDATA + RECT.top], 0
push eax ebx
mov eax, [_display.width]
mov ebx, [_display.height]
dec eax
dec ebx
mov [draw_data + sizeof.RECT + RECT.right], eax
mov [draw_data + sizeof.RECT + RECT.bottom], ebx
mov [draw_data + sizeof.WDATA + RECT.right], eax
mov [draw_data + sizeof.WDATA + RECT.bottom], ebx
pop ebx eax
inc [REDRAW_BACKGROUND]
call wakeup_osloop
@ -602,7 +602,4 @@ align 4
.exit:
popad
ret
ret

View File

@ -2643,16 +2643,15 @@ sys_redrawstat:
jnz .srl1
mov edx, [current_slot_idx] ; return whole screen draw area for this app
shl edx, BSF sizeof.RECT
add edx, draw_data
mov [edx + RECT.left], 0
mov [edx + RECT.top], 0
shl edx, BSF sizeof.WDATA
mov [draw_data + edx + RECT.left], 0
mov [draw_data + edx + RECT.top], 0
mov eax, [_display.width]
dec eax
mov [edx + RECT.right], eax
mov [draw_data + edx + RECT.right], eax
mov eax, [_display.height]
dec eax
mov [edx + RECT.bottom], eax
mov [draw_data + edx + RECT.bottom], eax
.srl1:
ret
@ -2811,7 +2810,7 @@ align 4
mov ecx, [thread_count]
movzx eax, word [WIN_POS + ecx*2] ; active window
shl eax, BSF sizeof.APPDATA ;8
shl eax, BSF sizeof.APPDATA
push eax
movzx eax, word [MOUSE_X]
@ -2866,14 +2865,14 @@ align 4
;--------------------------------------
align 4
backgr:
mov eax, [draw_data + sizeof.RECT + RECT.left]
mov eax, [draw_data + sizeof.WDATA + RECT.left]
shl eax, 16
add eax, [draw_data + sizeof.RECT + RECT.right]
add eax, [draw_data + sizeof.WDATA + RECT.right]
mov [BG_Rect_X_left_right], eax ; [left]*65536 + [right]
mov eax, [draw_data + sizeof.RECT + RECT.top]
mov eax, [draw_data + sizeof.WDATA + RECT.top]
shl eax, 16
add eax, [draw_data + sizeof.RECT + RECT.bottom]
add eax, [draw_data + sizeof.WDATA + RECT.bottom]
mov [BG_Rect_Y_top_bottom], eax ; [top]*65536 + [bottom]
call drawbackground
@ -2924,10 +2923,10 @@ set_bgr_event:
jnz backgr
xor eax, eax
mov [draw_data + sizeof.RECT + RECT.left], eax
mov [draw_data + sizeof.RECT + RECT.top], eax
mov [draw_data + sizeof.RECT + RECT.right], eax
mov [draw_data + sizeof.RECT + RECT.bottom], eax
mov [draw_data + sizeof.WDATA + RECT.left], eax
mov [draw_data + sizeof.WDATA + RECT.top], eax
mov [draw_data + sizeof.WDATA + RECT.right], eax
mov [draw_data + sizeof.WDATA + RECT.bottom], eax
;--------------------------------------
align 4
nobackgr:

View File

@ -1,6 +1,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2022. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2023. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; VESA20.INC ;;
@ -2013,9 +2013,9 @@ vesa20_drawbackground_tiled:
pushad
; External loop for all y from start to end
mov ebx, [draw_data + 32 + RECT.top] ; y start
mov ebx, [draw_data + sizeof.WDATA + RECT.top] ; y start
dp2:
mov ebp, [draw_data + 32 + RECT.left] ; x start
mov ebp, [draw_data + sizeof.WDATA + RECT.left] ; x start
; 1) Calculate pointers in WinMapAddress (does pixel belong to OS thread?) [ebp]
; and LFB data (output for our function) [edi]
; mov eax, [BytesPerScanLine]
@ -2113,7 +2113,7 @@ vesa20_drawbackground_tiled:
add ebp, edx
add eax, edx
cmp eax, [draw_data + 32 + RECT.right]
cmp eax, [draw_data + sizeof.WDATA + RECT.right]
ja dp4
sub ecx, edx
jnz dp3
@ -2128,7 +2128,7 @@ vesa20_drawbackground_tiled:
dp4:
; next scan line
inc ebx
cmp ebx, [draw_data + 32 + RECT.bottom]
cmp ebx, [draw_data + sizeof.WDATA + RECT.bottom]
jbe dp2
popad
mov [EGA_counter], 1
@ -2166,8 +2166,8 @@ vesa20_drawbackground_stretch:
push eax ; low
; External loop for all y from start to end
mov ebx, [draw_data + 32 + RECT.top] ; y start
mov ebp, [draw_data + 32 + RECT.left] ; x start
mov ebx, [draw_data + sizeof.WDATA + RECT.top] ; y start
mov ebp, [draw_data + sizeof.WDATA + RECT.left] ; x start
; 1) Calculate pointers in WinMapAddress (does pixel belong to OS thread?) [ebp]
; and LFB data (output for our function) [edi]
; mov eax, [BytesPerScanLine]
@ -2309,7 +2309,7 @@ vesa20_drawbackground_stretch:
add eax, 1
mov [esp+20], eax
add esi, 4
cmp eax, [draw_data+32+RECT.right]
cmp eax, [draw_data + sizeof.WDATA + RECT.right]
jbe sdp3a
sdp4:
@ -2317,11 +2317,11 @@ vesa20_drawbackground_stretch:
mov ebx, [esp+24]
add ebx, 1
mov [esp+24], ebx
cmp ebx, [draw_data + 32 + RECT.bottom]
cmp ebx, [draw_data + sizeof.WDATA + RECT.bottom]
ja sdpdone
; advance edi, ebp to next scan line
sub eax, [draw_data + 32 + RECT.left]
sub eax, [draw_data + sizeof.WDATA + RECT.left]
sub ebp, eax
add ebp, [_display.width]
sub edi, eax
@ -2346,7 +2346,7 @@ vesa20_drawbackground_stretch:
lea eax, [eax*3]
imul eax, [BgrDataWidth]
sub [esp], eax
mov eax, [draw_data + 32 + RECT.left]
mov eax, [draw_data + sizeof.WDATA + RECT.left]
mov [esp+20], eax
test ebx, ebx
jz sdp3
@ -2386,7 +2386,7 @@ smooth_line:
mov eax, [esp+20+8]
add eax, 1
mov [esp+20+8], eax
cmp eax, [draw_data + 32 + RECT.right]
cmp eax, [draw_data + sizeof.WDATA + RECT.right]
ja @f
add ecx, [esp+36+8]
mov eax, edx
@ -2396,7 +2396,7 @@ smooth_line:
sub esi, eax
jmp smooth_line
@@:
mov eax, [draw_data + 32 + RECT.left]
mov eax, [draw_data + sizeof.WDATA + RECT.left]
mov [esp+20+8], eax
ret