diff --git a/kernel/trunk/core/syscall.inc b/kernel/trunk/core/syscall.inc index 773aca85a3..8c1c206da7 100644 --- a/kernel/trunk/core/syscall.inc +++ b/kernel/trunk/core/syscall.inc @@ -154,7 +154,7 @@ iglobal dd undefined_syscall ; 31-reserved dd undefined_syscall ; 32-reserved dd undefined_syscall ; 33-reserved - dd undefined_syscall ; 34-reserved + dd syscall_getpixel_WinMap ; 34-GetPixel WinMap dd syscall_getpixel ; 35-GetPixel dd syscall_getarea ; 36-GetArea dd readmousepos ; 37-GetMousePosition_ScreenRelative,. diff --git a/kernel/trunk/docs/sysfuncr.txt b/kernel/trunk/docs/sysfuncr.txt index d565c28853..a5d834be91 100644 --- a/kernel/trunk/docs/sysfuncr.txt +++ b/kernel/trunk/docs/sysfuncr.txt @@ -1723,6 +1723,19 @@ dd 1675 * При создании процесса/потока текущая папка наследуется от родителя. +====================================================================== +========= Функция 34 - узнать кому принадлежит точка экрана. ========= +====================================================================== +Параметры: + * eax = 34 - номер функции + * ebx = x-координата (относительно экрана) + * ecx = y-координата (относительно экрана) + +Возвращаемое значение: + * eax = 0x000000XX - точка принадлежит слоту окна N + При некорректных значениях ebx и ecx функция возвращает 0 + * Функция берет значения из области [_WinMapAddress] + ====================================================================== ============ Функция 35 - прочитать цвет точки на экране. ============ ====================================================================== diff --git a/kernel/trunk/docs/sysfuncs.txt b/kernel/trunk/docs/sysfuncs.txt index 91351a153d..0fa5cc156f 100644 --- a/kernel/trunk/docs/sysfuncs.txt +++ b/kernel/trunk/docs/sysfuncs.txt @@ -1701,6 +1701,19 @@ Remarks: * At process/thread creation the current folder will be inherited from the parent. +====================================================================== +========= Function 34 - who owner the pixel on the screen. =========== +====================================================================== +Parameters: + * eax = 34 - function number + * ebx = x-coordinate (relative to the display) + * ecx = y-coordinate (relative to the display) + +Returned value: + * eax = 0x000000XX - owner of pixel the slot window N + If incorrect values ebx and ecx then function returns 0 + * The function takes the value from the area [_WinMapAddress] + ====================================================================== ======= Function 35 - read the color of a pixel on the screen. ======= ====================================================================== diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 4b81afd3bb..830fd604c6 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -4672,9 +4672,28 @@ syscall_cdaudio: ; CD call .free ; pop eax ret - +;----------------------------------------------------------------------------- +align 4 +syscall_getpixel_WinMap: ; GetPixel WinMap + cmp ebx, [Screen_Max_X] + jbe @f + cmp ecx, [Screen_Max_Y] + jbe @f + xor eax, eax + jmp .store +;-------------------------------------- +align 4 +@@: + mov eax, [d_width_calc_area + ecx*4] + add eax, [_WinMapAddress] + movzx eax, byte[eax+ebx] ; get value for current point +;-------------------------------------- +align 4 +.store: + mov [esp + 32], eax + ret +;----------------------------------------------------------------------------- align 4 - syscall_getpixel: ; GetPixel mov ecx, [Screen_Max_X] inc ecx