update code

git-svn-id: svn://kolibrios.org@6238 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2016-02-16 17:05:59 +00:00
parent 10e90697bc
commit b28721dd10
2 changed files with 570 additions and 650 deletions

View File

@ -1,22 +1,14 @@
;Ž£à®¬­ ï ¡« £®¤ à­®áâì Maxxxx32, Diamond, Heavyiron
;¨ ¤à㣨¬ ¯à®£à ¬¬¨áâ ¬,   â ª¦¥
;’¥¯«®¢ã €«¥ªá¥î (<Lrz> www.lrz.land.ru)
;¨ ¤à㣨¬ ¯à®£à ¬¬¨áâ ¬,   â ª¦¥ ’¥¯«®¢ã €«¥ªá¥î
use32
org 0x0
db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
dd 0x1
dd start
dd i_end ; à §¬¥à ¯à¨«®¦¥­¨ï
dd mem
dd stacktop
dd 0x0
dd sys_path
dd 1,start,i_end,mem,stacktop,0,sys_path
include '../../proc32.inc'
include '../../macros.inc'
include '../../dll.inc'
include '../../develop/libraries/box_lib/load_lib.mac'
include '../../KOSfuncs.inc'
include '../../load_img.inc'
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
min_window_w equ 485 ;¬¨­¨¬ «ì­ ï è¨à¨­  ®ª­ 
@ -28,20 +20,7 @@ include 'pl_import.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, dll.Load
struct FileInfoBlock
Function dd ?
Position dd ?
Flags dd ?
Count dd ?
Buffer dd ?
db ?
FileName dd ?
ends
fn_metki db 'pl_metki.lst',0
fn_icon1 db 'tl_sys_16.png',0
fn_icon2 db 'tl_nod_16.bmp',0
ini_name db 'planet_v.ini',0
ini_sec db 'Map',0
ini_k_cache db 'Cache',0
@ -56,18 +35,15 @@ start:
load_libraries l_libs_start,load_lib_end
;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨«¨áì ¡¨¡«¨®â¥ª¨
cmp dword [lib0+ll_struc_size-4],0
jnz @f
cmp dword [lib1+ll_struc_size-4],0
jnz @f
cmp dword [lib2+ll_struc_size-4],0
jnz @f
cmp dword [lib3+ll_struc_size-4],0
jnz @f
jmp .lib
mov ebp,lib_0
.test_lib_open:
cmp dword [ebp+ll_struc_size-4],0
jz @f
mcall SF_TERMINATE_PROCESS ;exit not correct
@@:
mcall -1 ;exit not correct
.lib:
add ebp,ll_struc_size
cmp ebp,load_lib_end
jl .test_lib_open
copy_path ini_name,sys_path,file_name,0
stdcall dword[ini_get_str],file_name,ini_sec,ini_k_cache,dword[edit1.text],dword[edit1.max],ini_def_cache
@ -103,52 +79,20 @@ start:
stdcall array_tile_function, tile_00,max_tiles_count,tile_init
stdcall tiles_init_grid, tile_00,max_tiles_count,max_tiles_cols
stdcall mem.Alloc, dword TREE_ICON_SYS16_BMP_SIZE
mov [tree_sys_icon],eax
load_image_file 'tl_sys_16.png',tree_sys_icon
mov eax,[tree_sys_icon]
mov [tree1.data_img_sys],eax
mov [tree2.data_img_sys],eax
stdcall mem.Alloc, dword TREE_ICON_NOD16_BMP_SIZE
mov [tree_nod_icon],eax
load_image_file 'tl_nod_16.bmp',tree_nod_icon
mov eax,[tree_nod_icon]
mov [tree1.data_img],eax
mov [tree2.data_img],eax
copy_path fn_icon1,sys_path,file_name,0
mov [run_file_70.Function], 0
mov [run_file_70.Position], 0
mov [run_file_70.Flags], 0
mov [run_file_70.Count], TREE_ICON_SYS16_BMP_SIZE
m2m [run_file_70.Buffer], [tree_sys_icon]
mov byte[run_file_70+20], 0
mov [run_file_70.FileName], file_name
mcall 70,run_file_70
cmp ebx,0xffffffff
je @f
stdcall dword[img_decode], dword[tree_sys_icon],ebx,0
mov dword[data_icon],eax
stdcall dword[img_to_rgb2], dword[data_icon],dword[tree_sys_icon]
stdcall dword[img_destroy], dword[data_icon]
m2m dword[tree1.data_img_sys],dword[tree_sys_icon]
m2m dword[tree2.data_img_sys],dword[tree_sys_icon]
@@:
copy_path fn_icon2,sys_path,file_name,0
mov [run_file_70.Count], TREE_ICON_NOD16_BMP_SIZE
m2m [run_file_70.Buffer], [tree_nod_icon]
mcall 70,run_file_70
cmp ebx,0xffffffff
je @f
stdcall dword[img_decode], dword[tree_nod_icon],ebx,0
mov dword[data_icon],eax
stdcall dword[img_to_rgb2], dword[data_icon],dword[tree_nod_icon]
stdcall dword[img_destroy], dword[data_icon]
m2m dword[tree1.data_img],dword[tree_nod_icon]
m2m dword[tree2.data_img],dword[tree_nod_icon]
@@:
mcall 40,0x27 ;¬ áª  á¨á⥬­ëå ᮡë⨩
mcall SF_SET_EVENTS_MASK,0x27
init_checkboxes2 ch1,checkboxes_end
mcall 48,3,sc,sizeof.system_colors
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
;ãáâ ­®¢ª  á¨á⥬­ëå 梥⮢
edit_boxes_set_sys_color edit1,editboxes_end,sc
check_boxes_set_sys_color2 ch1,checkboxes_end,sc
@ -166,7 +110,7 @@ red_win:
align 4
still:
mcall 10
mcall SF_WAIT_EVENT
cmp al,0x1 ;¨§¬. ¯®«®¦¥­¨¥ ®ª­ 
jz red_win
@ -187,7 +131,7 @@ still:
align 4
key:
push eax ebx
mcall 2
mcall SF_GET_KEY
stdcall [edit_box_key], edit1
stdcall [edit_box_key], edit2
@ -250,15 +194,13 @@ key:
align 4
draw_window:
pushad
mcall 12,1
mcall SF_REDRAW,SSF_BEGIN_DRAW
xor eax,eax
mov edx,[sc.work]
or edx,0x33000000
mov edi,hed
mcall ,20*65536+min_window_w,20*65536+min_window_h
mcall SF_CREATE_WINDOW,20*65536+min_window_w,20*65536+min_window_h,,,hed
mcall 9,procinfo,-1
mcall SF_THREAD_INFO,procinfo,-1
cmp dword[procinfo.box.width],min_window_w ; ¯à®¢¥à塞 è¨à¨­ã ®ª­ 
jge @f
@ -284,12 +226,11 @@ pushad
stdcall [scrollbar_ver_draw], dword wScrMetki
mov esi,[sc.work_button]
mcall 8,145*65536+20,5*65536+25,6 ;ª­®¯ª 
mcall SF_DEFINE_BUTTON,145*65536+20,5*65536+25,6
mcall ,100*65536+20,5*65536+25,5
mov ebx,170*65536+40 ;ª­®¯ª  ¢ë§®¢  ¤¨ «®£  OpenDial
;mov ecx,5*65536+25
mov edx,13
int 0x40
@ -309,7 +250,6 @@ pushad
add bx,410-otst_panel_left
shl ebx,16
mov bx,55
;mov ebx,410*65536+55
mov ecx,5*65536+25
mov edx,7
int 0x40
@ -318,7 +258,6 @@ pushad
add bx,440-otst_panel_left
shl ebx,16
mov bx,30
;mov ebx,440*65536+30
mov ecx,265*65536+25
mov edx,12
int 0x40
@ -327,8 +266,6 @@ pushad
add bx,405-otst_panel_left
shl ebx,16
mov bx,30
;mov ebx,405*65536+30
;mov ecx,265*65536+25
mov edx,11
int 0x40
@ -336,17 +273,12 @@ pushad
add bx,370-otst_panel_left
shl ebx,16
mov bx,30
;mov ebx,370*65536+30
;mov ecx,265*65536+25
mov edx,10
int 0x40
mov eax,4 ;à¨á®¢ ­¨¥ ⥪áâ 
mov ebx,152*65536+13
mov ecx,[sc.work_button_text]
or ecx,0x80000000
mov edx,txt_zoom_p
mcall
mcall SF_DRAW_TEXT,152*65536+13,,txt_zoom_p
mov ebx,107*65536+13
mov edx,txt_zoom_m
@ -417,18 +349,17 @@ pushad
int 0x40
mov bx,135
;mov ebx,265*65536+135
mov edx,txt142
int 0x40
call draw_tiles
stdcall [check_box_draw], dword ch1
stdcall [check_box_draw], dword ch2
stdcall [check_box_draw], ch1
stdcall [check_box_draw], ch2
stdcall [edit_box_draw], edit1
stdcall [edit_box_draw], edit2
mcall 12,2
mcall SF_REDRAW,SSF_END_DRAW
popad
ret
@ -462,16 +393,21 @@ lib4_name db 'proc_lib.obj',0
;library structures
l_libs_start:
lib0 l_libs lib0_name, sys_path, file_name, system_dir0, err_message_found_lib0, head_f_l, boxlib_import,err_message_import0, head_f_i
lib1 l_libs lib1_name, sys_path, file_name, system_dir1, err_message_found_lib1, head_f_l, libimg_import, err_message_import1, head_f_i
lib2 l_libs lib2_name, sys_path, file_name, system_dir2, err_message_found_lib2, head_f_l, strlib_import, err_message_import2, head_f_i
lib3 l_libs lib3_name, sys_path, file_name, system_dir3, err_message_found_lib3, head_f_l, libini_import, err_message_import3, head_f_i
lib4 l_libs lib4_name, sys_path, file_name, system_dir4, err_message_found_lib4, head_f_l, proclib_import, err_message_import4, head_f_i
lib_0 l_libs lib0_name, sys_path, file_name, system_dir0,\
err_message_found_lib0, head_f_l, boxlib_import, err_message_import0, head_f_i
lib_1 l_libs lib1_name, sys_path, file_name, system_dir1,\
err_message_found_lib1, head_f_l, libimg_import, err_message_import1, head_f_i
lib_2 l_libs lib2_name, sys_path, file_name, system_dir2,\
err_message_found_lib2, head_f_l, strlib_import, err_message_import2, head_f_i
lib_3 l_libs lib3_name, sys_path, file_name, system_dir3,\
err_message_found_lib3, head_f_l, libini_import, err_message_import3, head_f_i
lib_4 l_libs lib4_name, sys_path, file_name, system_dir4,\
err_message_found_lib4, head_f_l, proclib_import, err_message_import4, head_f_i
load_lib_end:
align 4
button:
mcall 17 ;¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨
mcall SF_GET_BUTTON
cmp ah,5
jne @f
call but_ZoomM
@ -529,7 +465,7 @@ button:
stdcall dword[tl_data_clear], tree2
; stdcall dword[img_destroy], dword[data_icon]
mcall -1 ;¢ë室 ¨§ ¯à®£à ¬¬ë
mcall SF_TERMINATE_PROCESS
;input:
@ -958,7 +894,6 @@ align 4
xor edx,edx ;®ç¨áâ¨âì edx
div ecx ;à §¤¥«¨âì - ®áâ â®ª ¢ edx
push edx ;¯®«®¦¨âì ¢ á⥪
;dec edi ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
call .str ;¯¥à¥©â¨ ­  á ¬ã ᥡï â.¥. ¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥­â  ¯®ª  ¢ eax ­¥ áâ ­¥â ¬¥­ìè¥ ç¥¬ ¢ ecx
pop eax
@@: ;cmp al,10 ;¯à®¢¥à¨âì ­¥ ¬¥­ìè¥ «¨ §­ ç¥­¨¥ ¢ al 祬 10 (¤«ï á¨á⥬ë áç¨á«¥­ï 10 ¤ ­­ ï ª®¬ ­¤  - «¨è­ ï))
@ -970,24 +905,20 @@ align 4
@@:
ret ;¯®ª  ¢ á⥪¥ åà ­¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï
hed db 'Planet viewer 09.11.15',0 ;¯®¤¯¨áì ®ª­ 
sc system_colors ;á¨á⥬­ë¥ 梥â 
hed db 'Planet viewer 16.02.16',0 ;¯®¤¯¨áì ®ª­ 
mouse_dd dd 0 ;­ã¦­® ¤«ï Shift-  ¢ editbox
align 16
i_end:
procinfo process_information
sc system_colors ;á¨á⥬­ë¥ 梥â 
rb 1024
align 16
stacktop:
sys_path rb 4096
file_name:
rb 4096
plugin_path:
rb 4096
openfile_path:
rb 4096
filename_area:
rb 256
file_name rb 4096
plugin_path rb 4096
openfile_path rb 4096
filename_area rb 256
mem:

