30 and 43 sysfunc rewritten without cross registers call.

git-svn-id: svn://kolibrios.org@1304 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Alexey Teplov ( 2009-12-02 17:10:46 +00:00
parent 4a0abac115
commit ad63ea7013
4 changed files with 109 additions and 85 deletions

View File

@ -133,7 +133,7 @@ iglobal
dd 0
dd 0 ;
dd 0
dd sys_current_directory ; 30-Get/SetCurrentDirectory
dd 0 ; 30-Get/SetCurrentDirectory
dd 0
dd 0
dd 0
@ -142,11 +142,11 @@ iglobal
dd 0
dd 0 ; 37-GetMousePosition_ScreenRelative,.
dd 0 ; 38-DrawLine
dd sys_getbackground ; 39-GetBackgroundSize,ReadBgrData,.
dd 0 ; 39-GetBackgroundSize,ReadBgrData,.
dd 0
dd 0
dd 0
dd sys_outport ; 43-SendDeviceData
dd 0 ; 43-SendDeviceData
dd 0
dd 0
dd syscall_reserveportarea ; 46-ReservePortArea and FreePortArea
@ -212,7 +212,7 @@ iglobal
dd undefined_syscall ; 27-reserved
dd undefined_syscall ; 28-reserved
dd sys_date ; 29-GetDate
dd cross_order ; 30-Get/SetCurrentDirectory
dd sys_current_directory ; 30-Get/SetCurrentDirectory
dd undefined_syscall ; 31-reserved
dd undefined_syscall ; 32-reserved
dd undefined_syscall ; 33-reserved
@ -221,11 +221,11 @@ iglobal
dd syscall_getarea ; 36-GetArea
dd readmousepos ; 37-GetMousePosition_ScreenRelative,.
dd syscall_drawline ; 38-DrawLine
dd cross_order ; 39-GetBackgroundSize,ReadBgrData,.
dd sys_getbackground ; 39-GetBackgroundSize,ReadBgrData,.
dd set_app_param ; 40-WantEvents
dd syscall_getirqowner ; 41-GetIrqOwner
dd get_irq_data ; 42-ReadIrqData
dd cross_order ; 43-SendDeviceData
dd sys_outport ; 43-SendDeviceData
dd sys_programirq ; 44-ProgramIrqs
dd reserve_free_irq ; 45-ReserveIrq and FreeIrq
dd cross_order ; 46-ReservePortArea and FreePortArea

View File

@ -1,4 +1,4 @@
ˆ…Œ<EFBFBD>… ”“<E2809D>Šˆˆ Ž<><EFBFBD>ˆŽ<CB86><C5BD>Ž‰ ‘ˆ‘’…Œ› Kolibri 0.7.5.0
<EFBFBD><EFBFBD><EFBFBD>… ”“<E2809D><E2809C><EFBFBD><E28093> <20><><EFBFBD><E282AC><E28093><EFBFBD><EFBFBD><EFBFBD><><E28099> Kolibri 0.7.5.0+
<EFBFBD>®¬¥à ä㭪樨 ¯®¬¥é ¥âáï ¢ ॣ¨áâà eax.
‚맮¢ á¨á⥬­®© ä㭪樨 ®áãé¥á⢫ï¥âáï ª®¬ ­¤®© "int 0x40".
@ -1677,6 +1677,7 @@ dd 638
* ecx = 㪠§ â¥«ì ­  ¡ãä¥à
* edx = à §¬¥à ¡ãä¥à 
‚®§¢à é ¥¬®¥ §­ ç¥­¨¥:
* eax = - 1 ®ι¨΅<C2A8> , ― <C2A0>  β¥<CEB2>γι¥£® ―®β®<CEB2>  ¨¬¥¥β ¤«¨­­γ ΅®«¥¥ 祬 4096 ᨬΆ®«®Ά.
* eax = ¤«¨­  ¨¬¥­¨ ⥪ã饩 ¯ ¯ª¨ (¢ª«îç ï § ¢¥àè î騩 0)
‡ ¬¥ç ­¨ï:
* …᫨ à §¬¥à  ¡ãä¥à  ­¥¤®áâ â®ç­® ¤«ï ª®¯¨à®¢ ­¨ï ¢á¥£® ¨¬¥­¨,

View File

