Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 2514 → Rev 2515

/kernel/trunk/docs/sysfuncr.txt
609,6 → 609,23
* eax = 1 ¯à¨ ãᯥå¥, 0 ¯à¨ ®è¨¡ª¥
 
======================================================================
====================== ”ã­ªæ¨ï 15, ¯®¤äã­ªæ¨ï 8 ======================
=========== ®«ãç¨âì ª®®à¤¨­ âë ¯®á«¥¤­¥© ®âà¨á®¢ª¨ ä®­ . ============
======================================================================
 à ¬¥âàë:
* eax = 15 - ­®¬¥à ä㭪樨
* ebx = 8 - ­®¬¥à ¯®¤ä㭪樨
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = [left]*65536 + [right]
* ebx = [top]*65536 + [bottom]
‡ ¬¥ç ­¨ï:
* (left,top) - ª®®à¤¨­ âë «¥¢®£® ¢¥àå­¥£® 㣫 ,
(right,bottom) - ª®®à¤¨­ âë ¯à ¢®£® ­¨¦­¥£®.
* „«ï ¯®«ã祭¨ï ¡®«¥¥ ¤®á⮢¥à­ëå ᢥ¤¥­¨©, ­¥®¡å®¤¨¬® ¢ë§¢ âì
äã­ªæ¨î áࠧ㠯®á«¥ ¯®«ã祭¨ï ᮡëâ¨ï:
5 = § ¢¥à訫 áì ¯¥à¥à¨á®¢ª  ä®­  à ¡®ç¥£® á⮫ 
 
======================================================================
============= ”ã­ªæ¨ï 16 - á®åà ­¨âì à ¬¤¨áª ­  ¤¨áª¥âã. =============
======================================================================
 à ¬¥âàë:
/kernel/trunk/docs/sysfuncs.txt
601,6 → 601,23
* eax = 1 - success, 0 - error
 
======================================================================
===================== Function 15, subfunction 8 =====================
============= Get coordinates of last draw the background ============
======================================================================
Parameters:
* eax = 15 - function number
* ebx = 8 - subfunction number
Returned value:
* eax = [left]*65536 + [right]
* ebx = [top]*65536 + [bottom]
Remarks:
* (left,top) are coordinates of the left upper corner,
(right,bottom) are coordinates of the right lower one.
* For receiving more reliable information, call the function
immediately after the event:
5 = kernel finished redrawing of the desktop background
 
======================================================================
=============== Function 16 - save ramdisk on a floppy. ==============
======================================================================
Parameters:
/kernel/trunk/kernel.asm
2384,26 → 2384,35
dd __REV__
version_end:
endg
 
;------------------------------------------------------------------------------
align 4
sys_cachetodiskette:
cmp ebx, 1
jne .no_floppy_a_save
mov [flp_number], 1
jmp .save_image_on_floppy
;--------------------------------------
align 4
.no_floppy_a_save:
cmp ebx, 2
jne .no_floppy_b_save
mov [flp_number], 2
;--------------------------------------
align 4
.save_image_on_floppy:
call save_image
mov [esp + 32], dword 0
cmp [FDC_Status], 0
je .yes_floppy_save
;--------------------------------------
align 4
.no_floppy_b_save:
mov [esp + 32], dword 1
;--------------------------------------
align 4
.yes_floppy_save:
ret
 
;------------------------------------------------------------------------------
uglobal
; bgrchanged dd 0x0
align 4
2410,9 → 2419,9
bgrlockpid dd 0
bgrlock db 0
endg
 
;------------------------------------------------------------------------------
align 4
sys_background:
 