View File

@ -253,7 +253,7 @@ pushad
mov esi,[sc.work_text]
or esi,0x40000000
mov edi,[sc.work]
mcall 47,0x20000,, (128 shl 16)+13
mcall SF_DRAW_NUMBER,0x20000,, (128 shl 16)+13
stdcall array_tile_function, tile_00,max_tiles_count,draw_tile
popad
@ -267,8 +267,6 @@ popad
align 4
proc tile_clear_area, height:dword
pushad
mov eax,13 ;draw rect
mov cx,dx
shl ecx,16
mov cx,word[height]
@ -279,12 +277,12 @@ proc tile_clear_area, height:dword
mov bx,TILE_LEN_W
mov edx,0xffffd0
int 0x40
mcall SF_DRAW_RECT
popad
ret
endp
;???
;­ à¨á®¢ âì ®¤¨­ tile
align 4
proc draw_tile, tile:dword
pushad
@ -292,12 +290,10 @@ proc draw_tile, tile:dword
;*** set base point ***
mov edx,5*65536+35
xor eax,eax
mov al,tile_delta_y
movzx eax,tile_delta_y
shl ax,8 ;*256
add edx,eax
xor eax,eax
mov al,tile_delta_x
movzx eax,tile_delta_x
shl eax,8+16
add edx,eax
;*** set base point ***
@ -310,7 +306,7 @@ proc draw_tile, tile:dword
jg .end_f
;¯à®¢¥à塞 ¢« §¨â «¨ ª à⨭ª  ¯® ®á¨ y
mcall 48,4 ;eax = ¢ëá®â  ᪨­ 
mcall SF_STYLE_SETTINGS,SSF_GET_SKIN_HEIGHT ;eax = ¢ëá®â  ᪨­ 
mov ecx,dword[procinfo.box.height]
mov ebx,edx
and ebx,0xffff ;ebx = ª®®à¤¨­ â  'y' ¤«ï ¢ë¢®¤  â ©« 
@ -326,7 +322,7 @@ proc draw_tile, tile:dword
mov ecx,TILE_LEN_H
@@:
mov eax,7
mov eax,SF_PUT_IMAGE
bt tile_drobn,SCALE_0BIT_USE
jc .draw
bt tile_drobn,SCALE_1BIT_USE
@ -386,16 +382,13 @@ jl @f
xchg cx,si
int 0x40
@@:
jmp .end_f
.info: ;¢ë¢®¤ ¨­ä®à¬ æ¨¨, ¯à¨ ­¥ 㤠筮¬ ®âªàë⨨ ª à⨭®ª
;;;jmp .end_f ;test
.info: ;¢ë¢®¤ ¨­ä®à¬ æ¨¨, ¯à¨ ­¥ 㤠筮¬ ®âªàë⨨ ª à⨭®ª
bt tile_drobn,SCALE_0BIT_USE
jc .end_f
bt tile_drobn,SCALE_1BIT_USE
jc .end_f
mov ebx,edx
add ebx,0x30003
mov edx,tile_rgb_icon ;¯à¨ ­¥ã¤ ç­®¬ ®âªàë⨨ ¢ tile_rgb_icon ¯ãâì ª ä ©«ã
@ -403,7 +396,7 @@ jl @f
stdcall [str_len],tile_rgb_icon,RGB_TILE_SIZE_1N4
mov edi,eax
mov eax,4 ;draw text
mov eax,SF_DRAW_TEXT
mov ecx,0xff
;or ecx,0x80000000
mov esi,TILE_TEXT_MAX_LEN
@ -460,13 +453,13 @@ but_MetSave:
inc eax ;¤«ï § ¯¨á¨ ¢ ä ©« § ¢¥àè î饣® ­ã«ï
m2m [run_file_70.Buffer], [bmp_icon]
mov [run_file_70.Function], 2
mov [run_file_70.Function], SSF_CREATE_FILE
mov [run_file_70.Position], 0
mov [run_file_70.Flags], 0
mov [run_file_70.Count], eax
mov byte[run_file_70+20], 0
mov [run_file_70.FileName], file_name
mcall 70,run_file_70
mcall SF_FILE,run_file_70
pop edi ecx ebx eax
jmp still
@ -478,14 +471,14 @@ but_MetLoad:
copy_path fn_metki,sys_path,file_name,0
pushad
mov byte[met_fr_opn],1
mov [run_file_70.Function], 0
mov [run_file_70.Function], SSF_READ_FILE
mov [run_file_70.Position], 0
mov [run_file_70.Flags], 0
mov [run_file_70.Count], TREE_ICON_SYS16_BMP_SIZE
mov byte[run_file_70+20], 0
mov [run_file_70.FileName], file_name
m2m [run_file_70.Buffer], [bmp_icon]
mcall 70,run_file_70
mcall SF_FILE,run_file_70
cmp ebx,0xffffffff
je @f
stdcall [tl_load_mem], tree2,0,[bmp_icon],TREE_ICON_SYS16_BMP_SIZE
@ -527,7 +520,7 @@ fun_goto_met:
pop eax
ret
;???
;®¡­®¢¨âì ª àâã
align 4
but_Refresh:
call fun_new_map_type ;¯à®¢¥à塞 ­¥ ¯®¬¥­ï«áï «¨ ⨯ ¯à®á¬ âਢ ¥¬ëå ä ©«®¢
@ -561,8 +554,7 @@ proc load_tile uses eax ebx ecx edi, tile:dword
mov edi,dword[tile] ;ª®¯¨à㥬 㪠§ â¥«ì ­  áâàãªâãàã â ©« , çâ®-¡ë à ¡®â «¨ ª®­áâ ­âë
stdcall mem_copy, map,edi, 9 ;ª®¯¨à㥬 ª®®à¤¨­ âë ªãàá®à  ¢ áâàãªâãàã â ©« 
xor eax,eax
mov al,tile_delta_x
movzx eax,tile_delta_x
add tile_coord_x,eax ;ᤢ¨£ ¥¬ ª®®à¤¨­ âë â ©« , ®â­®á¨â¥«ì­® ªãàá®à 
mov al,tile_delta_y
add tile_coord_y,eax
@ -693,8 +685,7 @@ proc load_tile uses eax ebx ecx edi, tile:dword
;­¥ §­ ¥¬ ¡ë« -«¨ ¢ª«î祭  ®¯æ¨ï '¡à âì á­¨§ã', ¤«ï ª®â®à®© ¨§¬¥­ï«¨áì ª®®à¤¨­ âë
;¯®â®¬ã ®¯ïâì ª®¯¨à㥬 ª®®à¤¨­ âë ªãàá®à  ¢ áâàãªâãàã â ©« 
stdcall mem_copy, map,edi, 9
xor eax,eax
mov al,tile_delta_x
movzx eax,tile_delta_x
add tile_coord_x,eax ;ᤢ¨£ ¥¬ ª®®à¤¨­ âë â ©« , ®â­®á¨â¥«ì­® ªãàá®à 
mov al,tile_delta_y
add tile_coord_y,eax
@ -760,14 +751,14 @@ align 4 ;
proc load_new_tile, tile:dword
pushad
mov [run_file_70.Function], 0
mov [run_file_70.Function], SSF_READ_FILE
mov [run_file_70.Position], 0
mov [run_file_70.Flags], 0
mov [run_file_70.Count], RGB_TILE_SIZE+300 ;+54
m2m [run_file_70.Buffer], [bmp_icon]
mov byte[run_file_70+20], 0
mov [run_file_70.FileName], file_name
mcall 70,run_file_70
mcall SF_FILE,run_file_70
mov edi,[tile]
; cmp ebx,0xffffffff
; je .no_load
@ -812,11 +803,10 @@ proc get_tile_path uses eax ecx edi esi, tile:dword
inc edi
loop @b
mov esi,dword[tile] ;¡¥à¥¬ 㪠§ â¥«ì
mov esi,[tile] ;¡¥à¥¬ 㪠§ â¥«ì
mov ecx,0x80000000 ;rol 0x80000000,1 = 1
xor eax,eax
mov al,byte[esi+8] ;+8 = zoom
movzx eax,byte[esi+8] ;+8 = zoom
.calc_coord:
rol ecx,1 ;ecx = maximum coord
dec ax
@ -826,8 +816,7 @@ proc get_tile_path uses eax ecx edi esi, tile:dword
mov byte[txt_tile_path],'z'
mov edi,txt_tile_path
inc edi
xor eax,eax
mov al,byte[esi+8] ;+8 = zoom
movzx eax,byte[esi+8] ;+8 = zoom
stdcall convert_int_to_str, 300
inc edi
@ -894,11 +883,11 @@ endp
align 4
get_all_path: ;äã­ªæ¨ï ¤«ï ᮡ¨à ­¨ï ¯®«­®£® ¯ã⨠¨§ ¢á¥å ªã᪮¢
mov ecx,dword[edit1.text]
add ecx,dword[edit1.size]
mov ecx,[edit1.text]
add ecx,[edit1.size]
dec ecx
stdcall [str_copy], file_name,4096-1, dword[edit1.text],dword[edit1.max]
stdcall [str_copy], file_name,4096-1, [edit1.text],[edit1.max]
cmp byte[ecx],'/'
je @f
@ -906,5 +895,5 @@ get_all_path: ;
@@:
stdcall [str_cat], file_name,4096-1, txt_tile_path,300
stdcall [str_cat], file_name,4096-1, dword [txt_tile_type],10
stdcall [str_cat], file_name,4096-1, [txt_tile_type],10
ret