kolibrios/programs/media/animage/trunk/files.inc
IgorA 32bb153b9f version 1.4:
- use 'libimg.obj'
- can open *.jpg and *.png files

git-svn-id: svn://kolibrios.org@6328 a494cfbc-eb01-0410-851d-a64ba20cac60
2016-03-12 20:39:39 +00:00

127 lines
3.4 KiB
PHP

;-----------------------------------------------------------
;-----------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_file:
mov [size_to_save],ecx
mov [pointer_to_data],ebx
mov [full_file_path],eax
mov esi,[full_file_path]
mov edi,filepath
mov ecx,256
rep movsd
xor eax,eax
mov ebx,[size_to_save]
mov ecx,[pointer_to_data]
mov edx,filepath
mov [file_information],dword 2
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
ret
;----------------------------------------------------------
;-------------file information structure-------------------
;----------------------------------------------------------
file_information FileInfoBlock 5,0,0,0,bufer_for_info,0,filepath
filepath rb 1040
bufer_for_info rd 10
full_file_path dd 0
where_load_file dd 0
size_to_save dd 0
pointer_to_data dd 0