cmp ebx, 1 ; BACKGROUND SIZE
jnz nosb1
test ecx, ecx
2421,6 → 2430,8
test edx, edx
; cmp edx,0
jz sbgrr
;--------------------------------------
align 4
@@:
;;Maxis use atomic bts for mutexes 4.4.2009
bts dword [bgrlock], 0
2427,6 → 2438,8
jnc @f
call change_task
jmp @b
;--------------------------------------
align 4
@@:
mov [BgrDataWidth], ecx
mov [BgrDataHeight], edx
2438,6 → 2451,8
cmp eax, static_background_data
jz @f
stdcall kernel_free, eax
;--------------------------------------
align 4
@@:
; calculate RAW size
xor eax, eax
2445,10 → 2460,14
cmp [BgrDataWidth], eax
jae @f
mov [BgrDataWidth], eax
;--------------------------------------
align 4
@@:
cmp [BgrDataHeight], eax
jae @f
mov [BgrDataHeight], eax
;--------------------------------------
align 4
@@:
mov eax, [BgrDataWidth]
imul eax, [BgrDataHeight]
2466,6 → 2485,8
jz .memfailed
mov [img_background], eax
jmp .exit
;--------------------------------------
align 4
.memfailed:
; revert to static monotone data
mov [img_background], static_background_data
2474,15 → 2495,18
mov [BgrDataWidth], eax
mov [BgrDataHeight], eax
mov [mem_BACKGROUND], 4
;--------------------------------------
align 4
.exit:
popad
mov [bgrlock], 0
 
;--------------------------------------
align 4
sbgrr:
ret
 
;------------------------------------------------------------------------------
align 4
nosb1:
 
cmp ebx, 2 ; SET PIXEL
jnz nosb2
 
2491,6 → 2515,8
jz @f
cmp eax, static_background_data
jz .ret
;--------------------------------------
align 4
@@:
mov ebx, [mem_BACKGROUND]
add ebx, 4095
2504,28 → 2530,39
and edx, 0x00FFFFFF;255*256*256+255*256+255
add edx, ebx
mov [eax+ecx], edx
;--------------------------------------
align 4
.ret:
ret
;------------------------------------------------------------------------------
align 4
nosb2:
 
cmp ebx, 3 ; DRAW BACKGROUND
jnz nosb3
;--------------------------------------
align 4
draw_background_temp:
mov [background_defined], 1
call force_redraw_background
;--------------------------------------
align 4
nosb31:
ret
;------------------------------------------------------------------------------
align 4
nosb3:
 
cmp ebx, 4 ; TILED / STRETCHED
jnz nosb4
cmp ecx, [BgrDrawMode]
je nosb41
mov [BgrDrawMode], ecx
;--------------------------------------
align 4
nosb41:
ret
;------------------------------------------------------------------------------
align 4
nosb4:
 
cmp ebx, 5 ; BLOCK MOVE TO BGR
jnz nosb5
cmp [img_background], static_background_data
2534,6 → 2571,8
jnz .fin
cmp esi, 4
ja .fin
;--------------------------------------
align 4
@@:
; bughere
mov eax, ecx
2541,12 → 2580,17
add ebx, [img_background];IMG_BACKGROUND
mov ecx, esi
call memmove
;--------------------------------------
align 4
.fin:
ret
;------------------------------------------------------------------------------
align 4
nosb5:
 
cmp ebx, 6
jnz nosb6
;--------------------------------------
align 4
;;Maxis use atomic bts for mutex 4.4.2009
@@:
bts dword [bgrlock], 0
2553,6 → 2597,8
jnc @f
call change_task
jmp @b
;--------------------------------------
align 4
@@:
mov eax, [CURRENT_TASK]
mov [bgrlockpid], eax
2570,11 → 2616,15
mov ecx, [mem_BACKGROUND]
add ecx, 0xFFF
shr ecx, 12
;--------------------------------------
align 4
.z:
mov eax, [page_tabs+ebx*4]
test al, 1
jz @f
call free_page
;--------------------------------------
align 4
@@:
mov eax, [page_tabs+esi*4]
or al, PG_UW
2586,9 → 2636,13
inc esi
loop .z
ret
;--------------------------------------
align 4
.nomem:
and [bgrlockpid], 0
mov [bgrlock], 0
;------------------------------------------------------------------------------
align 4
nosb6:
cmp ebx, 7
jnz nosb7
2607,6 → 2661,8
push eax
shr ecx, 12
dec ecx
;--------------------------------------
align 4
@@:
and dword [page_tabs+eax*4], 0
mov edx, eax
2623,13 → 2679,31
and [bgrlockpid], 0
mov [bgrlock], 0
ret
;--------------------------------------
align 4
.err:
and dword [esp+32], 0
ret
 
