forked from KolibriOS/kolibrios
1) fix in system macro 'copy_path'
2) optimize program 'info3ds' git-svn-id: svn://kolibrios.org@5881 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
4caeaae3c6
commit
b1f79255ce
@ -5,8 +5,6 @@ if not exist bin mkdir bin
|
|||||||
if not exist bin\tl_sys_16.png @copy tl_sys_16.png bin\tl_sys_16.png
|
if not exist bin\tl_sys_16.png @copy tl_sys_16.png bin\tl_sys_16.png
|
||||||
if not exist bin\toolbar.png @copy toolbar.png bin\toolbar.png
|
if not exist bin\toolbar.png @copy toolbar.png bin\toolbar.png
|
||||||
if not exist bin\font8x9.bmp @copy ..\..\fs\kfar\trunk\font8x9.bmp bin\font8x9.bmp
|
if not exist bin\font8x9.bmp @copy ..\..\fs\kfar\trunk\font8x9.bmp bin\font8x9.bmp
|
||||||
@fasm.exe -m 16384 ..\libraries\buf2d\trunk\buf2d.asm bin\buf2d.obj
|
|
||||||
@kpack bin\buf2d.obj
|
|
||||||
@fasm.exe -m 16384 info3ds.asm bin\info3ds.kex
|
@fasm.exe -m 16384 info3ds.asm bin\info3ds.kex
|
||||||
@kpack bin\info3ds.kex
|
@kpack bin\info3ds.kex
|
||||||
pause
|
pause
|
@ -5,8 +5,6 @@ if not exist bin mkdir bin
|
|||||||
if not exist bin\tl_sys_16.png @copy tl_sys_16.png bin\tl_sys_16.png
|
if not exist bin\tl_sys_16.png @copy tl_sys_16.png bin\tl_sys_16.png
|
||||||
if not exist bin\toolbar.png @copy toolbar.png bin\toolbar.png
|
if not exist bin\toolbar.png @copy toolbar.png bin\toolbar.png
|
||||||
if not exist bin\font8x9.bmp @copy ..\..\fs\kfar\trunk\font8x9.bmp bin\font8x9.bmp
|
if not exist bin\font8x9.bmp @copy ..\..\fs\kfar\trunk\font8x9.bmp bin\font8x9.bmp
|
||||||
@fasm.exe -m 16384 ..\libraries\buf2d\trunk\buf2d.asm bin\buf2d.obj
|
|
||||||
@kpack bin\buf2d.obj
|
|
||||||
@fasm.exe -m 16384 info3ds.asm bin\info3ds.kex
|
@fasm.exe -m 16384 info3ds.asm bin\info3ds.kex
|
||||||
@kpack bin\info3ds.kex
|
@kpack bin\info3ds.kex
|
||||||
pause
|
pause
|
@ -1,7 +1,7 @@
|
|||||||
if lang eq ru
|
if lang eq ru
|
||||||
capt db 'info 3ds ¢¥àá¨ï 06.12.13',0 ;¯®¤¯¨áì ®ª
|
capt db 'info 3ds ¢¥àá¨ï 05.11.15',0 ;¯®¤¯¨áì ®ª
|
||||||
else
|
else
|
||||||
capt db 'info 3ds version 06.12.13',0 ;window caption
|
capt db 'info 3ds version 05.11.15',0 ;window caption
|
||||||
end if
|
end if
|
||||||
|
|
||||||
MAX_FILE_LEVEL equ 20 ;¬ ªá¨¬ «ìë© ã஢¥ì ¢«®¦¥®á⨠¡«®ª®¢ ¤«ï «¨§
|
MAX_FILE_LEVEL equ 20 ;¬ ªá¨¬ «ìë© ã஢¥ì ¢«®¦¥®á⨠¡«®ª®¢ ¤«ï «¨§
|
||||||
|
@ -32,7 +32,7 @@ struct FileInfoBlock
|
|||||||
ends
|
ends
|
||||||
|
|
||||||
run_file_70 FileInfoBlock
|
run_file_70 FileInfoBlock
|
||||||
image_data dd 0 ;㪠§ â¥«ì ¢à¥¬¥ãî ¯ ¬ïâì. ¤«ï 㦥 ¯à¥®¡à §®¢ ¨ï ¨§®¡à ¦¥¨ï
|
image_data dd 0 ;㪠§ â¥«ì ¢à¥¬¥ãî ¯ ¬ïâì, 㦥 ¤«ï ¯à¥®¡à §®¢ ¨ï ¨§®¡à ¦¥¨ï
|
||||||
open_file_lif dd 0 ;㪠§ â¥«ì ¯ ¬ïâì ¤«ï ®âªàëâ¨ï ä ©«®¢ 3ds
|
open_file_lif dd 0 ;㪠§ â¥«ì ¯ ¬ïâì ¤«ï ®âªàëâ¨ï ä ©«®¢ 3ds
|
||||||
open_file_size dd 0 ;à §¬¥à ®âªàë⮣® ä ©«
|
open_file_size dd 0 ;à §¬¥à ®âªàë⮣® ä ©«
|
||||||
|
|
||||||
@ -58,9 +58,9 @@ macro load_image_file path,buf,size { ;
|
|||||||
db 0
|
db 0
|
||||||
@@:
|
@@:
|
||||||
;32 - áâ ¤ àâë© ¤à¥á ¯® ª®â®à®¬ã ¤®«¦¥ ¡ëâì ¡ãä¥à á á¨áâ¥¬ë¬ ¯ã⥬
|
;32 - áâ ¤ àâë© ¤à¥á ¯® ª®â®à®¬ã ¤®«¦¥ ¡ëâì ¡ãä¥à á á¨áâ¥¬ë¬ ¯ã⥬
|
||||||
copy_path .path_str,[32],file_name,0x0
|
copy_path .path_str,[32],file_name,0
|
||||||
else
|
else
|
||||||
copy_path path,[32],file_name,0x0 ;ä®à¬¨à㥬 ¯®«ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ® ¢ ®¤®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
|
copy_path path,[32],file_name,0 ;ä®à¬¨à㥬 ¯®«ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ® ¢ ®¤®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
|
||||||
end if
|
end if
|
||||||
|
|
||||||
stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥¨ï
|
stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥¨ï
|
||||||
@ -121,8 +121,17 @@ include 'info_wnd_coords.inc'
|
|||||||
align 4
|
align 4
|
||||||
start:
|
start:
|
||||||
load_libraries l_libs_start,l_libs_end
|
load_libraries l_libs_start,l_libs_end
|
||||||
;¯à®¢¥àª ᪮«ìª® ã¤ ç® § £ã§¨« áì è «¨¡
|
;¯à®¢¥àª ᪮«ìª® ã¤ ç® § £ã§¨«¨áì ¡¨¡«¨®â¥ª¨
|
||||||
mov ebp,lib_7
|
mov ebp,lib_0
|
||||||
|
cmp dword [ebp+ll_struc_size-4],0
|
||||||
|
jz @f
|
||||||
|
mov ebp,lib_1
|
||||||
|
cmp dword [ebp+ll_struc_size-4],0
|
||||||
|
jz @f
|
||||||
|
mov ebp,lib_2
|
||||||
|
cmp dword [ebp+ll_struc_size-4],0
|
||||||
|
jz @f
|
||||||
|
mov ebp,lib_3
|
||||||
cmp dword [ebp+ll_struc_size-4],0
|
cmp dword [ebp+ll_struc_size-4],0
|
||||||
jz @f
|
jz @f
|
||||||
mcall -1 ;exit not correct
|
mcall -1 ;exit not correct
|
||||||
@ -205,11 +214,7 @@ align 4
|
|||||||
timer_funct:
|
timer_funct:
|
||||||
pushad
|
pushad
|
||||||
if debug
|
if debug
|
||||||
mov eax,4
|
mcall 4, (5 shl 16)+8, 0xff+0x80000000, txt_0002
|
||||||
mov ebx,(5 shl 16)+8
|
|
||||||
mov ecx,0xff+0x80000000
|
|
||||||
mov edx,txt_0002
|
|
||||||
int 0x40
|
|
||||||
end if
|
end if
|
||||||
mcall 26,9
|
mcall 26,9
|
||||||
mov [last_time],eax
|
mov [last_time],eax
|
||||||
@ -423,22 +428,27 @@ button:
|
|||||||
cmp ah,3
|
cmp ah,3
|
||||||
jne @f
|
jne @f
|
||||||
call but_new_file
|
call but_new_file
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,4
|
cmp ah,4
|
||||||
jne @f
|
jne @f
|
||||||
call but_open_file
|
call but_open_file
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,5
|
cmp ah,5
|
||||||
jne @f
|
jne @f
|
||||||
call but_save_file
|
call but_save_file
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,6
|
cmp ah,6
|
||||||
jne @f
|
jne @f
|
||||||
call but_wnd_coords
|
call but_wnd_coords
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
cmp ah,7
|
cmp ah,7
|
||||||
jne @f
|
jne @f
|
||||||
call but_delete_chunk
|
call but_delete_chunk
|
||||||
|
jmp still
|
||||||
@@:
|
@@:
|
||||||
|
|
||||||
cmp ah,1
|
cmp ah,1
|
||||||
@ -465,8 +475,8 @@ but_new_file:
|
|||||||
|
|
||||||
align 4
|
align 4
|
||||||
but_open_file:
|
but_open_file:
|
||||||
pushad
|
|
||||||
copy_path open_dialog_name,communication_area_default_path,file_name,0
|
copy_path open_dialog_name,communication_area_default_path,file_name,0
|
||||||
|
pushad
|
||||||
mov [OpenDialog_data.type],0
|
mov [OpenDialog_data.type],0
|
||||||
stdcall [OpenDialog_Start],OpenDialog_data
|
stdcall [OpenDialog_Start],OpenDialog_data
|
||||||
cmp [OpenDialog_data.status],2
|
cmp [OpenDialog_data.status],2
|
||||||
@ -952,9 +962,8 @@ but_delete_chunk:
|
|||||||
;output:
|
;output:
|
||||||
; eax - ç¨á«®
|
; eax - ç¨á«®
|
||||||
align 4
|
align 4
|
||||||
proc conv_str_to_int, buf:dword
|
proc conv_str_to_int uses ebx ecx esi, buf:dword
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
push ebx ecx esi
|
|
||||||
xor ebx,ebx
|
xor ebx,ebx
|
||||||
mov esi,[buf]
|
mov esi,[buf]
|
||||||
;®¯à¥¤¥«¥¨¥ ®âà¨æ ⥫ìëå ç¨á¥«
|
;®¯à¥¤¥«¥¨¥ ®âà¨æ ⥫ìëå ç¨á¥«
|
||||||
@ -1016,7 +1025,6 @@ proc conv_str_to_int, buf:dword
|
|||||||
sub ecx,eax
|
sub ecx,eax
|
||||||
mov eax,ecx
|
mov eax,ecx
|
||||||
@@:
|
@@:
|
||||||
pop esi ecx ebx
|
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
@ -1079,20 +1087,20 @@ lib_name_2 db 'box_lib.obj',0
|
|||||||
err_msg_found_lib_2 db '<27>¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'box_lib.obj',39,0
|
err_msg_found_lib_2 db '<27>¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'box_lib.obj',39,0
|
||||||
err_msg_import_2 db 'Žè¨¡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'box_lib',39,0
|
err_msg_import_2 db 'Žè¨¡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'box_lib',39,0
|
||||||
|
|
||||||
system_dir_7 db '/sys/lib/'
|
system_dir_3 db '/sys/lib/'
|
||||||
lib_name_7 db 'buf2d.obj',0
|
lib_name_3 db 'buf2d.obj',0
|
||||||
err_msg_found_lib_7 db '<27>¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'buf2d.obj',39,0
|
err_msg_found_lib_3 db '<27>¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'buf2d.obj',39,0
|
||||||
err_msg_import_7 db 'Žè¨¡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'buf2d',39,0
|
err_msg_import_3 db 'Žè¨¡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'buf2d',39,0
|
||||||
|
|
||||||
l_libs_start:
|
l_libs_start:
|
||||||
lib0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
|
lib_0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
|
||||||
err_message_found_lib_0, head_f_l, proclib_import,err_message_import_0, head_f_i
|
err_message_found_lib_0, head_f_l, proclib_import,err_message_import_0, head_f_i
|
||||||
lib1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\
|
lib_1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\
|
||||||
err_message_found_lib_1, head_f_l, import_libimg, err_message_import_1, head_f_i
|
err_message_found_lib_1, head_f_l, import_libimg, err_message_import_1, head_f_i
|
||||||
lib_2 l_libs lib_name_2, sys_path, library_path, system_dir_2,\
|
lib_2 l_libs lib_name_2, sys_path, library_path, system_dir_2,\
|
||||||
err_msg_found_lib_2,head_f_l,import_box_lib,err_msg_import_2,head_f_i
|
err_msg_found_lib_2,head_f_l,import_box_lib,err_msg_import_2,head_f_i
|
||||||
lib_7 l_libs lib_name_7, sys_path, library_path, system_dir_7,\
|
lib_3 l_libs lib_name_3, sys_path, library_path, system_dir_3,\
|
||||||
err_msg_found_lib_7,head_f_l,import_buf2d,err_msg_import_7,head_f_i
|
err_msg_found_lib_3,head_f_l,import_buf2d,err_msg_import_3,head_f_i
|
||||||
l_libs_end:
|
l_libs_end:
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
@ -1327,37 +1335,7 @@ rb 2+2+2+2+4+4+4+4+4+4
|
|||||||
.ar_offset dd 1 ;+84
|
.ar_offset dd 1 ;+84
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;íâ®â ª®¤ ¥ ¬®©, ® ¯à¥®¡à §ã¥â ç¨á«® ¢ áâபã
|
|
||||||
;input:
|
|
||||||
; eax = value
|
|
||||||
; edi = string buffer
|
|
||||||
;output:
|
|
||||||
align 4
|
align 4
|
||||||
tl_convert_to_str:
|
|
||||||
pushad
|
|
||||||
mov dword[edi+1],0;0x20202020
|
|
||||||
call .str
|
|
||||||
popad
|
|
||||||
ret
|
|
||||||
|
|
||||||
align 4
|
|
||||||
.str:
|
|
||||||
mov ecx,0x0a ;§ ¤ ¥âáï á¨á⥬ áç¨á«¥¨ï ¨§¬¥ïîâáï ॣ¨áâàë ebx,eax,ecx,edx ¢å®¤ë¥ ¯ à ¬¥âàë eax - ç¨á«®
|
|
||||||
;¯à¥à¥¢®¤ ç¨á« ¢ ASCII áâப㠢§®¤ë¥ ¤ ë¥ ecx=á¨á⥬ áç¨á«¥ï edi ¤à¥á ªã¤ § ¯¨áë¢ âì, ¡ã¤¥¬ áâபã, ¯à¨ç¥¬ ª®¥æ ¯¥à¥¬¥®©
|
|
||||||
cmp eax,ecx ;áà ¢¨âì ¥á«¨ ¢ eax ¬¥ìè¥ ç¥¬ ¢ ecx â® ¯¥à¥©â¨ @@-1 â.¥. pop eax
|
|
||||||
jb @f
|
|
||||||
xor edx,edx ;®ç¨áâ¨âì edx
|
|
||||||
div ecx ;à §¤¥«¨âì - ®áâ ⮪ ¢ edx
|
|
||||||
push edx ;¯®«®¦¨âì ¢ á⥪
|
|
||||||
;dec edi ;ᬥ饨¥ ¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®æ áâப¨
|
|
||||||
call .str ;¯¥à¥©â¨ á ¬ã ᥡï â.¥. ¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥â ¯®ª ¢ eax ¥ á⠥⠬¥ìè¥ ç¥¬ ¢ ecx
|
|
||||||
pop eax
|
|
||||||
@@: ;cmp al,10 ;¯à®¢¥à¨âì ¥ ¬¥ìè¥ «¨ § 票¥ ¢ al 祬 10 (¤«ï á¨á⥬ë áç¨á«¥ï 10 ¤ ï ª®¬ ¤ - «¨è ï))
|
|
||||||
or al,0x30 ;¤ ï ª®¬ ¤ ª®à®ç¥ 祬 ¤¢¥ ¢ëè¥
|
|
||||||
stosb ;§ ¯¨á âì í«¥¬¥â ¨§ ॣ¨áâà al ¢ ï祪㠯 ¬ï⨠es:edi
|
|
||||||
ret ;¢¥àãâìáï ç¥ì ¨â¥à¥áë© å®¤ â.ª. ¯®ª ¢ á⥪¥ åà ¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï
|
|
||||||
|
|
||||||
i_end:
|
i_end:
|
||||||
rb 1024
|
rb 1024
|
||||||
thread_coords:
|
thread_coords:
|
||||||
@ -1365,7 +1343,7 @@ thread_coords:
|
|||||||
stacktop:
|
stacktop:
|
||||||
sys_path rb 1024
|
sys_path rb 1024
|
||||||
file_name:
|
file_name:
|
||||||
rb 1024 ;4096
|
rb 4096
|
||||||
library_path rb 1024
|
library_path rb 1024
|
||||||
plugin_path rb 4096
|
plugin_path rb 4096
|
||||||
openfile_path rb 4096
|
openfile_path rb 4096
|
||||||
|
@ -143,10 +143,8 @@ run_notify_struct:
|
|||||||
|
|
||||||
align 4
|
align 4
|
||||||
@copy_path:
|
@copy_path:
|
||||||
; mov ebx,@library_name
|
|
||||||
mov esi,@cur_dir_path
|
mov esi,@cur_dir_path
|
||||||
mov edi,@library_path
|
mov edi,@library_path
|
||||||
|
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
cld
|
cld
|
||||||
align 4
|
align 4
|
||||||
@ -156,7 +154,7 @@ align 4
|
|||||||
test eax,eax
|
test eax,eax
|
||||||
jnz .lp1
|
jnz .lp1
|
||||||
mov esi,edi
|
mov esi,edi
|
||||||
|
dec esi ;¯¥à¥å®¤ ᨬ¢®« ª®æ áâப¨ @cur_dir_path
|
||||||
std
|
std
|
||||||
align 4
|
align 4
|
||||||
.lp2:
|
.lp2:
|
||||||
@ -164,11 +162,8 @@ align 4
|
|||||||
cmp al,'/'
|
cmp al,'/'
|
||||||
jnz .lp2
|
jnz .lp2
|
||||||
mov edi,esi
|
mov edi,esi
|
||||||
|
|
||||||
add edi,2
|
add edi,2
|
||||||
cld
|
cld
|
||||||
; mov esi,@library_name
|
|
||||||
|
|
||||||
mov esi,@point_dir_name
|
mov esi,@point_dir_name
|
||||||
test esi,esi
|
test esi,esi
|
||||||
jz .str_lp4
|
jz .str_lp4
|
||||||
@ -179,8 +174,6 @@ align 4
|
|||||||
stosb
|
stosb
|
||||||
test eax,eax
|
test eax,eax
|
||||||
jnz .lp3
|
jnz .lp3
|
||||||
|
|
||||||
|
|
||||||
dec edi
|
dec edi
|
||||||
.str_lp4:
|
.str_lp4:
|
||||||
mov esi,@library_name
|
mov esi,@library_name
|
||||||
|
Loading…
Reference in New Issue
Block a user