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

View File

@ -351,7 +351,7 @@ fpu_data:
rb 0xa80 ; bochs avx512 rb 0xa80 ; bochs avx512
fpu_data_size = $ - fpu_data fpu_data_size = $ - fpu_data
draw_data: draw_data:
rb 32*256 rb sizeof.WDATA*256
BPSLine_calc_area rd MAX_SCREEN_HEIGHT BPSLine_calc_area rd MAX_SCREEN_HEIGHT
d_width_calc_area rd MAX_SCREEN_HEIGHT d_width_calc_area rd MAX_SCREEN_HEIGHT
mouseunder rd 16*24 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 ;; ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
;; Distributed under terms of the GNU General Public License ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
@ -331,11 +331,11 @@ nosb8:
mov [background_defined], 1 mov [background_defined], 1
mov [draw_data + sizeof.RECT + RECT.left], eax mov [draw_data + sizeof.WDATA + RECT.left], eax
mov [draw_data + sizeof.RECT + RECT.top], ebx mov [draw_data + sizeof.WDATA + RECT.top], ebx
mov [draw_data + sizeof.RECT + RECT.right], ecx mov [draw_data + sizeof.WDATA + RECT.right], ecx
mov [draw_data + sizeof.RECT + RECT.bottom], edx mov [draw_data + sizeof.WDATA + RECT.bottom], edx
inc [REDRAW_BACKGROUND] inc [REDRAW_BACKGROUND]
call wakeup_osloop call wakeup_osloop
@ -356,15 +356,15 @@ endg
align 4 align 4
force_redraw_background: force_redraw_background:
and [draw_data + sizeof.RECT + RECT.left], 0 and [draw_data + sizeof.WDATA + RECT.left], 0
and [draw_data + sizeof.RECT + RECT.top], 0 and [draw_data + sizeof.WDATA + RECT.top], 0
push eax ebx push eax ebx
mov eax, [_display.width] mov eax, [_display.width]
mov ebx, [_display.height] mov ebx, [_display.height]
dec eax dec eax
dec ebx dec ebx
mov [draw_data + sizeof.RECT + RECT.right], eax mov [draw_data + sizeof.WDATA + RECT.right], eax
mov [draw_data + sizeof.RECT + RECT.bottom], ebx mov [draw_data + sizeof.WDATA + RECT.bottom], ebx
pop ebx eax pop ebx eax
inc [REDRAW_BACKGROUND] inc [REDRAW_BACKGROUND]
call wakeup_osloop call wakeup_osloop
@ -603,6 +603,3 @@ align 4
.exit: .exit:
popad popad
ret ret

View File