@ -967,46 +967,67 @@ process_replace_file_name:
ret
sys_current_directory:
mov esi, [current_slot]
mov esi, [esi+APPDATA.cur_dir]
mov edx, esi
dec eax
; mov esi, [current_slot]
; mov esi, [esi+APPDATA.cur_dir]
; mov edx, esi
;get lenght string of appdata.cur_dir
; mov eax, [current_slot]
; mov edi, [eax+APPDATA.cur_dir]
dec ebx
jz .set
dec eax
dec ebx
jz .get
ret
.get:
; sysfunction 30.2: [for app] eax=30,ebx=2,ecx->buffer,edx=len
; for our code: ebx->buffer,ecx=len
@@:
lodsb
test al, al
jnz @b
sub esi, edx
inc esi
mov [esp+36], esi
cmp ecx, esi
jbe @f
mov ecx, esi
@@:
cmp ecx, 1
jbe .ret
mov esi, edx
mov edi, ebx
mov al, '/'
max_cur_dir equ 0x1000
;get lenght string of appdata.cur_dir
mov eax, [current_slot]
mov edi, [eax+APPDATA.cur_dir]
mov ebx,edi
push ecx
push edi
xor eax,eax
mov ecx,max_cur_dir
repne scasb ;find zerro at and string
jcxz .error ;ecx=0 and destination buffer is too small.
sub edi,ebx ;lenght for copy
inc edi
mov [esp+32+8],edi ;return in eax
cmp edx,edi ;edi must have more than 2 (for / and 0x0)
;sourse string
pop esi
;destination string
pop edi
jb .ret
mov al,'/' ;start string with '/'
stosb
dec ecx
dec ecx
rep movsb
mov byte [edi], 0
.ret:
mov ecx,edx
rep movsb ;copy string
xor eax,eax
mov byte [edi],al ;set zerro
.ret: ret
.error: add esp,8
or dword [esp+32],-1 ;error not found zerro at string ->[eax+APPDATA.cur_dir]
ret
.set:
; sysfunction 30.1: [for app] eax=30,ebx=1,ecx->string
; for our code: ebx->string to set
; use generic resolver with APPDATA.cur_dir as destination
push 0x1000
push edx
push max_cur_dir ;0x1000
push edi ;destination
mov ebx,ecx
call get_full_file_name
ret

View File

@ -1180,60 +1180,62 @@ set_variables:
ret
align 4
;input eax=43,bl-byte of output, ecx - number of port
sys_outport:
mov edi,ebx ; separate flag for read / write
and ebx,65535
mov edi,ecx ; separate flag for read / write
and ecx,65535
mov ecx,[RESERVED_PORTS]
test ecx,ecx
jne sopl8
mov [esp+36],dword 1
mov eax,[RESERVED_PORTS]
test eax,eax
jnz .sopl8
inc eax
mov [esp+32],eax
ret
sopl8:
.sopl8:
mov edx,[TASK_BASE]
mov edx,[edx+0x4]
and ebx,65535
cld
sopl1:
;and ecx,65535
;cld - set on interrupt 0x40
.sopl1:
mov esi,ecx
mov esi,eax
shl esi,4
add esi,RESERVED_PORTS
cmp edx,[esi+0]
jne sopl2
cmp ebx,[esi+4]
jb sopl2
cmp ebx,[esi+8]
jg sopl2
jmp sopl3
sopl2:
dec ecx
jnz sopl1
mov [esp+36],dword 1
ret
sopl3:
jne .sopl2
cmp ecx,[esi+4]
jb .sopl2
cmp ecx,[esi+8]
jg .sopl2
.sopl3:
test edi,0x80000000 ; read ?
jnz sopl4
jnz .sopl4
mov dx,bx ; write
mov eax,ebx
mov dx,cx ; write
out dx,al
and [esp+36],dword 0
and [esp+32],dword 0
ret
sopl4:
.sopl2:
mov dx,bx ; read
dec eax
jnz .sopl1
inc eax
mov [esp+32],eax
ret
.sopl4:
mov dx,cx ; read
in al,dx
and eax,0xff
and [esp+36],dword 0
mov [esp+24],eax
and [esp+32],dword 0
mov [esp+20],eax
ret
display_number:
@ -2558,49 +2560,49 @@ force_redraw_background:
align 4
sys_getbackground:
cmp eax,1 ; SIZE
; cmp eax,1 ; SIZE
dec ebx
jnz nogb1
mov eax,[BgrDataWidth]
shl eax,16
mov ax,[BgrDataHeight]
mov [esp+36],eax
mov [esp+32],eax
ret
nogb1:
cmp eax,2 ; PIXEL
; cmp eax,2 ; PIXEL
dec ebx
jnz nogb2
mov eax, [img_background]
test ebx, ebx
test ecx, ecx
jz @f
cmp eax, static_background_data
jz .ret
@@:
mov ecx, [mem_BACKGROUND]
add ecx, 4095
and ecx, -4096
sub ecx, 4
cmp ebx, ecx
mov ebx, [mem_BACKGROUND]
add ebx, 4095
and ebx, -4096
sub ebx, 4
cmp ecx, ebx
ja .ret
mov eax,[ebx+eax]
mov eax,[ecx+eax]
and eax, 0xFFFFFF
mov [esp+36],eax
mov [esp+32],eax
.ret:
ret
nogb2:
cmp eax,4 ; TILED / STRETCHED
; cmp eax,4 ; TILED / STRETCHED
dec ebx
jnz nogb4
mov eax,[BgrDrawMode]
nogb4:
mov [esp+36],eax
mov [esp+32],eax
ret
align 4
sys_getkey: