61 system function.

git-svn-id: svn://kolibrios.org@1497 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Alexey Teplov ( 2010-06-16 15:56:03 +00:00
parent 229210896d
commit c30c9e5b52
2 changed files with 31 additions and 19 deletions

View File

@ -163,7 +163,7 @@ iglobal
dd file_system ; 58-Common file system interface
dd 0
dd 0
dd sys_gs ; 61-Direct graphics access
dd 0
dd sys_pci ; 62-PCI functions
dd sys_msg_board ; 63-System message board
@ -234,7 +234,7 @@ iglobal
dd cross_order ; 58-Common file system interface
dd undefined_syscall ; 59-reserved
dd sys_IPC ; 60-Inter Process Communication
dd cross_order ; 61-Direct graphics access
dd sys_gs ; 61-Direct graphics access
dd cross_order ; 62-PCI functions
dd cross_order ; 63-System message board
dd sys_resize_app_memory ; 64-Resize application memory usage

View File

@ -4569,35 +4569,47 @@ sys_process_def:
mov [esp+32], edx
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 61 sys function. ;;
;; in eax=61,ebx in [1..3] ;;
;; out eax ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
iglobal
align 4
f61call:
dd sys_gs.1 ; resolution
dd sys_gs.2 ; bits per pixel
dd sys_gs.3 ; bytes per scanline
endg
align 4
sys_gs: ; direct screen access
dec ebx
cmp ebx,2
ja .not_support
jmp dword [f61call+ebx*4]
.not_support:
or [esp+32],dword -1
ret
cmp eax,1 ; resolution
jne no_gs1
.1: ; resolution
mov eax,[Screen_Max_X]
shl eax,16
mov ax,[Screen_Max_Y]
add eax,0x00010001
mov [esp+36],eax
mov [esp+32],eax
ret
no_gs1:
cmp eax,2 ; bits per pixel
jne no_gs2
.2: ; bits per pixel
movzx eax,byte [ScreenBPP]
mov [esp+36],eax
mov [esp+32],eax
ret
no_gs2:
cmp eax,3 ; bytes per scanline
jne no_gs3
.3: ; bytes per scanline
mov eax,[BytesPerScanLine]
mov [esp+36],eax
ret
no_gs3:
or [esp+36],dword -1
mov [esp+32],eax
ret