@ -2643,16 +2643,15 @@ sys_redrawstat:
jnz .srl1 jnz .srl1
mov edx, [current_slot_idx] ; return whole screen draw area for this app mov edx, [current_slot_idx] ; return whole screen draw area for this app
shl edx, BSF sizeof.RECT shl edx, BSF sizeof.WDATA
add edx, draw_data mov [draw_data + edx + RECT.left], 0
mov [edx + RECT.left], 0 mov [draw_data + edx + RECT.top], 0
mov [edx + RECT.top], 0
mov eax, [_display.width] mov eax, [_display.width]
dec eax dec eax
mov [edx + RECT.right], eax mov [draw_data + edx + RECT.right], eax
mov eax, [_display.height] mov eax, [_display.height]
dec eax dec eax
mov [edx + RECT.bottom], eax mov [draw_data + edx + RECT.bottom], eax
.srl1: .srl1:
ret ret
@ -2811,7 +2810,7 @@ align 4
mov ecx, [thread_count] mov ecx, [thread_count]
movzx eax, word [WIN_POS + ecx*2] ; active window movzx eax, word [WIN_POS + ecx*2] ; active window
shl eax, BSF sizeof.APPDATA ;8 shl eax, BSF sizeof.APPDATA
push eax push eax
movzx eax, word [MOUSE_X] movzx eax, word [MOUSE_X]
@ -2866,14 +2865,14 @@ align 4
;-------------------------------------- ;--------------------------------------
align 4 align 4
backgr: backgr:
mov eax, [draw_data + sizeof.RECT + RECT.left] mov eax, [draw_data + sizeof.WDATA + RECT.left]
shl eax, 16 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 [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 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] mov [BG_Rect_Y_top_bottom], eax ; [top]*65536 + [bottom]
call drawbackground call drawbackground
@ -2924,10 +2923,10 @@ set_bgr_event:
jnz backgr jnz backgr
xor eax, eax xor eax, eax
mov [draw_data + sizeof.RECT + RECT.left], eax mov [draw_data + sizeof.WDATA + RECT.left], eax
mov [draw_data + sizeof.RECT + RECT.top], eax mov [draw_data + sizeof.WDATA + RECT.top], eax
mov [draw_data + sizeof.RECT + RECT.right], eax mov [draw_data + sizeof.WDATA + RECT.right], eax
mov [draw_data + sizeof.RECT + RECT.bottom], eax mov [draw_data + sizeof.WDATA + RECT.bottom], eax
;-------------------------------------- ;--------------------------------------
align 4 align 4
nobackgr: 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 ;; ;; Distributed under terms of the GNU General Public License ;;
;; ;; ;; ;;
;; VESA20.INC ;; ;; VESA20.INC ;;
@ -2013,9 +2013,9 @@ vesa20_drawbackground_tiled:
pushad pushad
; External loop for all y from start to end ; 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: 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] ; 1) Calculate pointers in WinMapAddress (does pixel belong to OS thread?) [ebp]
; and LFB data (output for our function) [edi] ; and LFB data (output for our function) [edi]
; mov eax, [BytesPerScanLine] ; mov eax, [BytesPerScanLine]
@ -2113,7 +2113,7 @@ vesa20_drawbackground_tiled:
add ebp, edx add ebp, edx
add eax, edx add eax, edx
cmp eax, [draw_data + 32 + RECT.right] cmp eax, [draw_data + sizeof.WDATA + RECT.right]
ja dp4 ja dp4
sub ecx, edx sub ecx, edx
jnz dp3 jnz dp3
@ -2128,7 +2128,7 @@ vesa20_drawbackground_tiled:
dp4: dp4:
; next scan line ; next scan line
inc ebx inc ebx
cmp ebx, [draw_data + 32 + RECT.bottom] cmp ebx, [draw_data + sizeof.WDATA + RECT.bottom]
jbe dp2 jbe dp2
popad popad
mov [EGA_counter], 1 mov [EGA_counter], 1
@ -2166,8 +2166,8 @@ vesa20_drawbackground_stretch:
push eax ; low push eax ; low
; External loop for all y from start to end ; 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
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] ; 1) Calculate pointers in WinMapAddress (does pixel belong to OS thread?) [ebp]
; and LFB data (output for our function) [edi] ; and LFB data (output for our function) [edi]
; mov eax, [BytesPerScanLine] ; mov eax, [BytesPerScanLine]
@ -2309,7 +2309,7 @@ vesa20_drawbackground_stretch:
add eax, 1 add eax, 1
mov [esp+20], eax mov [esp+20], eax
add esi, 4 add esi, 4
cmp eax, [draw_data+32+RECT.right] cmp eax, [draw_data + sizeof.WDATA + RECT.right]
jbe sdp3a jbe sdp3a
sdp4: sdp4:
@ -2317,11 +2317,11 @@ vesa20_drawbackground_stretch:
mov ebx, [esp+24] mov ebx, [esp+24]
add ebx, 1 add ebx, 1
mov [esp+24], ebx mov [esp+24], ebx
cmp ebx, [draw_data + 32 + RECT.bottom] cmp ebx, [draw_data + sizeof.WDATA + RECT.bottom]
ja sdpdone ja sdpdone
; advance edi, ebp to next scan line ; 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 sub ebp, eax
add ebp, [_display.width] add ebp, [_display.width]
sub edi, eax sub edi, eax
@ -2346,7 +2346,7 @@ vesa20_drawbackground_stretch:
lea eax, [eax*3] lea eax, [eax*3]
imul eax, [BgrDataWidth] imul eax, [BgrDataWidth]
sub [esp], eax sub [esp], eax
mov eax, [draw_data + 32 + RECT.left] mov eax, [draw_data + sizeof.WDATA + RECT.left]
mov [esp+20], eax mov [esp+20], eax
test ebx, ebx test ebx, ebx
jz sdp3 jz sdp3
@ -2386,7 +2386,7 @@ smooth_line:
mov eax, [esp+20+8] mov eax, [esp+20+8]
add eax, 1 add eax, 1
mov [esp+20+8], eax mov [esp+20+8], eax
cmp eax, [draw_data + 32 + RECT.right] cmp eax, [draw_data + sizeof.WDATA + RECT.right]
ja @f ja @f
add ecx, [esp+36+8] add ecx, [esp+36+8]
mov eax, edx mov eax, edx
@ -2396,7 +2396,7 @@ smooth_line:
sub esi, eax sub esi, eax
jmp smooth_line jmp smooth_line
@@: @@:
mov eax, [draw_data + 32 + RECT.left] mov eax, [draw_data + sizeof.WDATA + RECT.left]
mov [esp+20+8], eax mov [esp+20+8], eax
ret ret