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:
IgorA 2015-11-05 15:25:54 +00:00
parent 4caeaae3c6
commit b1f79255ce
5 changed files with 64 additions and 97 deletions

View File

@ -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\toolbar.png @copy toolbar.png bin\toolbar.png
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
@kpack bin\info3ds.kex
pause

View File

@ -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\toolbar.png @copy toolbar.png bin\toolbar.png
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
@kpack bin\info3ds.kex
pause

View File

@ -1,7 +1,7 @@
if lang eq ru
capt db 'info 3ds ¢¥àá¨ï 06.12.13',0 ;¯®¤¯¨áì ®ª­ 
capt db 'info 3ds ¢¥àá¨ï 05.11.15',0 ;¯®¤¯¨áì ®ª­ 
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
MAX_FILE_LEVEL equ 20 ;¬ ªá¨¬ «ì­ë© ã஢¥­ì ¢«®¦¥­­®á⨠¡«®ª®¢ ¤«ï  ­ «¨§ 

View File

@ -32,7 +32,7 @@ struct FileInfoBlock
ends
run_file_70 FileInfoBlock
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì, ­ã¦¥­ ¤«ï ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
open_file_lif dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï ®âªàëâ¨ï ä ©«®¢ 3ds
open_file_size dd 0 ;à §¬¥à ®âªàë⮣® ä ©« 
@ -58,9 +58,9 @@ macro load_image_file path,buf,size { ;
db 0
@@:
;32 - áâ ­¤ àâ­ë©  ¤à¥á ¯® ª®â®à®¬ã ¤®«¦¥­ ¡ëâì ¡ãä¥à á á¨á⥬­ë¬ ¯ã⥬
copy_path .path_str,[32],file_name,0x0
copy_path .path_str,[32],file_name,0
else
copy_path path,[32],file_name,0x0 ;ä®à¬¨à㥬 ¯®«­ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥­¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ®­ ¢ ®¤­®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
copy_path path,[32],file_name,0 ;ä®à¬¨à㥬 ¯®«­ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥­¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ®­ ¢ ®¤­®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
end if
stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥­¨ï
@ -121,10 +121,19 @@ include 'info_wnd_coords.inc'
align 4
start:
load_libraries l_libs_start,l_libs_end
;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ­ è  «¨¡ 
mov ebp,lib_7
cmp dword [ebp+ll_struc_size-4],0
jz @f
;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨«¨áì ¡¨¡«¨®â¥ª¨
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
jz @f
mcall -1 ;exit not correct
@@:
mcall 48,3,sc,sizeof.system_colors
@ -205,11 +214,7 @@ align 4
timer_funct:
pushad
if debug
mov eax,4
mov ebx,(5 shl 16)+8
mov ecx,0xff+0x80000000
mov edx,txt_0002
int 0x40
mcall 4, (5 shl 16)+8, 0xff+0x80000000, txt_0002
end if
mcall 26,9
mov [last_time],eax
@ -423,22 +428,27 @@ button:
cmp ah,3
jne @f
call but_new_file
jmp still
@@:
cmp ah,4
jne @f
call but_open_file
jmp still
@@:
cmp ah,5
jne @f
call but_save_file
jmp still
@@:
cmp ah,6
jne @f
call but_wnd_coords
jmp still
@@:
cmp ah,7
jne @f
call but_delete_chunk
jmp still
@@:
cmp ah,1
@ -465,8 +475,8 @@ but_new_file:
align 4
but_open_file:
pushad
copy_path open_dialog_name,communication_area_default_path,file_name,0
pushad
mov [OpenDialog_data.type],0
stdcall [OpenDialog_Start],OpenDialog_data
cmp [OpenDialog_data.status],2
@ -952,9 +962,8 @@ but_delete_chunk:
;output:
; eax - ç¨á«®
align 4
proc conv_str_to_int, buf:dword
proc conv_str_to_int uses ebx ecx esi, buf:dword
xor eax,eax
push ebx ecx esi
xor ebx,ebx
mov esi,[buf]
;®¯à¥¤¥«¥­¨¥ ®âà¨æ â¥«ì­ëå ç¨á¥«
@ -1016,7 +1025,6 @@ proc conv_str_to_int, buf:dword
sub ecx,eax
mov eax,ecx
@@:
pop esi ecx ebx
ret
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_import_2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'box_lib',39,0
system_dir_7 db '/sys/lib/'
lib_name_7 db 'buf2d.obj',0
err_msg_found_lib_7 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'buf2d.obj',39,0
err_msg_import_7 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'buf2d',39,0
system_dir_3 db '/sys/lib/'
lib_name_3 db 'buf2d.obj',0
err_msg_found_lib_3 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'buf2d.obj',39,0
err_msg_import_3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'buf2d',39,0
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
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
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
lib_7 l_libs lib_name_7, sys_path, library_path, system_dir_7,\
err_msg_found_lib_7,head_f_l,import_buf2d,err_msg_import_7,head_f_i
lib_3 l_libs lib_name_3, sys_path, library_path, system_dir_3,\
err_msg_found_lib_3,head_f_l,import_buf2d,err_msg_import_3,head_f_i
l_libs_end:
align 4
@ -1327,37 +1335,7 @@ rb 2+2+2+2+4+4+4+4+4+4
.ar_offset dd 1 ;+84
;íâ®â ª®¤ ­¥ ¬®©, ®­ ¯à¥®¡à §ã¥â ç¨á«® ¢ áâபã
;input:
; eax = value
; edi = string buffer
;output:
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:
rb 1024
thread_coords:
@ -1365,7 +1343,7 @@ thread_coords:
stacktop:
sys_path rb 1024
file_name:
rb 1024 ;4096
rb 4096
library_path rb 1024
plugin_path rb 4096
openfile_path rb 4096

View File

@ -143,55 +143,48 @@ run_notify_struct:
align 4
@copy_path:
; mov ebx,@library_name
mov esi,@cur_dir_path
mov edi,@library_path
xor eax,eax
cld
mov esi,@cur_dir_path
mov edi,@library_path
xor eax,eax
cld
align 4
.lp1:
lodsb
stosb
test eax,eax
jnz .lp1
mov esi,edi
std
lodsb
stosb
test eax,eax
jnz .lp1
mov esi,edi
dec esi ;¯¥à¥å®¤ ­  ᨬ¢®« ª®­æ  áâப¨ @cur_dir_path
std
align 4
.lp2:
lodsb
cmp al,'/'
jnz .lp2
mov edi,esi
add edi,2
cld
; mov esi,@library_name
mov esi,@point_dir_name
test esi,esi
lodsb
cmp al,'/'
jnz .lp2
mov edi,esi
add edi,2
cld
mov esi,@point_dir_name
test esi,esi
jz .str_lp4
align 4
.lp3:
lodsb
stosb
test eax,eax
jnz .lp3
dec edi
lodsb
stosb
test eax,eax
jnz .lp3
dec edi
.str_lp4:
mov esi,@library_name
align 4
.lp4:
lodsb
stosb
test eax,eax
jnz .lp4
lodsb
stosb
test eax,eax
jnz .lp4
;---------------------------------------------------------------------
ret
ret
}