small optimize

git-svn-id: svn://kolibrios.org@6341 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2016-03-15 11:39:00 +00:00
parent 8182b75b0e
commit 2e10d14758
3 changed files with 31 additions and 123 deletions

View File

@ -1,86 +1,4 @@
;----------------------------------------------------------- ;-----------------------------------------------------------
;-----------load heading of file in memory------------------
;-----------------------------------------------------------
load_heading_of_file:
mov [where_load_file],ebx
mov [full_file_path],eax
mov esi,[full_file_path]
mov edi,filepath
mov ecx,256
rep movsd
xor eax,eax
mov ecx,[where_load_file]
mov edx,filepath
mov [file_information],eax
mov [file_information+4],eax
mov [file_information+8],eax
mov [file_information+12],dword 512
mov [file_information+16],ecx
mov [file_information+20],al
mov [file_information+21],edx
mov eax,70
mov ebx,file_information
mcall
ret
;-----------------------------------------------------------
;--------load file in memory--------------------------------
;-----------------------------------------------------------
load_file:
mov [where_load_file],ebx
mov [full_file_path],eax
mov esi,[full_file_path]
mov edi,filepath
mov ecx,256
rep movsd
xor eax,eax
mov ebx,bufer_for_info
mov ecx,filepath
mov [file_information],dword 5
mov [file_information+4],eax
mov [file_information+8],eax
mov [file_information+12],eax
mov [file_information+16],ebx
mov [file_information+20],al
mov [file_information+21],ecx
mov eax,70
mov ebx,file_information
mcall
test eax,eax
jnz error_load_file
xor eax,eax
mov ebx,[bufer_for_info+32]
mov ecx,[where_load_file]
mov edx,filepath
mov [file_information],eax
mov [file_information+4],eax
mov [file_information+8],eax
mov [file_information+12],ebx
mov [file_information+16],ecx
mov [file_information+20],al
mov [file_information+21],edx
mov eax,70
mov ebx,file_information
mcall
error_load_file:
ret
;-----------------------------------------------------------
;---------------save in file from memory-------------------- ;---------------save in file from memory--------------------
;----------------------------------------------------------- ;-----------------------------------------------------------
save_file: save_file:
@ -98,7 +16,7 @@ save_file:
mov ecx,[pointer_to_data] mov ecx,[pointer_to_data]
mov edx,filepath mov edx,filepath
mov [file_information],dword 2 mov dword[file_information],SSF_CREATE_FILE
mov [file_information+4],eax mov [file_information+4],eax
mov [file_information+8],eax mov [file_information+8],eax
mov [file_information+12],ebx mov [file_information+12],ebx
@ -106,9 +24,7 @@ save_file:
mov [file_information+20],al mov [file_information+20],al
mov [file_information+21],edx mov [file_information+21],edx
mov eax,70 mcall SF_FILE,file_information
mov ebx,file_information
mcall
ret ret

View File

@ -251,47 +251,39 @@ fps:
add ecx,edx add ecx,edx
mov edx,8*65536+20+15+49+5+1 mov edx,8*65536+20+15+49+5+1
mcall 7 mcall SF_PUT_IMAGE
ret ret
;---------------------------------------------------------- ;----------------------------------------------------------
;--------------------clear screen-------------------------- ;--------------------clear screen--------------------------
;---------------------------------------------------------- ;----------------------------------------------------------
cleare_screen: cleare_screen:
mov eax,[ScreenPointer] mov edi,[ScreenPointer]
mov ebx,[WorkScreen_SizeX] mov ebx,[WorkScreen_SizeX]
imul ebx,[WorkScreen_SizeY] imul ebx,[WorkScreen_SizeY]
lea ebx,[ebx+ebx*2] lea ebx,[ebx+ebx*2]
shr ebx,3 mov eax,0xffffffff
inc ebx mov ecx,ebx
mov esi,0xffffff shr ecx,2
rep stosd
clear_screen_loop: mov ecx,ebx
mov [eax],esi and ecx,3
mov [eax+3],esi rep stosb
mov [eax+6],si
add eax,4+4
dec ebx
jnz clear_screen_loop
ret ret
;---------------------------------------------------------- ;----------------------------------------------------------
;-------------cleare work arrea(work screen)--------------- ;-------------cleare work arrea(work screen)---------------
;---------------------------------------------------------- ;----------------------------------------------------------
cleare_work_arrea: cleare_work_arrea:
mov eax,[PointerToPicture] mov edi,[PointerToPicture]
mov ebx,[Picture_SizeX] mov ebx,[Picture_SizeX]
imul ebx,[Picture_SizeY] imul ebx,[Picture_SizeY]
lea ebx,[ebx+ebx*2] lea ebx,[ebx+ebx*2]
shr ebx,3 mov eax,0xffffffff
inc ebx mov ecx,ebx
mov esi,0xffffff shr ecx,2
rep stosd
clear_work_arrea_loop: mov ecx,ebx
mov [eax],esi and ecx,3
mov [eax+3],esi rep stosb
mov [eax+6],si
add eax,4+4
dec ebx
jnz clear_work_arrea_loop
ret ret
;----------------------------------------------------------- ;-----------------------------------------------------------
;calculate position work screen on a picture ;calculate position work screen on a picture

View File

@ -1,14 +1,14 @@
;----------------------------------------------------------- ;-----------------------------------------------------------
;-------find simvole in string------------------------------ ;-------find simvole in string------------------------------
;----------------------------------------------------------- ;-----------------------------------------------------------
find_symvol:
;input:
;eax=string ;eax=string
;ebx=symvol ;ebx=symvol
find_symvol:
mov esi,eax mov esi,eax
next_symvol: next_symvol:
xor ecx,ecx cmp byte[eax],bl
mov cl,[eax]
cmp cl,bl
je symvol_fined je symvol_fined
inc eax inc eax
jmp next_symvol jmp next_symvol