From 03c3cc8b48f177b7192d37bf3ccfedb6bec01be5 Mon Sep 17 00:00:00 2001 From: Doczom Date: Thu, 3 Feb 2022 18:41:21 +0000 Subject: [PATCH] discontinuing the use of the twdw constant git-svn-id: svn://kolibrios.org@9679 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/video/blitter.inc | 16 +++++++++------- kernel/trunk/video/cursors.inc | 12 ++++++++---- kernel/trunk/video/vesa12.inc | 20 ++++++++++++++------ kernel/trunk/video/vesa20.inc | 24 ++++++++++++++---------- 4 files changed, 45 insertions(+), 27 deletions(-) diff --git a/kernel/trunk/video/blitter.inc b/kernel/trunk/video/blitter.inc index 2ee7366634..bd3bcdbf2f 100644 --- a/kernel/trunk/video/blitter.inc +++ b/kernel/trunk/video/blitter.inc @@ -212,10 +212,11 @@ end virtual sub esp, .local_vars_size mov [esp+.flags], ebx - - mov eax, [TASK_BASE] - mov ebx, [eax-twdw + WDATA.box.width] - mov edx, [eax-twdw + WDATA.box.height] + + mov eax, [current_slot_idx] + shl eax, 5 ; sizeof.WDATA + mov ebx, [eax + window_data + WDATA.box.width] + mov edx, [eax + window_data + WDATA.box.height] inc ebx inc edx @@ -259,12 +260,13 @@ end virtual call blit_clip jc .L57 - mov eax, [TASK_BASE] + mov eax, [current_slot_idx] + shl eax, 5 ; sizeof.WDATA mov ebx, [esp+BLITTER.dst_x] mov ebp, [esp+BLITTER.dst_y] - add ebx, [eax-twdw + WDATA.box.left] - add ebp, [eax-twdw + WDATA.box.top] + add ebx, [eax + window_data + WDATA.box.left] + add ebp, [eax + window_data + WDATA.box.top] test [esp+.flags], BLIT_CLIENT_RELATIVE jz .no_client_relative diff --git a/kernel/trunk/video/cursors.inc b/kernel/trunk/video/cursors.inc index bc28c32a5d..aeaee7c50f 100644 --- a/kernel/trunk/video/cursors.inc +++ b/kernel/trunk/video/cursors.inc @@ -423,8 +423,10 @@ align 4 push edi mov eax, [current_slot_idx] - shl eax, 5 - mov eax, [TASK_TABLE+eax+4] + ;shl eax, 5 + ;mov eax, [TASK_TABLE+eax+TASKDATA.pid] + shl eax, 8 + mov eax, [eax + SLOT_BASE + APPDATA.tid] mov ebx, [src] mov ecx, [flags] call create_cursor ;eax, ebx, ecx @@ -460,8 +462,10 @@ proc delete_cursor stdcall, hcursor:dword jne .fail mov ebx, [current_slot_idx] - shl ebx, 5 - mov ebx, [TASK_TABLE+ebx+4] + ;shl ebx, 5 + ;mov ebx, [TASK_TABLE+ebx+4] + shl ebx, 8 + mov ebx, [ebx + SLOT_BASE + APPDATA.tid] cmp ebx, [esi+CURSOR.pid] jne .fail diff --git a/kernel/trunk/video/vesa12.inc b/kernel/trunk/video/vesa12.inc index ca855d4bd9..3f783798df 100644 --- a/kernel/trunk/video/vesa12.inc +++ b/kernel/trunk/video/vesa12.inc @@ -398,9 +398,13 @@ vesa12_drawbar: push ebx push ecx push edx - mov ecx, [TASK_BASE] - add eax, [ecx-twdw+WDATA.box.left] - add ebx, [ecx-twdw+WDATA.box.top] + ;mov ecx, [TASK_BASE] + ;add eax, [ecx-twdw+WDATA.box.left] + ;add ebx, [ecx-twdw+WDATA.box.top] + mov ecx, [current_slot_idx] + shl ecx, 5 + add eax, [ecx + window_data + WDATA.box.left] + add ebx, [ecx + window_data + WDATA.box.top] push eax mov eax, ebx ; y mov ebx, [BytesPerScanLine] @@ -765,9 +769,13 @@ vesa12_putimage: push edx movzx eax, word [esp+2] movzx ebx, word [esp+0] - mov ecx, [TASK_BASE] - add eax, [ecx-twdw+WDATA.box.left] - add ebx, [ecx-twdw+WDATA.box.top] + ;mov ecx, [TASK_BASE] + ;add eax, [ecx-twdw+WDATA.box.left] + ;add ebx, [ecx-twdw+WDATA.box.top] + mov ecx, [current_slot_idx] + shl ecx, 5 + add eax, [ecx + window_data + WDATA.box.left] + add ebx, [ecx + window_data + WDATA.box.top] push eax mov eax, ebx ; y mul dword [BytesPerScanLine] diff --git a/kernel/trunk/video/vesa20.inc b/kernel/trunk/video/vesa20.inc index 56bcfacfb3..d053856733 100644 --- a/kernel/trunk/video/vesa20.inc +++ b/kernel/trunk/video/vesa20.inc @@ -189,15 +189,17 @@ end virtual mov [putimg.image_cx], eax mov [putimg.image_cy], edx ; calculate absolute (i.e. screen) coordinates - mov eax, [TASK_BASE] - mov ebx, [eax-twdw + WDATA.box.left] + ;mov eax, [TASK_BASE] + mov eax, [current_slot_idx] + shl eax, 5 ; sizeof.WDATA + mov ebx, [eax + window_data + WDATA.box.left] add ebx, [putimg.image_cx] mov [putimg.abs_cx], ebx - mov ebx, [eax-twdw + WDATA.box.top] + mov ebx, [eax +window_data + WDATA.box.top] add ebx, [putimg.image_cy] mov [putimg.abs_cy], ebx ; real_sx = MIN(wnd_sx-image_cx, image_sx); - mov ebx, [eax-twdw + WDATA.box.width] ; ebx = wnd_sx + mov ebx, [eax + window_data + WDATA.box.width] ; ebx = wnd_sx inc ebx ; WDATA.box.width is one pixel less than real window x-size sub ebx, [putimg.image_cx] ja @f @@ -212,7 +214,7 @@ end virtual .end_x: mov [putimg.real_sx], ebx ; init real_sy - mov ebx, [eax-twdw + WDATA.box.height] ; ebx = wnd_sy + mov ebx, [eax + window_data + WDATA.box.height] ; ebx = wnd_sy inc ebx sub ebx, [putimg.image_cy] ja @f @@ -1401,13 +1403,15 @@ end virtual mov [drbar.bar_sx], ecx mov [drbar.bar_cx], eax mov [drbar.bar_cy], ebx - mov edi, [TASK_BASE] - add eax, [edi-twdw + WDATA.box.left] ; win_cx - add ebx, [edi-twdw + WDATA.box.top] ; win_cy + ;mov edi, [TASK_BASE] + mov edi, [current_slot_idx] + shl edi, 5 ; sizeof.WDATA + add eax, [edi + window_data + WDATA.box.left] ; win_cx + add ebx, [edi + window_data + WDATA.box.top] ; win_cy mov [drbar.abs_cx], eax mov [drbar.abs_cy], ebx ; real_sx = MIN(wnd_sx-bar_cx, bar_sx); - mov ebx, [edi-twdw + WDATA.box.width] ; ebx = wnd_sx + mov ebx, [edi + window_data + WDATA.box.width] ; ebx = wnd_sx inc ebx ; WDATA.box.width is one pixel less than real window x-size sub ebx, [drbar.bar_cx] ja @f @@ -1424,7 +1428,7 @@ end virtual .end_x: mov [drbar.real_sx], ebx ; real_sy = MIN(wnd_sy-bar_cy, bar_sy); - mov ebx, [edi-twdw + WDATA.box.height] ; ebx = wnd_sy + mov ebx, [edi + window_data + WDATA.box.height] ; ebx = wnd_sy inc ebx sub ebx, [drbar.bar_cy] ja @f