;------------------------------------------------------------------------------
align 4
nosb7:
cmp ebx, 8
jnz nosb8
mov eax, [draw_data+32 + RECT.left]
shl eax, 16
add eax, [draw_data+32 + RECT.right]
mov [esp + 32], eax ; eax = [left]*65536 + [right]
mov eax, [draw_data+32 + RECT.top]
shl eax, 16
add eax, [draw_data+32 + RECT.bottom]
mov [esp + 20], eax ; ebx = [top]*65536 + [bottom]
ret
 
;------------------------------------------------------------------------------
align 4
nosb8:
ret
;------------------------------------------------------------------------------
align 4
force_redraw_background:
and [draw_data+32 + RECT.left], 0
and [draw_data+32 + RECT.top], 0
2641,9 → 2715,8
pop ebx eax
inc byte[REDRAW_BACKGROUND]
ret
 
;------------------------------------------------------------------------------
align 4
 
sys_getbackground:
; cmp eax,1 ; SIZE
dec ebx
2653,7 → 2726,8
mov ax, [BgrDataHeight]
mov [esp+32], eax
ret
 
;------------------------------------------------------------------------------
align 4
nogb1:
; cmp eax,2 ; PIXEL
dec ebx
2664,6 → 2738,8
jz @f
cmp eax, static_background_data
jz .ret
;--------------------------------------
align 4
@@:
mov ebx, [mem_BACKGROUND]
add ebx, 4095
2676,8 → 2752,12
 
and eax, 0xFFFFFF
mov [esp+32], eax
;--------------------------------------
align 4
.ret:
ret
;------------------------------------------------------------------------------
align 4
nogb2:
 
; cmp eax,4 ; TILED / STRETCHED
2685,12 → 2765,13
dec ebx
jnz nogb4
mov eax, [BgrDrawMode]
;--------------------------------------
align 4
nogb4:
mov [esp+32], eax
ret
 
;------------------------------------------------------------------------------
align 4
 
sys_getkey:
mov [esp + 32], dword 1
; test main buffer
2712,12 → 2793,18
mov ebx, KEY_BUFF
call memmove
pop eax
;--------------------------------------
align 4
.ret_eax:
mov [esp + 32], eax
ret
;--------------------------------------
align 4
.finish:
; test hotkeys buffer
mov ecx, hotkey_buffer
;--------------------------------------
align 4
@@:
cmp [ecx], ebx
jz .found
2725,6 → 2812,8
cmp ecx, hotkey_buffer + 120 * 8
jb @b
ret
;--------------------------------------
align 4
.found:
mov ax, [ecx + 6]
shl eax, 16
2733,11 → 2822,9
and dword [ecx + 4], 0
and dword [ecx], 0
jmp .ret_eax
 
;------------------------------------------------------------------------------
align 4
 
sys_getbutton:
 
mov ebx, [CURRENT_TASK] ; TOP OF WINDOW STACK
mov [esp + 32], dword 1
movzx ecx, word [WIN_STACK + ebx * 2]
2751,12 → 2838,12
and al, 0xFE ; delete left button bit
mov [BTN_COUNT], byte 0
mov [esp + 32], eax
;--------------------------------------
align 4
.exit:
ret
 
 
;------------------------------------------------------------------------------
align 4
 
sys_cpuusage:
 
; RETURN: