forked from KolibriOS/kolibrios
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:
parent
4a0abac115
commit
ad63ea7013
@ -133,7 +133,7 @@ iglobal
|
|||||||
dd 0
|
dd 0
|
||||||
dd 0 ;
|
dd 0 ;
|
||||||
dd 0
|
dd 0
|
||||||
dd sys_current_directory ; 30-Get/SetCurrentDirectory
|
dd 0 ; 30-Get/SetCurrentDirectory
|
||||||
dd 0
|
dd 0
|
||||||
dd 0
|
dd 0
|
||||||
dd 0
|
dd 0
|
||||||
@ -142,11 +142,11 @@ iglobal
|
|||||||
dd 0
|
dd 0
|
||||||
dd 0 ; 37-GetMousePosition_ScreenRelative,.
|
dd 0 ; 37-GetMousePosition_ScreenRelative,.
|
||||||
dd 0 ; 38-DrawLine
|
dd 0 ; 38-DrawLine
|
||||||
dd sys_getbackground ; 39-GetBackgroundSize,ReadBgrData,.
|
dd 0 ; 39-GetBackgroundSize,ReadBgrData,.
|
||||||
dd 0
|
dd 0
|
||||||
dd 0
|
dd 0
|
||||||
dd 0
|
dd 0
|
||||||
dd sys_outport ; 43-SendDeviceData
|
dd 0 ; 43-SendDeviceData
|
||||||
dd 0
|
dd 0
|
||||||
dd 0
|
dd 0
|
||||||
dd syscall_reserveportarea ; 46-ReservePortArea and FreePortArea
|
dd syscall_reserveportarea ; 46-ReservePortArea and FreePortArea
|
||||||
@ -212,7 +212,7 @@ iglobal
|
|||||||
dd undefined_syscall ; 27-reserved
|
dd undefined_syscall ; 27-reserved
|
||||||
dd undefined_syscall ; 28-reserved
|
dd undefined_syscall ; 28-reserved
|
||||||
dd sys_date ; 29-GetDate
|
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 ; 31-reserved
|
||||||
dd undefined_syscall ; 32-reserved
|
dd undefined_syscall ; 32-reserved
|
||||||
dd undefined_syscall ; 33-reserved
|
dd undefined_syscall ; 33-reserved
|
||||||
@ -221,11 +221,11 @@ iglobal
|
|||||||
dd syscall_getarea ; 36-GetArea
|
dd syscall_getarea ; 36-GetArea
|
||||||
dd readmousepos ; 37-GetMousePosition_ScreenRelative,.
|
dd readmousepos ; 37-GetMousePosition_ScreenRelative,.
|
||||||
dd syscall_drawline ; 38-DrawLine
|
dd syscall_drawline ; 38-DrawLine
|
||||||
dd cross_order ; 39-GetBackgroundSize,ReadBgrData,.
|
dd sys_getbackground ; 39-GetBackgroundSize,ReadBgrData,.
|
||||||
dd set_app_param ; 40-WantEvents
|
dd set_app_param ; 40-WantEvents
|
||||||
dd syscall_getirqowner ; 41-GetIrqOwner
|
dd syscall_getirqowner ; 41-GetIrqOwner
|
||||||
dd get_irq_data ; 42-ReadIrqData
|
dd get_irq_data ; 42-ReadIrqData
|
||||||
dd cross_order ; 43-SendDeviceData
|
dd sys_outport ; 43-SendDeviceData
|
||||||
dd sys_programirq ; 44-ProgramIrqs
|
dd sys_programirq ; 44-ProgramIrqs
|
||||||
dd reserve_free_irq ; 45-ReserveIrq and FreeIrq
|
dd reserve_free_irq ; 45-ReserveIrq and FreeIrq
|
||||||
dd cross_order ; 46-ReservePortArea and FreePortArea
|
dd cross_order ; 46-ReservePortArea and FreePortArea
|
||||||
|
@ -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.
|
<EFBFBD>®¬¥à äãªæ¨¨ ¯®¬¥é ¥âáï ¢ ॣ¨áâà eax.
|
||||||
‚맮¢ á¨á⥬®© äãªæ¨¨ ®áãé¥á⢫ï¥âáï ª®¬ ¤®© "int 0x40".
|
‚맮¢ á¨á⥬®© äãªæ¨¨ ®áãé¥á⢫ï¥âáï ª®¬ ¤®© "int 0x40".
|
||||||
@ -1677,6 +1677,7 @@ dd 638
|
|||||||
* ecx = 㪠§ â¥«ì ¡ãä¥à
|
* ecx = 㪠§ â¥«ì ¡ãä¥à
|
||||||
* edx = à §¬¥à ¡ãä¥à
|
* edx = à §¬¥à ¡ãä¥à
|
||||||
‚®§¢à é ¥¬®¥ § 票¥:
|
‚®§¢à é ¥¬®¥ § 票¥:
|
||||||
|
* eax = - 1 ®ι¨΅<C2A8> , ― ―<C2A0> β¥<CEB2>γι¥£® ―®β®<CEB2> ¨¬¥¥β ¤«¨γ ΅®«¥¥ 祬 4096 ᨬΆ®«®Ά.
|
||||||
* eax = ¤«¨ ¨¬¥¨ ⥪ã饩 ¯ ¯ª¨ (¢ª«îç ï § ¢¥àè î騩 0)
|
* eax = ¤«¨ ¨¬¥¨ ⥪ã饩 ¯ ¯ª¨ (¢ª«îç ï § ¢¥àè î騩 0)
|
||||||
‡ ¬¥ç ¨ï:
|
‡ ¬¥ç ¨ï:
|
||||||
* …᫨ à §¬¥à ¡ãä¥à ¥¤®áâ â®ç® ¤«ï ª®¯¨à®¢ ¨ï ¢á¥£® ¨¬¥¨,
|
* …᫨ à §¬¥à ¡ãä¥à ¥¤®áâ â®ç® ¤«ï ª®¯¨à®¢ ¨ï ¢á¥£® ¨¬¥¨,
|
||||||
|
@ -967,46 +967,67 @@ process_replace_file_name:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
sys_current_directory:
|
sys_current_directory:
|
||||||
mov esi, [current_slot]
|
; mov esi, [current_slot]
|
||||||
mov esi, [esi+APPDATA.cur_dir]
|
; mov esi, [esi+APPDATA.cur_dir]
|
||||||
mov edx, esi
|
; mov edx, esi
|
||||||
dec eax
|
|
||||||
|
;get lenght string of appdata.cur_dir
|
||||||
|
; mov eax, [current_slot]
|
||||||
|
; mov edi, [eax+APPDATA.cur_dir]
|
||||||
|
|
||||||
|
dec ebx
|
||||||
jz .set
|
jz .set
|
||||||
dec eax
|
dec ebx
|
||||||
jz .get
|
jz .get
|
||||||
ret
|
ret
|
||||||
.get:
|
.get:
|
||||||
; sysfunction 30.2: [for app] eax=30,ebx=2,ecx->buffer,edx=len
|
; sysfunction 30.2: [for app] eax=30,ebx=2,ecx->buffer,edx=len
|
||||||
; for our code: ebx->buffer,ecx=len
|
; for our code: ebx->buffer,ecx=len
|
||||||
@@:
|
max_cur_dir equ 0x1000
|
||||||
lodsb
|
;get lenght string of appdata.cur_dir
|
||||||
test al, al
|
mov eax, [current_slot]
|
||||||
jnz @b
|
mov edi, [eax+APPDATA.cur_dir]
|
||||||
sub esi, edx
|
|
||||||
inc esi
|
mov ebx,edi
|
||||||
mov [esp+36], esi
|
|
||||||
cmp ecx, esi
|
push ecx
|
||||||
jbe @f
|
push edi
|
||||||
mov ecx, esi
|
|
||||||
@@:
|
xor eax,eax
|
||||||
cmp ecx, 1
|
mov ecx,max_cur_dir
|
||||||
jbe .ret
|
|
||||||
mov esi, edx
|
repne scasb ;find zerro at and string
|
||||||
mov edi, ebx
|
jcxz .error ;ecx=0 and destination buffer is too small.
|
||||||
mov al, '/'
|
|
||||||
|
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
|
stosb
|
||||||
dec ecx
|
mov ecx,edx
|
||||||
dec ecx
|
rep movsb ;copy string
|
||||||
rep movsb
|
xor eax,eax
|
||||||
mov byte [edi], 0
|
mov byte [edi],al ;set zerro
|
||||||
.ret:
|
.ret: ret
|
||||||
|
|
||||||
|
.error: add esp,8
|
||||||
|
or dword [esp+32],-1 ;error not found zerro at string ->[eax+APPDATA.cur_dir]
|
||||||
ret
|
ret
|
||||||
.set:
|
.set:
|
||||||
; sysfunction 30.1: [for app] eax=30,ebx=1,ecx->string
|
; sysfunction 30.1: [for app] eax=30,ebx=1,ecx->string
|
||||||
; for our code: ebx->string to set
|
; for our code: ebx->string to set
|
||||||
; use generic resolver with APPDATA.cur_dir as destination
|
; use generic resolver with APPDATA.cur_dir as destination
|
||||||
push 0x1000
|
push max_cur_dir ;0x1000
|
||||||
push edx
|
push edi ;destination
|
||||||
|
mov ebx,ecx
|
||||||
call get_full_file_name
|
call get_full_file_name
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
@ -1180,60 +1180,62 @@ set_variables:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
|
;input eax=43,bl-byte of output, ecx - number of port
|
||||||
sys_outport:
|
sys_outport:
|
||||||
|
|
||||||
mov edi,ebx ; separate flag for read / write
|
mov edi,ecx ; separate flag for read / write
|
||||||
and ebx,65535
|
and ecx,65535
|
||||||
|
|
||||||
mov ecx,[RESERVED_PORTS]
|
mov eax,[RESERVED_PORTS]
|
||||||
test ecx,ecx
|
test eax,eax
|
||||||
jne sopl8
|
jnz .sopl8
|
||||||
mov [esp+36],dword 1
|
inc eax
|
||||||
|
mov [esp+32],eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
sopl8:
|
.sopl8:
|
||||||
mov edx,[TASK_BASE]
|
mov edx,[TASK_BASE]
|
||||||
mov edx,[edx+0x4]
|
mov edx,[edx+0x4]
|
||||||
and ebx,65535
|
;and ecx,65535
|
||||||
cld
|
;cld - set on interrupt 0x40
|
||||||
sopl1:
|
.sopl1:
|
||||||
|
|
||||||
mov esi,ecx
|
mov esi,eax
|
||||||
shl esi,4
|
shl esi,4
|
||||||
add esi,RESERVED_PORTS
|
add esi,RESERVED_PORTS
|
||||||
cmp edx,[esi+0]
|
cmp edx,[esi+0]
|
||||||
jne sopl2
|
jne .sopl2
|
||||||
cmp ebx,[esi+4]
|
cmp ecx,[esi+4]
|
||||||
jb sopl2
|
jb .sopl2
|
||||||
cmp ebx,[esi+8]
|
cmp ecx,[esi+8]
|
||||||
jg sopl2
|
jg .sopl2
|
||||||
jmp sopl3
|
.sopl3:
|
||||||
|
|
||||||
sopl2:
|
|
||||||
|
|
||||||
dec ecx
|
|
||||||
jnz sopl1
|
|
||||||
mov [esp+36],dword 1
|
|
||||||
ret
|
|
||||||
|
|
||||||
sopl3:
|
|
||||||
|
|
||||||
test edi,0x80000000 ; read ?
|
test edi,0x80000000 ; read ?
|
||||||
jnz sopl4
|
jnz .sopl4
|
||||||
|
|
||||||
mov dx,bx ; write
|
mov eax,ebx
|
||||||
|
mov dx,cx ; write
|
||||||
out dx,al
|
out dx,al
|
||||||
and [esp+36],dword 0
|
and [esp+32],dword 0
|
||||||
ret
|
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
|
in al,dx
|
||||||
and eax,0xff
|
and eax,0xff
|
||||||
and [esp+36],dword 0
|
and [esp+32],dword 0
|
||||||
mov [esp+24],eax
|
mov [esp+20],eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
display_number:
|
display_number:
|
||||||
@ -2558,49 +2560,49 @@ force_redraw_background:
|
|||||||
align 4
|
align 4
|
||||||
|
|
||||||
sys_getbackground:
|
sys_getbackground:
|
||||||
|
; cmp eax,1 ; SIZE
|
||||||
cmp eax,1 ; SIZE
|
dec ebx
|
||||||
jnz nogb1
|
jnz nogb1
|
||||||
mov eax,[BgrDataWidth]
|
mov eax,[BgrDataWidth]
|
||||||
shl eax,16
|
shl eax,16
|
||||||
mov ax,[BgrDataHeight]
|
mov ax,[BgrDataHeight]
|
||||||
mov [esp+36],eax
|
mov [esp+32],eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
nogb1:
|
nogb1:
|
||||||
|
; cmp eax,2 ; PIXEL
|
||||||
cmp eax,2 ; PIXEL
|
dec ebx
|
||||||
jnz nogb2
|
jnz nogb2
|
||||||
|
|
||||||
mov eax, [img_background]
|
mov eax, [img_background]
|
||||||
test ebx, ebx
|
test ecx, ecx
|
||||||
jz @f
|
jz @f
|
||||||
cmp eax, static_background_data
|
cmp eax, static_background_data
|
||||||
jz .ret
|
jz .ret
|
||||||
@@:
|
@@:
|
||||||
mov ecx, [mem_BACKGROUND]
|
mov ebx, [mem_BACKGROUND]
|
||||||
add ecx, 4095
|
add ebx, 4095
|
||||||
and ecx, -4096
|
and ebx, -4096
|
||||||
sub ecx, 4
|
sub ebx, 4
|
||||||
cmp ebx, ecx
|
cmp ecx, ebx
|
||||||
ja .ret
|
ja .ret
|
||||||
|
|
||||||
mov eax,[ebx+eax]
|
mov eax,[ecx+eax]
|
||||||
|
|
||||||
and eax, 0xFFFFFF
|
and eax, 0xFFFFFF
|
||||||
mov [esp+36],eax
|
mov [esp+32],eax
|
||||||
.ret:
|
.ret:
|
||||||
ret
|
ret
|
||||||
nogb2:
|
nogb2:
|
||||||
|
|
||||||
cmp eax,4 ; TILED / STRETCHED
|
; cmp eax,4 ; TILED / STRETCHED
|
||||||
|
dec ebx
|
||||||
jnz nogb4
|
jnz nogb4
|
||||||
mov eax,[BgrDrawMode]
|
mov eax,[BgrDrawMode]
|
||||||
nogb4:
|
nogb4:
|
||||||
mov [esp+36],eax
|
mov [esp+32],eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
|
|
||||||
sys_getkey:
|
sys_getkey:
|
||||||
|
Loading…
Reference in New Issue
Block a user