From 60bd1cf7b6b8a43e1a7e9b0258d29bab2e9e9778 Mon Sep 17 00:00:00 2001 From: "Marat Zakiyanov (Mario79)" Date: Mon, 2 Apr 2012 22:30:24 +0000 Subject: [PATCH] Function 15.9 - Redraws a rectangular part of the background git-svn-id: svn://kolibrios.org@2547 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/docs/sysfuncr.txt | 16 ++++++++++++ kernel/trunk/docs/sysfuncs.txt | 16 ++++++++++++ kernel/trunk/kernel.asm | 46 ++++++++++++++++++++++++++++++++-- 3 files changed, 76 insertions(+), 2 deletions(-) diff --git a/kernel/trunk/docs/sysfuncr.txt b/kernel/trunk/docs/sysfuncr.txt index c78499fcd..e0e3b36fc 100644 --- a/kernel/trunk/docs/sysfuncr.txt +++ b/kernel/trunk/docs/sysfuncr.txt @@ -635,6 +635,22 @@ функцию сразу после получения события: 5 = завершилась перерисовка фона рабочего стола +====================================================================== +====================== Функция 15, подфункция 9 ====================== +=============== Перерисовать прямоугольную часть фона. =============== +====================================================================== +Параметры: + * eax = 15 - номер функции + * ebx = 9 - номер подфункции + * ecx = [left]*65536 + [right] + * edx = [top]*65536 + [bottom] +Возвращаемое значение: + * функция не возвращает значения +Замечания: + * (left,top) - координаты левого верхнего угла, + (right,bottom) - координаты правого нижнего. + * Если параметры установлены некорректно - фон не перерисовывается. + ====================================================================== ============= Функция 16 - сохранить рамдиск на дискету. ============= ====================================================================== diff --git a/kernel/trunk/docs/sysfuncs.txt b/kernel/trunk/docs/sysfuncs.txt index f2b120e09..3ff25d548 100644 --- a/kernel/trunk/docs/sysfuncs.txt +++ b/kernel/trunk/docs/sysfuncs.txt @@ -629,6 +629,22 @@ Remarks: immediately after the event: 5 = kernel finished redrawing of the desktop background +====================================================================== +===================== Function 15, subfunction 9 ===================== +============= Redraws a rectangular part of the background =========== +====================================================================== +Parameters: + * eax = 15 - function number + * ebx = 9 - subfunction number + * ecx = [left]*65536 + [right] + * edx = [top]*65536 + [bottom] +Returned value: + * function does not return value +Remarks: + * (left,top) are coordinates of the left upper corner, + (right,bottom) are coordinates of the right lower one. + * If parameters are set incorrectly then background is not redrawn. + ====================================================================== =============== Function 16 - save ramdisk on a floppy. ============== ====================================================================== diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 226592e2e..7b2fddd23 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -2425,10 +2425,9 @@ sys_background: cmp ebx, 1 ; BACKGROUND SIZE jnz nosb1 test ecx, ecx -; cmp ecx,0 jz sbgrr + test edx, edx -; cmp edx,0 jz sbgrr ;-------------------------------------- align 4 @@ -2698,6 +2697,49 @@ nosb7: ;------------------------------------------------------------------------------ align 4 nosb8: + cmp ebx, 9 + jnz nosb9 +; ecx = [left]*65536 + [right] +; edx = [top]*65536 + [bottom] + mov eax, [Screen_Max_X] + mov ebx, [Screen_Max_Y] +; check [right] + cmp cx, ax + ja .exit +; check [left] + ror ecx, 16 + cmp cx, ax + ja .exit +; check [bottom] + cmp dx, bx + ja .exit +; check [top] + ror edx, 16 + cmp dx, bx + ja .exit + + movzx eax, cx ; [left] + movzx ebx, dx ; [top] + + shr ecx, 16 ; [right] + shr edx, 16 ; [bottom] + + mov [background_defined], 1 + + mov [draw_data+32 + RECT.left], eax + mov [draw_data+32 + RECT.top], ebx + + mov [draw_data+32 + RECT.right], ecx + mov [draw_data+32 + RECT.bottom], edx + + inc byte[REDRAW_BACKGROUND] +;-------------------------------------- +align 4 +.exit: + ret +;------------------------------------------------------------------------------ +align 4 +nosb9: ret ;------------------------------------------------------------------------------ align 4