Subversion Repositories Kolibri OS

Rev

Rev 1468 | Rev 1584 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1468 Rev 1488
1
;Ž£à®¬­ ï ¡« £®¤ à­®áâì Maxxxx32, Diamond, Heavyiron
1
;Ž£à®¬­ ï ¡« £®¤ à­®áâì Maxxxx32, Diamond, Heavyiron
2
;¨ ¤à㣨¬ ¯à®£à ¬¬¨áâ ¬,   â ª¦¥
2
;¨ ¤à㣨¬ ¯à®£à ¬¬¨áâ ¬,   â ª¦¥
3
;’¥¯«®¢ã €«¥ªá¥î ( www.lrz.land.ru)
3
;’¥¯«®¢ã €«¥ªá¥î ( www.lrz.land.ru)
4
use32
4
use32
5
  org 0x0
5
  org 0x0
6
  db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
6
  db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
7
  dd 0x1
7
  dd 0x1
8
  dd start
8
  dd start
9
  dd i_end ; à §¬¥à ¯à¨«®¦¥­¨ï
9
  dd i_end ; à §¬¥à ¯à¨«®¦¥­¨ï
10
  dd mem
10
  dd mem
11
  dd stacktop
11
  dd stacktop
12
  dd 0x0
12
  dd 0x0
13
  dd sys_path
13
  dd sys_path
14
 
14
 
15
include '../../proc32.inc'
15
include '../../proc32.inc'
16
include '../../macros.inc'
16
include '../../macros.inc'
17
include 'mem.inc'
17
include 'mem.inc'
18
include 'dll.inc'
18
include 'dll.inc'
19
 
19
 
20
include '../../develop/libraries/box_lib/load_lib.mac'
20
include '../../develop/libraries/box_lib/load_lib.mac'
21
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
21
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
22
include '../../develop/libraries/box_lib/asm/trunk/opendial.mac'
22
include '../../develop/libraries/box_lib/asm/trunk/opendial.mac'
23
use_OpenDialog
23
use_OpenDialog
24
 
24
 
25
min_window_w equ 485 ;¬¨­¨¬ «ì­ ï è¨à¨­  ®ª­ 
25
min_window_w equ 485 ;¬¨­¨¬ «ì­ ï è¨à¨­  ®ª­ 
26
min_window_h equ 325 ;¬¨­¨¬ «ì­ ï ¢ëá®â  ®ª­ 
26
min_window_h equ 325 ;¬¨­¨¬ «ì­ ï ¢ëá®â  ®ª­ 
27
otst_panel_left equ 265
27
otst_panel_left equ 265
28
 
28
 
29
include 'tile_fun.inc'
29
include 'tile_fun.inc'
30
include 'pl_import.inc'
30
include 'pl_import.inc'
31
 
31
 
32
  @use_library
32
  @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc, dll.Load
33
 
33
 
34
struct FileInfoBlock
34
struct FileInfoBlock
35
	Function dd ?
35
	Function dd ?
36
	Position dd ?
36
	Position dd ?
37
	Flags	 dd ?
37
	Flags	 dd ?
38
	Count	 dd ?
38
	Count	 dd ?
39
	Buffer	 dd ?
39
	Buffer	 dd ?
40
		db ?
40
		db ?
41
	FileName dd ?
41
	FileName dd ?
42
ends
42
ends
43
 
43
 
44
fn_metki db 'pl_metki.lst',0
44
fn_metki db 'pl_metki.lst',0
45
fn_icon1 db 'tl_sys_16.png',0
45
fn_icon1 db 'tl_sys_16.png',0
46
fn_icon2 db 'tl_nod_16.bmp',0
46
fn_icon2 db 'tl_nod_16.bmp',0
47
 
47
 
48
ini_name db 'planet_v.ini',0
48
ini_name db 'planet_v.ini',0
49
ini_sec  db 'Map',0
49
ini_sec  db 'Map',0
50
ini_k_cache db 'Cache',0
50
ini_k_cache db 'Cache',0
51
ini_def_cache db '/cache/sat',0
51
ini_def_cache db '/cache/sat',0
52
ini_ext  db 'ext'
52
ini_ext  db 'ext'
53
.number  db '?'
53
.number  db '?'
54
.def db 0 ;à áè¨à¥­¨¥ ¯® 㬮«ç ­¨î
54
.def db 0 ;à áè¨à¥­¨¥ ¯® 㬮«ç ­¨î
55
 
55
 
56
 
56
 
57
align 4
57
align 4
58
start:
58
start:
59
  load_libraries l_libs_start,load_lib_end
59
  load_libraries l_libs_start,load_lib_end
60
 
60
 
61
;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ­ è  «¨¡ 
61
;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ­ è  «¨¡ 
62
	mov	ebp,lib0
62
	mov	ebp,lib0
63
	cmp	dword [ebp+ll_struc_size-4],0
63
	cmp	dword [ebp+ll_struc_size-4],0
64
	jz	@f
64
	jz	@f
65
	mcall	-1	;exit not correct
65
	mcall	-1	;exit not correct
66
@@:
66
@@:
67
	mov	ebp,lib1
67
	mov	ebp,lib1
68
	cmp	dword [ebp+ll_struc_size-4],0
68
	cmp	dword [ebp+ll_struc_size-4],0
69
	jz	@f
69
	jz	@f
70
	mcall	-1	;exit not correct
70
	mcall	-1	;exit not correct
71
@@:
71
@@:
72
	mov	ebp,lib2
72
	mov	ebp,lib2
73
	cmp	dword [ebp+ll_struc_size-4],0
73
	cmp	dword [ebp+ll_struc_size-4],0
74
	jz	@f
74
	jz	@f
75
	mcall	-1	;exit not correct
75
	mcall	-1	;exit not correct
76
@@:
76
@@:
77
	mov	ebp,lib3
77
	mov	ebp,lib3
78
	cmp	dword [ebp+ll_struc_size-4],0
78
	cmp	dword [ebp+ll_struc_size-4],0
79
	jz	@f
79
	jz	@f
80
	mcall	-1	;exit not correct
80
	mcall	-1	;exit not correct
81
@@:
81
@@:
82
 
-
 
83
  stdcall dll.Init,dword[lib_init]
-
 
84
  stdcall dll.Init,dword[lib_init_ini]
-
 
85
 
82
 
86
  copy_path ini_name,sys_path,file_name,0x0
83
  copy_path ini_name,sys_path,file_name,0x0
87
  stdcall dword[ini_get_str],file_name,ini_sec,ini_k_cache,dword[edit1.text],dword[edit1.max],ini_def_cache
84
  stdcall dword[ini_get_str],file_name,ini_sec,ini_k_cache,dword[edit1.text],dword[edit1.max],ini_def_cache
88
  stdcall [str_len],dword[edit1.text],dword[edit1.max]
85
  stdcall [str_len],dword[edit1.text],dword[edit1.max]
89
  mov dword[edit1.size],eax
86
  mov dword[edit1.size],eax
90
  mov dword[edit1.pos],eax
87
  mov dword[edit1.pos],eax
91
 
88
 
92
  stdcall dword[tl_data_init], tree1
89
  stdcall dword[tl_data_init], tree1
93
  stdcall dword[tl_data_init], tree2
90
  stdcall dword[tl_data_init], tree2
94
 
91
 
95
;áç¨â뢠¥¬ à áè¨à¥­¨ï ª àâ ¨§ *.ini ä ©« 
92
;áç¨â뢠¥¬ à áè¨à¥­¨ï ª àâ ¨§ *.ini ä ©« 
96
  mov byte[ini_ext.number],'0'
93
  mov byte[ini_ext.number],'0'
97
@@: ;áç¨â뢠¥¬ ¯ à ¬¥âàë ®â ext1 ¤® ext9
94
@@: ;áç¨â뢠¥¬ ¯ à ¬¥âàë ®â ext1 ¤® ext9
98
  inc byte[ini_ext.number]
95
  inc byte[ini_ext.number]
99
  stdcall dword[ini_get_str],file_name,ini_sec,ini_ext,txt_tile_type_0,dword[tree1.info_capt_len],ini_ext.def
96
  stdcall dword[ini_get_str],file_name,ini_sec,ini_ext,txt_tile_type_0,dword[tree1.info_capt_len],ini_ext.def
100
  cmp byte[txt_tile_type_0],0
97
  cmp byte[txt_tile_type_0],0
101
  je @f
98
  je @f
102
    stdcall dword[tl_node_add], txt_tile_type_0, 0, tree1
99
    stdcall dword[tl_node_add], txt_tile_type_0, 0, tree1
103
  jmp @b
100
  jmp @b
104
@@:
101
@@:
105
  mov byte[ini_ext.number],'0' ;áç¨â뢠¥¬ ¯ à ¬¥âà ®â ext0 ª®â®àë© ¡ã¤¥â ¢ë¡à ­ ¢ ᯨ᪥
102
  mov byte[ini_ext.number],'0' ;áç¨â뢠¥¬ ¯ à ¬¥âà ®â ext0 ª®â®àë© ¡ã¤¥â ¢ë¡à ­ ¢ ᯨ᪥
106
  stdcall dword[ini_get_str],file_name,ini_sec,ini_ext,txt_tile_type_0,dword[tree1.info_capt_len],ini_ext.def
103
  stdcall dword[ini_get_str],file_name,ini_sec,ini_ext,txt_tile_type_0,dword[tree1.info_capt_len],ini_ext.def
107
  cmp byte[txt_tile_type_0],0
104
  cmp byte[txt_tile_type_0],0
108
  jne @f
105
  jne @f
109
    mov dword[txt_tile_type_0],'.bmp' ;¥á«¨ ¢ *.ini ä ©«¥ ­¨ç¥£® ­¥â ¤®¡ ¢«ï¥¬ à áè¨à¥­¨¥ .bmp
106
    mov dword[txt_tile_type_0],'.bmp' ;¥á«¨ ¢ *.ini ä ©«¥ ­¨ç¥£® ­¥â ¤®¡ ¢«ï¥¬ à áè¨à¥­¨¥ .bmp
110
  @@:
107
  @@:
111
  stdcall dword[tl_node_add], txt_tile_type_0, 0, tree1
108
  stdcall dword[tl_node_add], txt_tile_type_0, 0, tree1
112
 
109
 
113
; init bmp file
110
; init bmp file
114
  stdcall mem.Alloc, dword RGB_TILE_SIZE+300 ;300 - § ¯ á­ë¥ ¡ ©âë á ãç¥â®¬ § £®«®¢ª  bmp ä ©« 
111
  stdcall mem.Alloc, dword RGB_TILE_SIZE+300 ;300 - § ¯ á­ë¥ ¡ ©âë á ãç¥â®¬ § £®«®¢ª  bmp ä ©« 
115
  mov [bmp_icon],eax
112
  mov [bmp_icon],eax
116
 
113
 
117
  stdcall array_tile_function, tile_00,max_tiles_count,tile_init
114
  stdcall array_tile_function, tile_00,max_tiles_count,tile_init
118
  stdcall tiles_init_grid, tile_00,max_tiles_count,max_tiles_cols
115
  stdcall tiles_init_grid, tile_00,max_tiles_count,max_tiles_cols
119
 
116
 
120
  stdcall mem.Alloc, dword TREE_ICON_SYS16_BMP_SIZE
117
  stdcall mem.Alloc, dword TREE_ICON_SYS16_BMP_SIZE
121
  mov [tree_sys_icon],eax
118
  mov [tree_sys_icon],eax
122
 
119
 
123
  stdcall mem.Alloc, dword TREE_ICON_NOD16_BMP_SIZE
120
  stdcall mem.Alloc, dword TREE_ICON_NOD16_BMP_SIZE
124
  mov [tree_nod_icon],eax
121
  mov [tree_nod_icon],eax
125
 
122
 
126
  copy_path fn_icon1,sys_path,file_name,0x0
123
  copy_path fn_icon1,sys_path,file_name,0x0
127
  mov eax,70 ;load icon file
124
  mov eax,70 ;load icon file
128
  mov [run_file_70.Function], 0
125
  mov [run_file_70.Function], 0
129
  mov [run_file_70.Position], 0
126
  mov [run_file_70.Position], 0
130
  mov [run_file_70.Flags], 0
127
  mov [run_file_70.Flags], 0
131
  mov [run_file_70.Count], TREE_ICON_SYS16_BMP_SIZE
128
  mov [run_file_70.Count], TREE_ICON_SYS16_BMP_SIZE
132
  m2m [run_file_70.Buffer], [tree_sys_icon]
129
  m2m [run_file_70.Buffer], [tree_sys_icon]
133
  mov byte[run_file_70+20], 0
130
  mov byte[run_file_70+20], 0
134
  mov [run_file_70.FileName], file_name
131
  mov [run_file_70.FileName], file_name
135
  mov ebx,run_file_70
132
  mov ebx,run_file_70
136
  int 0x40
133
  int 0x40
137
  cmp ebx,0xffffffff
134
  cmp ebx,0xffffffff
138
  je @f
135
  je @f
139
    stdcall dword[img_decode], dword[tree_sys_icon],ebx,0
136
    stdcall dword[img_decode], dword[tree_sys_icon],ebx,0
140
    mov dword[data_icon],eax
137
    mov dword[data_icon],eax
141
    stdcall dword[img_to_rgb2], dword[data_icon],dword[tree_sys_icon]
138
    stdcall dword[img_to_rgb2], dword[data_icon],dword[tree_sys_icon]
142
    stdcall dword[img_destroy], dword[data_icon]
139
    stdcall dword[img_destroy], dword[data_icon]
143
 
140
 
144
    m2m dword[tree1.data_img_sys],dword[tree_sys_icon]
141
    m2m dword[tree1.data_img_sys],dword[tree_sys_icon]
145
    m2m dword[tree2.data_img_sys],dword[tree_sys_icon]
142
    m2m dword[tree2.data_img_sys],dword[tree_sys_icon]
146
  @@:
143
  @@:
147
 
144
 
148
 
145
 
149
  copy_path fn_icon2,sys_path,file_name,0x0
146
  copy_path fn_icon2,sys_path,file_name,0x0
150
  mov eax,70 ;load icon file
147
  mov eax,70 ;load icon file
151
  mov [run_file_70.Count], TREE_ICON_NOD16_BMP_SIZE
148
  mov [run_file_70.Count], TREE_ICON_NOD16_BMP_SIZE
152
  m2m [run_file_70.Buffer], [tree_nod_icon]
149
  m2m [run_file_70.Buffer], [tree_nod_icon]
153
  mov ebx,run_file_70
150
  mov ebx,run_file_70
154
  int 0x40
151
  int 0x40
155
  cmp ebx,0xffffffff
152
  cmp ebx,0xffffffff
156
  je @f
153
  je @f
157
    stdcall dword[img_decode], dword[tree_nod_icon],ebx,0
154
    stdcall dword[img_decode], dword[tree_nod_icon],ebx,0
158
    mov dword[data_icon],eax
155
    mov dword[data_icon],eax
159
    stdcall dword[img_to_rgb2], dword[data_icon],dword[tree_nod_icon]
156
    stdcall dword[img_to_rgb2], dword[data_icon],dword[tree_nod_icon]
160
    stdcall dword[img_destroy], dword[data_icon]
157
    stdcall dword[img_destroy], dword[data_icon]
161
 
158
 
162
    m2m dword[tree1.data_img],dword[tree_nod_icon]
159
    m2m dword[tree1.data_img],dword[tree_nod_icon]
163
    m2m dword[tree2.data_img],dword[tree_nod_icon]
160
    m2m dword[tree2.data_img],dword[tree_nod_icon]
164
  @@:
161
  @@:
165
 
162
 
166
  mcall 40,0x27
163
  mcall 40,0x27
167
 
164
 
168
  mcall 48,3,sc,sizeof.system_colors
165
  mcall 48,3,sc,sizeof.system_colors
169
  ;ãáâ ­®¢ª  á¨á⥬­ëå 梥⮢
166
  ;ãáâ ­®¢ª  á¨á⥬­ëå 梥⮢
170
  edit_boxes_set_sys_color edit1,editboxes_end,sc
167
  edit_boxes_set_sys_color edit1,editboxes_end,sc
171
  check_boxes_set_sys_color ch1,checkboxes_end,sc
168
  check_boxes_set_sys_color ch1,checkboxes_end,sc
172
 
169
 
173
  mov byte[file_name],0
170
  mov byte[file_name],0
174
 
171
 
175
  ; OpenDialog initialisation
172
  ; OpenDialog initialisation
176
  init_OpenDialog OpenDialog_data
173
  init_OpenDialog OpenDialog_data
177
 
174
 
178
align 4
175
align 4
179
red_win:
176
red_win:
180
  call draw_window
177
  call draw_window
181
  call but_MetLoad
178
  call but_MetLoad
182
 
179
 
183
align 4
180
align 4
184
still:
181
still:
185
  mov eax,10
182
  mov eax,10
186
  mcall
183
  mcall
187
 
184
 
188
  cmp al,0x1 ;¨§¬. ¯®«®¦¥­¨¥ ®ª­ 
185
  cmp al,0x1 ;¨§¬. ¯®«®¦¥­¨¥ ®ª­ 
189
  jz red_win
186
  jz red_win
190
  cmp al,0x2
187
  cmp al,0x2
191
  jz key
188
  jz key
192
  cmp al,0x3
189
  cmp al,0x3
193
  jz button
190
  jz button
194
 
191
 
195
  push dword ch2
192
  push dword ch2
196
  call [check_box_mouse]
193
  call [check_box_mouse]
197
  push dword ch1
194
  push dword ch1
198
  call [check_box_mouse]
195
  call [check_box_mouse]
199
 
196
 
200
  stdcall [edit_box_mouse], edit1
197
  stdcall [edit_box_mouse], edit1
201
  stdcall [edit_box_mouse], edit2
198
  stdcall [edit_box_mouse], edit2
202
 
199
 
203
  stdcall [tl_mouse], tree1
200
  stdcall [tl_mouse], tree1
204
  stdcall [tl_mouse], tree2
201
  stdcall [tl_mouse], tree2
205
 
202
 
206
  jmp still
203
  jmp still
207
 
204
 
208
align 4
205
align 4
209
key:
206
key:
210
  push eax ebx
207
  push eax ebx
211
  mcall 2
208
  mcall 2
212
  stdcall [edit_box_key], edit1
209
  stdcall [edit_box_key], edit1
213
  stdcall [edit_box_key], edit2
210
  stdcall [edit_box_key], edit2
214
 
211
 
215
  push dword tree1
212
  push dword tree1
216
  call [tl_key]
213
  call [tl_key]
217
  push dword tree2
214
  push dword tree2
218
  call [tl_key]
215
  call [tl_key]
219
 
216
 
220
  mov ebx,dword[el_focus] ;çâ®-¡ë ª àâ  ­¥ ¤¢¨£ « áì ¥á«¨ ®ª­  treelist ¢ 䮪ãá¥
217
  mov ebx,dword[el_focus] ;çâ®-¡ë ª àâ  ­¥ ¤¢¨£ « áì ¥á«¨ ®ª­  treelist ¢ 䮪ãá¥
221
  cmp ebx, dword tree1
218
  cmp ebx, dword tree1
222
  je .end_f
219
  je .end_f
223
  cmp ebx, dword tree2
220
  cmp ebx, dword tree2
224
  je .end_f
221
  je .end_f
225
 
222
 
226
  ;çâ®-¡ë ª àâ  ­¥ ¤¢¨£ « áì ¥á«¨ ⥪áâ®¢ë¥ ¯®«ï ¢ 䮪ãá¥
223
  ;çâ®-¡ë ª àâ  ­¥ ¤¢¨£ « áì ¥á«¨ ⥪áâ®¢ë¥ ¯®«ï ¢ 䮪ãá¥
227
  test word[edit1.flags],10b ;ed_focus
224
  test word[edit1.flags],10b ;ed_focus
228
  jne .end_f
225
  jne .end_f
229
  test word[edit2.flags],10b ;ed_focus
226
  test word[edit2.flags],10b ;ed_focus
230
  jne .end_f
227
  jne .end_f
231
 
228
 
232
    cmp ah,179 ;Right
229
    cmp ah,179 ;Right
233
    jne @f
230
    jne @f
234
      call CursorMoveRight
231
      call CursorMoveRight
235
    @@:
232
    @@:
236
    cmp ah,176 ;Left
233
    cmp ah,176 ;Left
237
    jne @f
234
    jne @f
238
    cmp dword[map.coord_x],0
235
    cmp dword[map.coord_x],0
239
    je @f
236
    je @f
240
      dec dword[map.coord_x]
237
      dec dword[map.coord_x]
241
      ;ᤢ¨£ ¥¬ á¥âªã â ©«®¢ ¢¯à ¢®, çâ®-¡ë ç áâì â ©«®¢ ᮢ¯ «¨ ¨ ¯à¨è«®áì ¬¥­ìè¥ § £à㦠âì ­®¢ëå
238
      ;ᤢ¨£ ¥¬ á¥âªã â ©«®¢ ¢¯à ¢®, çâ®-¡ë ç áâì â ©«®¢ ᮢ¯ «¨ ¨ ¯à¨è«®áì ¬¥­ìè¥ § £à㦠âì ­®¢ëå
242
      stdcall tiles_grid_move_right, tile_00,max_tiles_count,max_tiles_cols
239
      stdcall tiles_grid_move_right, tile_00,max_tiles_count,max_tiles_cols
243
      call but_Refresh
240
      call but_Refresh
244
    @@:
241
    @@:
245
    cmp ah,177 ;Down
242
    cmp ah,177 ;Down
246
    jne @f
243
    jne @f
247
      call CursorMoveDown
244
      call CursorMoveDown
248
    @@:
245
    @@:
249
    cmp ah,178 ;Up
246
    cmp ah,178 ;Up
250
    jne @f
247
    jne @f
251
    cmp dword[map.coord_y],0
248
    cmp dword[map.coord_y],0
252
    je @f
249
    je @f
253
      dec dword[map.coord_y]
250
      dec dword[map.coord_y]
254
      ;ᤢ¨£ ¥¬ á¥âªã â ©«®¢ ¢­¨§
251
      ;ᤢ¨£ ¥¬ á¥âªã â ©«®¢ ¢­¨§
255
      stdcall tiles_grid_move_down, tile_00,max_tiles_count,max_tiles_rows
252
      stdcall tiles_grid_move_down, tile_00,max_tiles_count,max_tiles_rows
256
      call but_Refresh
253
      call but_Refresh
257
    @@:
254
    @@:
258
 
255
 
259
    cmp ah,45 ;-
256
    cmp ah,45 ;-
260
    jne @f
257
    jne @f
261
      call but_ZoomM
258
      call but_ZoomM
262
    @@:
259
    @@:
263
    cmp ah,61 ;+
260
    cmp ah,61 ;+
264
    jne @f
261
    jne @f
265
      call but_ZoomP
262
      call but_ZoomP
266
    @@:
263
    @@:
267
 
264
 
268
  .end_f:
265
  .end_f:
269
  pop ebx eax
266
  pop ebx eax
270
  jmp still
267
  jmp still
271
 
268
 
272
 
269
 
273
align 4
270
align 4
274
draw_window:
271
draw_window:
275
pushad
272
pushad
276
  mcall 12,1
273
  mcall 12,1
277
 
274
 
278
  xor eax,eax
275
  xor eax,eax
279
  mov ebx,20*65536+min_window_w
276
  mov ebx,20*65536+min_window_w
280
  mov ecx,20*65536+min_window_h
277
  mov ecx,20*65536+min_window_h
281
  mov edx,[sc.work]
278
  mov edx,[sc.work]
282
  or  edx,0x33000000
279
  or  edx,0x33000000
283
  mov edi,hed
280
  mov edi,hed
284
  mcall
281
  mcall
285
 
282
 
286
  mcall 9,procinfo,-1
283
  mcall 9,procinfo,-1
287
 
284
 
288
  cmp dword[procinfo.box.width],min_window_w ; ¯à®¢¥à塞 è¨à¨­ã ®ª­ 
285
  cmp dword[procinfo.box.width],min_window_w ; ¯à®¢¥à塞 è¨à¨­ã ®ª­ 
289
  jge @f
286
  jge @f
290
    mov dword[procinfo.box.width],min_window_w ; ¥á«¨ ®ª­® ®ç¥­ì 㧪®¥, 㢥«¨ç¨¢ ¥¬ è¨à¨­ã ¤«ï ¨§¡¥¦ ­¨ï £«îª®¢
287
    mov dword[procinfo.box.width],min_window_w ; ¥á«¨ ®ª­® ®ç¥­ì 㧪®¥, 㢥«¨ç¨¢ ¥¬ è¨à¨­ã ¤«ï ¨§¡¥¦ ­¨ï £«îª®¢
291
  @@:
288
  @@:
292
 
289
 
293
  mov edi,dword[procinfo.box.width]
290
  mov edi,dword[procinfo.box.width]
294
  sub edi,min_window_w-otst_panel_left
291
  sub edi,min_window_w-otst_panel_left
295
  mov dword[tree1.box_left],edi
292
  mov dword[tree1.box_left],edi
296
  mov dword[tree2.box_left],edi
293
  mov dword[tree2.box_left],edi
297
 
294
 
298
  mov eax,dword[tree2.box_left] ;¤¢¨£ ¥¬ áªà®««¨­£
295
  mov eax,dword[tree2.box_left] ;¤¢¨£ ¥¬ áªà®««¨­£
299
  add eax,dword[tree2.box_width]
296
  add eax,dword[tree2.box_width]
300
  mov ebx,dword[tree2.p_scrol]
297
  mov ebx,dword[tree2.p_scrol]
301
  mov word[ebx+2],ax
298
  mov word[ebx+2],ax
302
 
299
 
303
  mov dword[edit2.left],edi
300
  mov dword[edit2.left],edi
304
  add dword[edit2.left],370-otst_panel_left
301
  add dword[edit2.left],370-otst_panel_left
305
 
302
 
306
  stdcall dword[tl_draw],dword tree1
303
  stdcall dword[tl_draw],dword tree1
307
  stdcall dword[tl_draw],dword tree2
304
  stdcall dword[tl_draw],dword tree2
308
  mov dword[wScrMetki.all_redraw],1
305
  mov dword[wScrMetki.all_redraw],1
309
  stdcall [scrollbar_ver_draw], dword wScrMetki
306
  stdcall [scrollbar_ver_draw], dword wScrMetki
310
 
307
 
311
  mov eax,8 ;ª­®¯ª 
308
  mov eax,8 ;ª­®¯ª 
312
  mov ebx,145*65536+20
309
  mov ebx,145*65536+20
313
  mov ecx,5*65536+25
310
  mov ecx,5*65536+25
314
  mov edx,6
311
  mov edx,6
315
  mov esi,[sc.work_button]
312
  mov esi,[sc.work_button]
316
  int 0x40
313
  int 0x40
317
 
314
 
318
  mov ebx,100*65536+20
315
  mov ebx,100*65536+20
319
  mov ecx,5*65536+25
316
  mov ecx,5*65536+25
320
  mov edx,5
317
  mov edx,5
321
  int 0x40
318
  int 0x40
322
 
319
 
323
  mov ebx,170*65536+40 ;ª­®¯ª  ¢ë§®¢  ¤¨ «®£  OpenDial
320
  mov ebx,170*65536+40 ;ª­®¯ª  ¢ë§®¢  ¤¨ «®£  OpenDial
324
  ;mov ecx,5*65536+25
321
  ;mov ecx,5*65536+25
325
  mov edx,13
322
  mov edx,13
326
  int 0x40
323
  int 0x40
327
 
324
 
328
  mov bx,di
325
  mov bx,di
329
  shl ebx,16
326
  shl ebx,16
330
  mov bx,100
327
  mov bx,100
331
  mov ecx,265*65536+25
328
  mov ecx,265*65536+25
332
  mov edx,9
329
  mov edx,9
333
  int 0x40
330
  int 0x40
334
 
331
 
335
  ;ebx ...
332
  ;ebx ...
336
  mov ecx,235*65536+25
333
  mov ecx,235*65536+25
337
  mov edx,8
334
  mov edx,8
338
  int 0x40
335
  int 0x40
339
 
336
 
340
  mov bx,di
337
  mov bx,di
341
  add bx,410-otst_panel_left
338
  add bx,410-otst_panel_left
342
  shl ebx,16
339
  shl ebx,16
343
  mov bx,55
340
  mov bx,55
344
  ;mov ebx,410*65536+55
341
  ;mov ebx,410*65536+55
345
  mov ecx,5*65536+25
342
  mov ecx,5*65536+25
346
  mov edx,7
343
  mov edx,7
347
  int 0x40
344
  int 0x40
348
 
345
 
349
  mov bx,di
346
  mov bx,di
350
  add bx,440-otst_panel_left
347
  add bx,440-otst_panel_left
351
  shl ebx,16
348
  shl ebx,16
352
  mov bx,30
349
  mov bx,30
353
  ;mov ebx,440*65536+30
350
  ;mov ebx,440*65536+30
354
  mov ecx,265*65536+25
351
  mov ecx,265*65536+25
355
  mov edx,12
352
  mov edx,12
356
  int 0x40
353
  int 0x40
357
 
354
 
358
  mov bx,di
355
  mov bx,di
359
  add bx,405-otst_panel_left
356
  add bx,405-otst_panel_left
360
  shl ebx,16
357
  shl ebx,16
361
  mov bx,30
358
  mov bx,30
362
  ;mov ebx,405*65536+30
359
  ;mov ebx,405*65536+30
363
  ;mov ecx,265*65536+25
360
  ;mov ecx,265*65536+25
364
  mov edx,11
361
  mov edx,11
365
  int 0x40
362
  int 0x40
366
 
363
 
367
  mov bx,di
364
  mov bx,di
368
  add bx,370-otst_panel_left
365
  add bx,370-otst_panel_left
369
  shl ebx,16
366
  shl ebx,16
370
  mov bx,30
367
  mov bx,30
371
  ;mov ebx,370*65536+30
368
  ;mov ebx,370*65536+30
372
  ;mov ecx,265*65536+25
369
  ;mov ecx,265*65536+25
373
  mov edx,10
370
  mov edx,10
374
  int 0x40
371
  int 0x40
375
 
372
 
376
  mov eax,4 ;à¨á®¢ ­¨¥ ⥪áâ 
373
  mov eax,4 ;à¨á®¢ ­¨¥ ⥪áâ 
377
  mov ebx,152*65536+13
374
  mov ebx,152*65536+13
378
  mov ecx,[sc.work_button_text]
375
  mov ecx,[sc.work_button_text]
379
  or  ecx,0x80000000
376
  or  ecx,0x80000000
380
  mov edx,txt_zoom_p
377
  mov edx,txt_zoom_p
381
  mcall
378
  mcall
382
 
379
 
383
  mov ebx,107*65536+13
380
  mov ebx,107*65536+13
384
  mov edx,txt_zoom_m
381
  mov edx,txt_zoom_m
385
  int 0x40
382
  int 0x40
386
 
383
 
387
  mov bx,di
384
  mov bx,di
388
  add bx,270-otst_panel_left
385
  add bx,270-otst_panel_left
389
  shl ebx,16
386
  shl ebx,16
390
  mov bx,243
387
  mov bx,243
391
  ;mov ebx,270*65536+243
388
  ;mov ebx,270*65536+243
392
  mov edx,txt151
389
  mov edx,txt151
393
  int 0x40
390
  int 0x40
394
 
391
 
395
  mov bx,di
392
  mov bx,di
396
  add bx,270-otst_panel_left
393
  add bx,270-otst_panel_left
397
  shl ebx,16
394
  shl ebx,16
398
  mov bx,273
395
  mov bx,273
399
  ;mov ebx,270*65536+273
396
  ;mov ebx,270*65536+273
400
  mov edx,txt152
397
  mov edx,txt152
401
  int 0x40
398
  int 0x40
402
 
399
 
403
  mov bx,di
400
  mov bx,di
404
  add bx,415-otst_panel_left
401
  add bx,415-otst_panel_left
405
  shl ebx,16
402
  shl ebx,16
406
  mov bx,13
403
  mov bx,13
407
  ;mov ebx,415*65536+13
404
  ;mov ebx,415*65536+13
408
  mov edx,txt_but_refresh
405
  mov edx,txt_but_refresh
409
  int 0x40
406
  int 0x40
410
 
407
 
411
  mov bx,di
408
  mov bx,di
412
  add bx,380-otst_panel_left
409
  add bx,380-otst_panel_left
413
  shl ebx,16
410
  shl ebx,16
414
  mov bx,275
411
  mov bx,275
415
  ;mov ebx,380*65536+275
412
  ;mov ebx,380*65536+275
416
  mov edx,txt_met_up
413
  mov edx,txt_met_up
417
  int 0x40
414
  int 0x40
418
 
415
 
419
  mov bx,di
416
  mov bx,di
420
  add bx,415-otst_panel_left
417
  add bx,415-otst_panel_left
421
  shl ebx,16
418
  shl ebx,16
422
  mov bx,275
419
  mov bx,275
423
  ;mov ebx,415*65536+275
420
  ;mov ebx,415*65536+275
424
  mov edx,txt_met_dn
421
  mov edx,txt_met_dn
425
  int 0x40
422
  int 0x40
426
 
423
 
427
 
424
 
428
  mov bx,di
425
  mov bx,di
429
  add bx,450-otst_panel_left
426
  add bx,450-otst_panel_left
430
  shl ebx,16
427
  shl ebx,16
431
  mov bx,275
428
  mov bx,275
432
  ;mov ebx,450*65536+275
429
  ;mov ebx,450*65536+275
433
  mov edx,txt_met_sh
430
  mov edx,txt_met_sh
434
  int 0x40
431
  int 0x40
435
 
432
 
436
  mov ecx,[sc.work_text]
433
  mov ecx,[sc.work_text]
437
  or  ecx,0x80000000
434
  or  ecx,0x80000000
438
 
435
 
439
  mov ebx,175*65536+13
436
  mov ebx,175*65536+13
440
  mov edx,txt_cache
437
  mov edx,txt_cache
441
  int 0x40
438
  int 0x40
442
 
439
 
443
  mov bx,di
440
  mov bx,di
444
  ;add bx,450-otst_panel_left
441
  ;add bx,450-otst_panel_left
445
  shl ebx,16
442
  shl ebx,16
446
  mov bx,35
443
  mov bx,35
447
  ;mov ebx,265*65536+35
444
  ;mov ebx,265*65536+35
448
  mov edx,txt141
445
  mov edx,txt141
449
  int 0x40
446
  int 0x40
450
 
447
 
451
  mov bx,135
448
  mov bx,135
452
  ;mov ebx,265*65536+135
449
  ;mov ebx,265*65536+135
453
  mov edx,txt142
450
  mov edx,txt142
454
  int 0x40
451
  int 0x40
455
 
452
 
456
  call draw_tiles
453
  call draw_tiles
457
 
454
 
458
  stdcall [check_box_draw], dword ch1
455
  stdcall [check_box_draw], dword ch1
459
  stdcall [check_box_draw], dword ch2
456
  stdcall [check_box_draw], dword ch2
460
  stdcall [edit_box_draw], edit1
457
  stdcall [edit_box_draw], edit1
461
  stdcall [edit_box_draw], edit2
458
  stdcall [edit_box_draw], edit2
462
 
459
 
463
  mcall 12,2
460
  mcall 12,2
464
popad
461
popad
465
  ret
462
  ret
466
 
463
 
467
  head_f_i:
464
  head_f_i:
468
  head_f_l  db '‘¨á⥬­ ï ®è¨¡ª ',0
465
  head_f_l  db '‘¨á⥬­ ï ®è¨¡ª ',0
469
  err_message_found_lib0 db '¥ 㤠«®áì ­ ©â¨ ¡¨¡«¨®â¥ªã box_lib.obj',0
466
  err_message_found_lib0 db '¥ 㤠«®áì ­ ©â¨ ¡¨¡«¨®â¥ªã box_lib.obj',0
470
  err_message_import0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ box_lib.obj',0
467
  err_message_import0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ box_lib.obj',0
471
  err_message_found_lib1 db '¥ 㤠«®áì ­ ©â¨ ¡¨¡«¨®â¥ªã libimg.obj',0
468
  err_message_found_lib1 db '¥ 㤠«®áì ­ ©â¨ ¡¨¡«¨®â¥ªã libimg.obj',0
472
  err_message_import1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ libimg.obj',0
469
  err_message_import1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ libimg.obj',0
473
  err_message_found_lib2 db '¥ 㤠«®áì ­ ©â¨ ¡¨¡«¨®â¥ªã str.obj',0
470
  err_message_found_lib2 db '¥ 㤠«®áì ­ ©â¨ ¡¨¡«¨®â¥ªã str.obj',0
474
  err_message_import2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ str.obj',0
471
  err_message_import2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ str.obj',0
475
  err_message_found_lib3 db '¥ 㤠«®áì ­ ©â¨ ¡¨¡«¨®â¥ªã libini.obj',0
472
  err_message_found_lib3 db '¥ 㤠«®áì ­ ©â¨ ¡¨¡«¨®â¥ªã libini.obj',0
476
  err_message_import3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ libini.obj',0
473
  err_message_import3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ libini.obj',0
477
 
474
 
478
system_dir0 db '/sys/lib/'
475
system_dir0 db '/sys/lib/'
479
boxlib_name db 'box_lib.obj',0
476
boxlib_name db 'box_lib.obj',0
480
 
477
 
481
system_dir1 db '/sys/lib/'
478
system_dir1 db '/sys/lib/'
482
libimg_name db 'libimg.obj',0
479
libimg_name db 'libimg.obj',0
483
 
480
 
484
system_dir2 db '/sys/lib/'
481
system_dir2 db '/sys/lib/'
485
strlib_name db 'str.obj',0
482
strlib_name db 'str.obj',0
486
 
483
 
487
system_dir3 db '/sys/lib/'
484
system_dir3 db '/sys/lib/'
488
libini_name db 'libini.obj',0
485
libini_name db 'libini.obj',0
489
 
486
 
490
;library structures
487
;library structures
491
l_libs_start:
488
l_libs_start:
492
  lib0 l_libs boxlib_name, sys_path, file_name, system_dir0, err_message_found_lib0, head_f_l, boxlib_import,err_message_import0, head_f_i
489
  lib0 l_libs boxlib_name, sys_path, file_name, system_dir0, err_message_found_lib0, head_f_l, boxlib_import,err_message_import0, head_f_i
493
  lib1 l_libs libimg_name, sys_path, file_name, system_dir1, err_message_found_lib1, head_f_l, libimg_import, err_message_import1, head_f_i
490
  lib1 l_libs libimg_name, sys_path, file_name, system_dir1, err_message_found_lib1, head_f_l, libimg_import, err_message_import1, head_f_i
494
  lib2 l_libs strlib_name, sys_path, file_name, system_dir2, err_message_found_lib2, head_f_l, strlib_import, err_message_import2, head_f_i
491
  lib2 l_libs strlib_name, sys_path, file_name, system_dir2, err_message_found_lib2, head_f_l, strlib_import, err_message_import2, head_f_i
495
  lib3 l_libs libini_name, sys_path, file_name, system_dir3, err_message_found_lib3, head_f_l, libini_import, err_message_import3, head_f_i
492
  lib3 l_libs libini_name, sys_path, file_name, system_dir3, err_message_found_lib3, head_f_l, libini_import, err_message_import3, head_f_i
496
load_lib_end:
493
load_lib_end:
497
 
494
 
498
align 4
495
align 4
499
button:
496
button:
500
  mcall 17 ;¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨
497
  mcall 17 ;¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨
501
  cmp ah,5
498
  cmp ah,5
502
  jne @f
499
  jne @f
503
    call but_ZoomM
500
    call but_ZoomM
504
  @@:
501
  @@:
505
  cmp ah,6
502
  cmp ah,6
506
  jne @f
503
  jne @f
507
    call but_ZoomP
504
    call but_ZoomP
508
  @@:
505
  @@:
509
  cmp ah,7
506
  cmp ah,7
510
  jne @f
507
  jne @f
511
    call but_Refresh
508
    call but_Refresh
512
  @@:
509
  @@:
513
 
510
 
514
  cmp ah,9
511
  cmp ah,9
515
  jz  but_MetSave
512
  jz  but_MetSave
516
  cmp ah,8
513
  cmp ah,8
517
  jz  but_MetAdd
514
  jz  but_MetAdd
518
 
515
 
519
  cmp ah,10
516
  cmp ah,10
520
  jne @f
517
  jne @f
521
    call but_met_up
518
    call but_met_up
522
  @@:
519
  @@:
523
  cmp ah,11
520
  cmp ah,11
524
  jne @f
521
  jne @f
525
    call but_met_dn
522
    call but_met_dn
526
  @@:
523
  @@:
527
  cmp ah,12
524
  cmp ah,12
528
  jne @f
525
  jne @f
529
    call fun_goto_met
526
    call fun_goto_met
530
  @@:
527
  @@:
531
  cmp ah,13 ;¤¨ «®£ OpenDialog ¤«ï ¯®¨áª  ¯ ¯ª¨
528
  cmp ah,13 ;¤¨ «®£ OpenDialog ¤«ï ¯®¨áª  ¯ ¯ª¨
532
  jne @f
529
  jne @f
533
    call fun_opn_dlg
530
    call fun_opn_dlg
534
  @@:
531
  @@:
535
  cmp ah,1
532
  cmp ah,1
536
  jne still
533
  jne still
537
 
534
 
538
.exit:
535
.exit:
539
  push dword[bmp_icon]
536
  push dword[bmp_icon]
540
  call mem.Free
537
  call mem.Free
541
  stdcall array_tile_function, tile_00,max_tiles_count,tile_destroy
538
  stdcall array_tile_function, tile_00,max_tiles_count,tile_destroy
542
 
539
 
543
  stdcall dword[tl_data_clear], tree1
540
  stdcall dword[tl_data_clear], tree1
544
  mov dword[tree2.data_img_sys],0 ;ç¨á⨬ 㪠§ â¥«ì ­  á¨á⥬­ë¥ ¨ª®­ª¨,
541
  mov dword[tree2.data_img_sys],0 ;ç¨á⨬ 㪠§ â¥«ì ­  á¨á⥬­ë¥ ¨ª®­ª¨,
545
    ;â. ª. ®­¨ ¡ë«¨ 㤠«¥­ë ¢¥àå­¥© ä㭪樥© tl_data_clear
542
    ;â. ª. ®­¨ ¡ë«¨ 㤠«¥­ë ¢¥àå­¥© ä㭪樥© tl_data_clear
546
    ;¯®¢â®à­ë© ¢ë§®¢ tl_data_clear ¡¥§ ç¨á⪨ 㪠§ â¥«ï ¢ë§¢¥â ®è¨¡ªã
543
    ;¯®¢â®à­ë© ¢ë§®¢ tl_data_clear ¡¥§ ç¨á⪨ 㪠§ â¥«ï ¢ë§¢¥â ®è¨¡ªã
547
  mov dword[tree2.data_img],0 ;ç¨á⨬ 㪠§ â¥«ì ­  ¨ª®­ª¨ 㧫®¢
544
  mov dword[tree2.data_img],0 ;ç¨á⨬ 㪠§ â¥«ì ­  ¨ª®­ª¨ 㧫®¢
548
  stdcall dword[tl_data_clear], tree2
545
  stdcall dword[tl_data_clear], tree2
549
 
546
 
550
;  stdcall dword[img_destroy], dword[data_icon]
547
;  stdcall dword[img_destroy], dword[data_icon]
551
  mcall -1 ;¢ë室 ¨§ ¯à®£à ¬¬ë
548
  mcall -1 ;¢ë室 ¨§ ¯à®£à ¬¬ë
552
 
549
 
553
 
550
 
554
;input:
551
;input:
555
;data_rgb - pointer to rgb data
552
;data_rgb - pointer to rgb data
556
;size - count img pixels (size img data / 3(rgb) )
553
;size - count img pixels (size img data / 3(rgb) )
557
align 4
554
align 4
558
proc img_rgb_wdiv2 data_rgb:dword, size:dword
555
proc img_rgb_wdiv2 data_rgb:dword, size:dword
559
  push eax ebx ecx edx
556
  push eax ebx ecx edx
560
  mov eax,dword[data_rgb]
557
  mov eax,dword[data_rgb]
561
  mov ecx,dword[size] ;ecx = size
558
  mov ecx,dword[size] ;ecx = size
562
  imul ecx,3
559
  imul ecx,3
563
  @@: ;§ â¥¬­¥­¨¥ æ¢¥â  ¯¨ªá¥«¥©
560
  @@: ;§ â¥¬­¥­¨¥ æ¢¥â  ¯¨ªá¥«¥©
564
    shr byte[eax],1
561
    shr byte[eax],1
565
    and byte[eax],0x7f
562
    and byte[eax],0x7f
566
    inc eax
563
    inc eax
567
    loop @b
564
    loop @b
568
 
565
 
569
  mov eax,dword[data_rgb]
566
  mov eax,dword[data_rgb]
570
  mov ecx,dword[size] ;ecx = size
567
  mov ecx,dword[size] ;ecx = size
571
  shr ecx,1
568
  shr ecx,1
572
  @@: ;á«®¦¥­¨¥ 梥⮢ ¯¨ªá¥«¥©
569
  @@: ;á«®¦¥­¨¥ 梥⮢ ¯¨ªá¥«¥©
573
    mov ebx,dword[eax+3] ;ª®¯¨à㥬 梥â á®á¥¤­¥£® ¯¨ªá¥«ï
570
    mov ebx,dword[eax+3] ;ª®¯¨à㥬 梥â á®á¥¤­¥£® ¯¨ªá¥«ï
574
    add word[eax],bx
571
    add word[eax],bx
575
    shr ebx,16
572
    shr ebx,16
576
    add byte[eax+2],bl
573
    add byte[eax+2],bl
577
 
574
 
578
    add eax,6 ;=2*3
575
    add eax,6 ;=2*3
579
    loop @b
576
    loop @b
580
 
577
 
581
  mov eax,dword[data_rgb]
578
  mov eax,dword[data_rgb]
582
  add eax,3
579
  add eax,3
583
  mov ebx,eax
580
  mov ebx,eax
584
  add ebx,3
581
  add ebx,3
585
  mov ecx,dword[size] ;ecx = size
582
  mov ecx,dword[size] ;ecx = size
586
  shr ecx,1
583
  shr ecx,1
587
  dec ecx ;«¨è­¨© ¯¨ªá¥«ì
584
  dec ecx ;«¨è­¨© ¯¨ªá¥«ì
588
  @@: ;¯®¤¦ â¨¥ ¯¨ªá¥«¥©
585
  @@: ;¯®¤¦ â¨¥ ¯¨ªá¥«¥©
589
    mov edx,dword[ebx]
586
    mov edx,dword[ebx]
590
    mov word[eax],dx
587
    mov word[eax],dx
591
    shr edx,16
588
    shr edx,16
592
    mov byte[eax+2],dl
589
    mov byte[eax+2],dl
593
 
590
 
594
    add eax,3
591
    add eax,3
595
    add ebx,6
592
    add ebx,6
596
    loop @b
593
    loop @b
597
 
594
 
598
  pop edx ecx ebx eax
595
  pop edx ecx ebx eax
599
  ret
596
  ret
600
endp
597
endp
601
 
598
 
602
;input:
599
;input:
603
;data_rgb - pointer to rgb data
600
;data_rgb - pointer to rgb data
604
;size - count img pixels (size img data / 3(rgb) )
601
;size - count img pixels (size img data / 3(rgb) )
605
;size_w - width img in pixels
602
;size_w - width img in pixels
606
align 4
603
align 4
607
proc img_rgb_hdiv2, data_rgb:dword, size:dword, size_w:dword
604
proc img_rgb_hdiv2, data_rgb:dword, size:dword, size_w:dword
608
  pushad
605
  pushad
609
 
606
 
610
  mov eax,dword[data_rgb] ;eax =
607
  mov eax,dword[data_rgb] ;eax =
611
  mov ecx,dword[size]	  ;ecx = size
608
  mov ecx,dword[size]	  ;ecx = size
612
  imul ecx,3
609
  imul ecx,3
613
  @@: ;§ â¥¬­¥­¨¥ æ¢¥â  ¯¨ªá¥«¥©
610
  @@: ;§ â¥¬­¥­¨¥ æ¢¥â  ¯¨ªá¥«¥©
614
    shr byte[eax],1
611
    shr byte[eax],1
615
    and byte[eax],0x7f
612
    and byte[eax],0x7f
616
    inc eax
613
    inc eax
617
    loop @b
614
    loop @b
618
 
615
 
619
  mov eax,dword[data_rgb] ;eax =
616
  mov eax,dword[data_rgb] ;eax =
620
  mov edi,dword[size_w]
617
  mov edi,dword[size_w]
621
  lea esi,[edi+edi*2] ;esi = width*3(rgb)
618
  lea esi,[edi+edi*2] ;esi = width*3(rgb)
622
  mov ebx,esi
619
  mov ebx,esi
623
  add ebx,eax
620
  add ebx,eax
624
  mov ecx,dword[size]  ;ecx = size
621
  mov ecx,dword[size]  ;ecx = size
625
  shr ecx,1
622
  shr ecx,1
626
  xor edi,edi
623
  xor edi,edi
627
  @@: ;á«®¦¥­¨¥ 梥⮢ ¯¨ªá¥«¥©
624
  @@: ;á«®¦¥­¨¥ 梥⮢ ¯¨ªá¥«¥©
628
    mov edx,dword[ebx] ;ª®¯¨à㥬 梥⠭¨¦­¥£® ¯¨ªá¥«ï
625
    mov edx,dword[ebx] ;ª®¯¨à㥬 梥⠭¨¦­¥£® ¯¨ªá¥«ï
629
    add word[eax],dx
626
    add word[eax],dx
630
    shr edx,16
627
    shr edx,16
631
    add byte[eax+2],dl
628
    add byte[eax+2],dl
632
 
629
 
633
    add eax,3
630
    add eax,3
634
    add ebx,3
631
    add ebx,3
635
    inc edi
632
    inc edi
636
    cmp edi,dword[size_w]
633
    cmp edi,dword[size_w]
637
    jl .old_line
634
    jl .old_line
638
      add eax,esi
635
      add eax,esi
639
      add ebx,esi
636
      add ebx,esi
640
      xor edi,edi
637
      xor edi,edi
641
    .old_line:
638
    .old_line:
642
    loop @b
639
    loop @b
643
 
640
 
644
 
641
 
645
  mov eax,dword[data_rgb] ;eax =
642
  mov eax,dword[data_rgb] ;eax =
646
  add eax,esi ;esi = width*3(rgb)
643
  add eax,esi ;esi = width*3(rgb)
647
  mov ebx,esi
644
  mov ebx,esi
648
  add ebx,eax
645
  add ebx,eax
649
  mov ecx,dword[size] ;ecx = size
646
  mov ecx,dword[size] ;ecx = size
650
  shr ecx,1
647
  shr ecx,1
651
  sub ecx,dword[size_w] ;«¨è­ïï áâப  ¯¨ªá¥«¥©
648
  sub ecx,dword[size_w] ;«¨è­ïï áâப  ¯¨ªá¥«¥©
652
  xor edi,edi
649
  xor edi,edi
653
  @@: ;¯®¤¦ â¨¥ ¯¨ªá¥«¥©
650
  @@: ;¯®¤¦ â¨¥ ¯¨ªá¥«¥©
654
    mov edx,dword[ebx] ;ª®¯¨à㥬 梥⠭¨¦­¥£® ¯¨ªá¥«ï
651
    mov edx,dword[ebx] ;ª®¯¨à㥬 梥⠭¨¦­¥£® ¯¨ªá¥«ï
655
    mov word[eax],dx
652
    mov word[eax],dx
656
    shr edx,16
653
    shr edx,16
657
    mov byte[eax+2],dl
654
    mov byte[eax+2],dl
658
 
655
 
659
    add eax,3
656
    add eax,3
660
    add ebx,3
657
    add ebx,3
661
    inc edi
658
    inc edi
662
    cmp edi,dword[size_w]
659
    cmp edi,dword[size_w]
663
    jl .old_line_2
660
    jl .old_line_2
664
      add ebx,esi
661
      add ebx,esi
665
      xor edi,edi
662
      xor edi,edi
666
    .old_line_2:
663
    .old_line_2:
667
    loop @b
664
    loop @b
668
 
665
 
669
  popad
666
  popad
670
  ret
667
  ret
671
endp
668
endp
672
 
669
 
673
;input:
670
;input:
674
;data_rgb - pointer to rgb data
671
;data_rgb - pointer to rgb data
675
;size - count img pixels (size img data / 3(rgb) )
672
;size - count img pixels (size img data / 3(rgb) )
676
align 4
673
align 4
677
proc img_rgb_wmul2, data_rgb:dword, size:dword
674
proc img_rgb_wmul2, data_rgb:dword, size:dword
678
  push eax ebx ecx edx
675
  push eax ebx ecx edx
679
  ;eax - source
676
  ;eax - source
680
  ;ebx - destination
677
  ;ebx - destination
681
  mov ecx,dword[size] ;ecx = size
678
  mov ecx,dword[size] ;ecx = size
682
  mov eax,ecx
679
  mov eax,ecx
683
  dec eax
680
  dec eax
684
  lea eax,[eax+eax*2] ;eax = (size-1)*3
681
  lea eax,[eax+eax*2] ;eax = (size-1)*3
685
  mov ebx,eax ;ebx = size*3
682
  mov ebx,eax ;ebx = size*3
686
  add eax,dword[data_rgb] ;eax = pointer + size*3
683
  add eax,dword[data_rgb] ;eax = pointer + size*3
687
  add ebx,eax ;ebx = pointer + 2*size*3
684
  add ebx,eax ;ebx = pointer + 2*size*3
688
  @@:
685
  @@:
689
    mov edx,dword[eax] ;edx = pixel color
686
    mov edx,dword[eax] ;edx = pixel color
690
    mov word[ebx],dx
687
    mov word[ebx],dx
691
    mov word[ebx+3],dx
688
    mov word[ebx+3],dx
692
    shr edx,16
689
    shr edx,16
693
    mov byte[ebx+2],dl
690
    mov byte[ebx+2],dl
694
    mov byte[ebx+3+2],dl
691
    mov byte[ebx+3+2],dl
695
    sub eax,3
692
    sub eax,3
696
    sub ebx,6
693
    sub ebx,6
697
    loop @b
694
    loop @b
698
  pop edx ecx ebx eax
695
  pop edx ecx ebx eax
699
  ret
696
  ret
700
endp
697
endp
701
 
698
 
702
;äã­ªæ¨ï ¤«ï à áâ¢ ­¨ï ¨§®¡à ¦¥­¨ï ¯® ¢ëá®â¥ ¢ 2 à § 
699
;äã­ªæ¨ï ¤«ï à áâ¢ ­¨ï ¨§®¡à ¦¥­¨ï ¯® ¢ëá®â¥ ¢ 2 à § 
703
;¢ 㪠§ â¥«¥ data_rgb ¯ ¬ï⨠¤®«¦­® ¡ëâì ¢ 2 à §  ¡®«ìè¥ ç¥¬ size*3
700
;¢ 㪠§ â¥«¥ data_rgb ¯ ¬ï⨠¤®«¦­® ¡ëâì ¢ 2 à §  ¡®«ìè¥ ç¥¬ size*3
704
;¨­ ç¥ ¯à¨ à áâ¢ ­¨¨ ¡ã¤¥â ®è¨¡ª , ¢ë室  ­  çã¦ãî ¯ ¬ïâì
701
;¨­ ç¥ ¯à¨ à áâ¢ ­¨¨ ¡ã¤¥â ®è¨¡ª , ¢ë室  ­  çã¦ãî ¯ ¬ïâì
705
;input:
702
;input:
706
;data_rgb - pointer to rgb data
703
;data_rgb - pointer to rgb data
707
;size - count img pixels (size img data / 3(rgb) )
704
;size - count img pixels (size img data / 3(rgb) )
708
;size_w - width img in pixels
705
;size_w - width img in pixels
709
align 4
706
align 4
710
proc img_rgb_hmul2, data_rgb:dword, size:dword, size_w:dword
707
proc img_rgb_hmul2, data_rgb:dword, size:dword, size_w:dword
711
  pushad
708
  pushad
712
 
709
 
713
  mov esi,dword[size_w]
710
  mov esi,dword[size_w]
714
  lea esi,[esi+esi*2] ;esi = width * 3(rgb)
711
  lea esi,[esi+esi*2] ;esi = width * 3(rgb)
715
  mov eax,dword[size]
712
  mov eax,dword[size]
716
  lea eax,[eax+eax*2]
713
  lea eax,[eax+eax*2]
717
  mov edi,eax
714
  mov edi,eax
718
  shl edi,1
715
  shl edi,1
719
  add eax,dword[data_rgb] ;eax = pointer to end pixel (old image) + 1
716
  add eax,dword[data_rgb] ;eax = pointer to end pixel (old image) + 1
720
  add edi,dword[data_rgb] ;edi = pointer to end pixel (new image) + 1
717
  add edi,dword[data_rgb] ;edi = pointer to end pixel (new image) + 1
721
  mov ebx,edi
718
  mov ebx,edi
722
  sub ebx,esi
719
  sub ebx,esi
723
 
720
 
724
  .beg_line:
721
  .beg_line:
725
  mov ecx,dword[size_w]
722
  mov ecx,dword[size_w]
726
  @@:
723
  @@:
727
    sub eax,3
724
    sub eax,3
728
    sub ebx,3
725
    sub ebx,3
729
    sub edi,3
726
    sub edi,3
730
 
727
 
731
    mov edx,dword[eax] ;edx = pixel color
728
    mov edx,dword[eax] ;edx = pixel color
732
    mov word[ebx],dx
729
    mov word[ebx],dx
733
    mov word[edi],dx
730
    mov word[edi],dx
734
    shr edx,16
731
    shr edx,16
735
    mov byte[ebx+2],dl
732
    mov byte[ebx+2],dl
736
    mov byte[edi+2],dl
733
    mov byte[edi+2],dl
737
 
734
 
738
    loop @b
735
    loop @b
739
 
736
 
740
  sub ebx,esi
737
  sub ebx,esi
741
  sub edi,esi
738
  sub edi,esi
742
 
739
 
743
  cmp eax,dword[data_rgb]
740
  cmp eax,dword[data_rgb]
744
  jg .beg_line
741
  jg .beg_line
745
 
742
 
746
  popad
743
  popad
747
  ret
744
  ret
748
endp
745
endp
749
 
746
 
750
;input:
747
;input:
751
;data_rgb - pointer to rgb data
748
;data_rgb - pointer to rgb data
752
;size - count img pixels (size img data / 3(rgb) )
749
;size - count img pixels (size img data / 3(rgb) )
753
;size_w - width img in pixels
750
;size_w - width img in pixels
754
align 4
751
align 4
755
proc img_rgb_hoffs, data_rgb:dword, size:dword, size_w:dword, hoffs:dword
752
proc img_rgb_hoffs, data_rgb:dword, size:dword, size_w:dword, hoffs:dword
756
  push eax ebx ecx edx esi
753
  push eax ebx ecx edx esi
757
 
754
 
758
  mov esi,dword[size_w]
755
  mov esi,dword[size_w]
759
  lea esi,[esi+esi*2] ;esi = width * 3(rgb)
756
  lea esi,[esi+esi*2] ;esi = width * 3(rgb)
760
  imul esi,dword[hoffs]
757
  imul esi,dword[hoffs]
761
 
758
 
762
  mov eax,dword[size]
759
  mov eax,dword[size]
763
  lea eax,[eax+eax*2]
760
  lea eax,[eax+eax*2]
764
  add eax,dword[data_rgb] ;eax = pointer to end pixel + 1
761
  add eax,dword[data_rgb] ;eax = pointer to end pixel + 1
765
  sub eax,3
762
  sub eax,3
766
  mov ebx,eax
763
  mov ebx,eax
767
  add ebx,esi
764
  add ebx,esi
768
 
765
 
769
  mov ecx,dword[size]
766
  mov ecx,dword[size]
770
  dec ecx
767
  dec ecx
771
  @@:
768
  @@:
772
    mov edx,dword[eax] ;edx = pixel color
769
    mov edx,dword[eax] ;edx = pixel color
773
    mov word[ebx],dx
770
    mov word[ebx],dx
774
    shr edx,16
771
    shr edx,16
775
    mov byte[ebx+2],dl
772
    mov byte[ebx+2],dl
776
 
773
 
777
    sub eax,3
774
    sub eax,3
778
    sub ebx,3
775
    sub ebx,3
779
    loop @b
776
    loop @b
780
  pop esi edx ecx ebx eax
777
  pop esi edx ecx ebx eax
781
  ret
778
  ret
782
endp
779
endp
783
 
780
 
784
 
781
 
785
;input:
782
;input:
786
;data_rgb - pointer to rgb data
783
;data_rgb - pointer to rgb data
787
;size_w_old - width img in pixels
784
;size_w_old - width img in pixels
788
;size_w_new - new width img in pixels
785
;size_w_new - new width img in pixels
789
;size_h - height img in pixels
786
;size_h - height img in pixels
790
align 4
787
align 4
791
proc img_rgb_wcrop, data_rgb:dword, size_w_old:dword, size_w_new:dword, size_h:dword
788
proc img_rgb_wcrop, data_rgb:dword, size_w_old:dword, size_w_new:dword, size_h:dword
792
  pushad
789
  pushad
793
    mov eax, dword[size_w_old]
790
    mov eax, dword[size_w_old]
794
    lea eax, dword[eax+eax*2] ;eax = width(old) * 3(rgb)
791
    lea eax, dword[eax+eax*2] ;eax = width(old) * 3(rgb)
795
    mov ebx, dword[size_w_new]
792
    mov ebx, dword[size_w_new]
796
    lea ebx, dword[ebx+ebx*2] ;ebx = width(new) * 3(rgb)
793
    lea ebx, dword[ebx+ebx*2] ;ebx = width(new) * 3(rgb)
797
    mov edx, dword[size_h]
794
    mov edx, dword[size_h]
798
    ;dec edx
795
    ;dec edx
799
    mov edi, dword[data_rgb] ;edi - ¯®«ã砥⠤ ­­ë¥
796
    mov edi, dword[data_rgb] ;edi - ¯®«ã砥⠤ ­­ë¥
800
    mov esi, edi
797
    mov esi, edi
801
    add edi, ebx
798
    add edi, ebx
802
    add esi, eax
799
    add esi, eax
803
    cld
800
    cld
804
  @@:
801
  @@:
805
    dec edx ;㬥­ìè ¥¬ áç¥â稪 ®áâ ¢è¨åáï áâப ­  1
802
    dec edx ;㬥­ìè ¥¬ áç¥â稪 ®áâ ¢è¨åáï áâப ­  1
806
    cmp edx,0
803
    cmp edx,0
807
    jle @f
804
    jle @f
808
 
805
 
809
    mov ecx, ebx
806
    mov ecx, ebx
810
    rep movsb ;¯¥à¥­®á (ª®¯¨à®¢ ­¨¥) áâப¨ ¯¨ªá¥«¥©
807
    rep movsb ;¯¥à¥­®á (ª®¯¨à®¢ ­¨¥) áâப¨ ¯¨ªá¥«¥©
811
;stdcall mem_copy,esi,edi,ebx
808
;stdcall mem_copy,esi,edi,ebx
812
 
809
 
813
    add esi,eax ;¯¥à¥å®¤ ­  ­®¢ãî áâà®çªã ¨§®¡à ¦¥­¨ï
810
    add esi,eax ;¯¥à¥å®¤ ­  ­®¢ãî áâà®çªã ¨§®¡à ¦¥­¨ï
814
    sub esi,ebx
811
    sub esi,ebx
815
;add esi,eax
812
;add esi,eax
816
;add edi,ebx
813
;add edi,ebx
817
    jmp @b
814
    jmp @b
818
  @@:
815
  @@:
819
 
816
 
820
  popad
817
  popad
821
  ret
818
  ret
822
endp
819
endp
823
 
820
 
824
align 4
821
align 4
825
proc mem_copy, source:dword, destination:dword, len:dword
822
proc mem_copy, source:dword, destination:dword, len:dword
826
  push ecx esi edi
823
  push ecx esi edi
827
    cld
824
    cld
828
    mov esi, dword[source]
825
    mov esi, dword[source]
829
    mov edi, dword[destination]
826
    mov edi, dword[destination]
830
    mov ecx, dword[len]
827
    mov ecx, dword[len]
831
    rep movsb
828
    rep movsb
832
  pop edi esi ecx
829
  pop edi esi ecx
833
  ret
830
  ret
834
endp
831
endp
835
 
832
 
836
align 4
833
align 4
837
proc mem_clear, mem:dword, len:dword
834
proc mem_clear, mem:dword, len:dword
838
  push eax ecx edi
835
  push eax ecx edi
839
    cld
836
    cld
840
    xor al,al
837
    xor al,al
841
    mov edi, dword[mem]
838
    mov edi, dword[mem]
842
    mov ecx, dword[len]
839
    mov ecx, dword[len]
843
    repne stosb
840
    repne stosb
844
  pop edi ecx eax
841
  pop edi ecx eax
845
  ret
842
  ret
846
endp
843
endp
847
 
844
 
848
align 4
845
align 4
849
fun_opn_dlg: ;äã­ªæ¨ï ¤«ï ¢ë§®¢  OpenFile ¤¨ «®£ 
846
fun_opn_dlg: ;äã­ªæ¨ï ¤«ï ¢ë§®¢  OpenFile ¤¨ «®£ 
850
	pushad
847
	pushad
851
	copy_path open_dialog_name,communication_area_default_path,file_name,0
848
	copy_path open_dialog_name,communication_area_default_path,file_name,0
852
	mov [OpenDialog_data.type],2
849
	mov [OpenDialog_data.type],2
853
	mov dword[plugin_path],0 ;çâ®-¡ë ¯à¨ ®âªàë⨨ ¤¨ «®£®¢®£® ®ª­  ¯ãâì ¢á¥£¤  ¡à «áï ¨§ OpenDialog_data.dir_default_path
850
	mov dword[plugin_path],0 ;çâ®-¡ë ¯à¨ ®âªàë⨨ ¤¨ «®£®¢®£® ®ª­  ¯ãâì ¢á¥£¤  ¡à «áï ¨§ OpenDialog_data.dir_default_path
854
	start_OpenDialog OpenDialog_data
851
	start_OpenDialog OpenDialog_data
855
	cmp [OpenDialog_data.status],2
852
	cmp [OpenDialog_data.status],2
856
	je @f
853
	je @f
857
		mov esi,[OpenDialog_data.openfile_path]
854
		mov esi,[OpenDialog_data.openfile_path]
858
		stdcall [str_len],dword[edit1.text],dword[edit1.max]
855
		stdcall [str_len],dword[edit1.text],dword[edit1.max]
859
		mov [edit1.size],eax
856
		mov [edit1.size],eax
860
		mov [edit1.pos],eax
857
		mov [edit1.pos],eax
861
		stdcall [edit_box_draw], edit1
858
		stdcall [edit_box_draw], edit1
862
	@@:
859
	@@:
863
	popad
860
	popad
864
	ret
861
	ret
865
 
862
 
866
  txt_met_up db 24,0
863
  txt_met_up db 24,0
867
  txt_met_dn db 25,0
864
  txt_met_dn db 25,0
868
  txt_met_sh db '*',0
865
  txt_met_sh db '*',0
869
  txt_zoom_m db '-',0
866
  txt_zoom_m db '-',0
870
  txt_zoom_p db '+',0
867
  txt_zoom_p db '+',0
871
  txt151 db '„®¡ ¢¨âì ¬¥âªã',0
868
  txt151 db '„®¡ ¢¨âì ¬¥âªã',0
872
  txt152 db '‘®åà ­¨âì ¬¥âª¨',0
869
  txt152 db '‘®åà ­¨âì ¬¥âª¨',0
873
  txt_but_refresh db 'Ž¡­®¢¨âì',0
870
  txt_but_refresh db 'Ž¡­®¢¨âì',0
874
  txt_cache db 'Cache:',0
871
  txt_cache db 'Cache:',0
875
  txt141 db '‚¨¤ ª àâë',0
872
  txt141 db '‚¨¤ ª àâë',0
876
  txt142 db '‚ë¡®à ¬¥âª¨',0
873
  txt142 db '‚ë¡®à ¬¥âª¨',0
877
 
874
 
878
; check_boxes
875
; check_boxes
879
ch1 check_box 5,  5, 6, 12, 0xffffd0, 0x800000, 0, ch_text1, 12,ch_flag_en
876
ch1 check_box 5,  5, 6, 12, 0xffffd0, 0x800000, 0, ch_text1, 12,ch_flag_en
880
ch2 check_box 5, 20, 6, 12, 0xffffd0, 0x800000, 0, ch_text2, 11,ch_flag_en
877
ch2 check_box 5, 20, 6, 12, 0xffffd0, 0x800000, 0, ch_text2, 11,ch_flag_en
881
checkboxes_end:
878
checkboxes_end:
882
 
879
 
883
ch_text1 db '¡à âì ᢥàåã'
880
ch_text1 db '¡à âì ᢥàåã'
884
ch_text2 db '¡à âì á­¨§ã'
881
ch_text2 db '¡à âì á­¨§ã'
885
 
882
 
886
edit1 edit_box 190, 215,  10, 0xd0ffff, 0xff, 0x80ff, 0, 0xa000, 4090, openfile_path, mouse_dd, 0
883
edit1 edit_box 190, 215,  10, 0xd0ffff, 0xff, 0x80ff, 0, 0xa000, 4090, openfile_path, mouse_dd, 0
887
edit2 edit_box 100, 370, 240, 0xd0ffff, 0xff, 0x80ff, 0, 0xa000,  30, ed_buffer.2, mouse_dd, 0
884
edit2 edit_box 100, 370, 240, 0xd0ffff, 0xff, 0x80ff, 0, 0xa000,  30, ed_buffer.2, mouse_dd, 0
888
editboxes_end:
885
editboxes_end:
889
 
886
 
890
tree1 tree_list 10,10, tl_list_box_mode+tl_key_no_edit, 16,16,\
887
tree1 tree_list 10,10, tl_list_box_mode+tl_key_no_edit, 16,16,\
891
    0x8080ff,0x0000ff,0xffffff, 265,45,90,85, 0,0,0,\
888
    0x8080ff,0x0000ff,0xffffff, 265,45,90,85, 0,0,0,\
892
    el_focus, 0,fun_new_map_type
889
    el_focus, 0,fun_new_map_type
893
tree2 tree_list 32,300, tl_draw_par_line, 16,16,\
890
tree2 tree_list 32,300, tl_draw_par_line, 16,16,\
894
    0x8080ff,0x0000ff,0xffffff, 265,145,190,85, 0,12,0,\
891
    0x8080ff,0x0000ff,0xffffff, 265,145,190,85, 0,12,0,\
895
    el_focus, wScrMetki,fun_goto_met
892
    el_focus, wScrMetki,fun_goto_met
896
 
893
 
897
align 4
894
align 4
898
wScrMetki:
895
wScrMetki:
899
.x:
896
.x:
900
.size_x     dw 16 ;+0
897
.size_x     dw 16 ;+0
901
.start_x    dw 0 ;+2
898
.start_x    dw 0 ;+2
902
.y:
899
.y:
903
.size_y     dw 100 ;+4
900
.size_y     dw 100 ;+4
904
.start_y    dw 0 ;+6
901
.start_y    dw 0 ;+6
905
.btn_high   dd 15 ;+8
902
.btn_high   dd 15 ;+8
906
.type	    dd 1  ;+12
903
.type	    dd 1  ;+12
907
.max_area   dd 100  ;+16
904
.max_area   dd 100  ;+16
908
.cur_area   dd 30  ;+20
905
.cur_area   dd 30  ;+20
909
.position   dd 0  ;+24
906
.position   dd 0  ;+24
910
.bckg_col   dd 0xeeeeee ;+28
907
.bckg_col   dd 0xeeeeee ;+28
911
.frnt_col   dd 0xbbddff ;+32
908
.frnt_col   dd 0xbbddff ;+32
912
.line_col   dd 0  ;+36
909
.line_col   dd 0  ;+36
913
.redraw     dd 0  ;+40
910
.redraw     dd 0  ;+40
914
.delta	    dw 0  ;+44
911
.delta	    dw 0  ;+44
915
.delta2     dw 0  ;+46
912
.delta2     dw 0  ;+46
916
.run_x:
913
.run_x:
917
.r_size_x   dw 0  ;+48
914
.r_size_x   dw 0  ;+48
918
.r_start_x  dw 0  ;+50
915
.r_start_x  dw 0  ;+50
919
.run_y:
916
.run_y:
920
.r_size_y   dw 0 ;+52
917
.r_size_y   dw 0 ;+52
921
.r_start_y  dw 0 ;+54
918
.r_start_y  dw 0 ;+54
922
.m_pos	    dd 0 ;+56
919
.m_pos	    dd 0 ;+56
923
.m_pos_2    dd 0 ;+60
920
.m_pos_2    dd 0 ;+60
924
.m_keys     dd 0 ;+64
921
.m_keys     dd 0 ;+64
925
.run_size   dd 0 ;+68
922
.run_size   dd 0 ;+68
926
.position2  dd 0 ;+72
923
.position2  dd 0 ;+72
927
.work_size  dd 0 ;+76
924
.work_size  dd 0 ;+76
928
.all_redraw dd 0 ;+80
925
.all_redraw dd 0 ;+80
929
.ar_offset  dd 1 ;+84
926
.ar_offset  dd 1 ;+84
930
 
927
 
931
ed_buffer: ;òåêñò äëÿ edit
928
ed_buffer: ;òåêñò äëÿ edit
932
  .2: rb 32
929
  .2: rb 32
933
 
930
 
934
el_focus dd tree1
931
el_focus dd tree1
935
 
932
 
936
tree_sys_icon dd 0
933
tree_sys_icon dd 0
937
tree_nod_icon dd 0
934
tree_nod_icon dd 0
938
 
935
 
939
bmp_icon   dd 0 ;¯ ¬ïâì ¤«ï § £à㧪¨ ¨§®¡à ¦¥­¨ï
936
bmp_icon   dd 0 ;¯ ¬ïâì ¤«ï § £à㧪¨ ¨§®¡à ¦¥­¨ï
940
data_icon  dd 0 ;¯ ¬ïâì ¤«ï ¯à¥®¡à §®¢ ­¨ï ª à⨭ª¨ äã­ªæ¨ï¬¨ libimg
937
data_icon  dd 0 ;¯ ¬ïâì ¤«ï ¯à¥®¡à §®¢ ­¨ï ª à⨭ª¨ äã­ªæ¨ï¬¨ libimg
941
 
938
 
942
run_file_70 FileInfoBlock
939
run_file_70 FileInfoBlock
943
 
940
 
944
 
941
 
945
txt_tile_path db 'tile path',0
942
txt_tile_path db 'tile path',0
946
  rb 300
943
  rb 300
947
txt_tile_type dd txt_tile_type_0 ;㪠§ â¥«ì ­  ¢ë¡à ­­ë© ⨯ ä ©«®¢
944
txt_tile_type dd txt_tile_type_0 ;㪠§ â¥«ì ­  ¢ë¡à ­­ë© ⨯ ä ©«®¢
948
txt_tile_type_0 db 0
945
txt_tile_type_0 db 0
949
  rb 10
946
  rb 10
950
 
947
 
951
;---------------------------------------------------------------------
948
;---------------------------------------------------------------------
952
align 4
949
align 4
953
OpenDialog_data:
950
OpenDialog_data:
954
.type			dd 2
951
.type			dd 2
955
.procinfo		dd procinfo	;+4
952
.procinfo		dd procinfo	;+4
956
.com_area_name		dd communication_area_name	;+8
953
.com_area_name		dd communication_area_name	;+8
957
.com_area		dd 0	;+12
954
.com_area		dd 0	;+12
958
.opendir_path		dd plugin_path	;+16
955
.opendir_path		dd plugin_path	;+16
959
.dir_default_path	dd openfile_path ;+20
956
.dir_default_path	dd openfile_path ;+20
960
.start_path		dd file_name ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
957
.start_path		dd file_name ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
961
.draw_window		dd draw_window	;+28
958
.draw_window		dd draw_window	;+28
962
.status 		dd 0	;+32
959
.status 		dd 0	;+32
963
.openfile_path		dd openfile_path	;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
960
.openfile_path		dd openfile_path	;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
964
.filename_area		dd filename_area	;+40
961
.filename_area		dd filename_area	;+40
965
.filter_area		dd Filter
962
.filter_area		dd Filter
966
 
963
 
967
communication_area_name:
964
communication_area_name:
968
	db 'FFFFFFFF_open_dialog',0
965
	db 'FFFFFFFF_open_dialog',0
969
open_dialog_name:
966
open_dialog_name:
970
	db 'opendial',0
967
	db 'opendial',0
971
communication_area_default_path:
968
communication_area_default_path:
972
	db '/rd/1/File managers/',0
969
	db '/rd/1/File managers/',0
973
 
970
 
974
Filter:
971
Filter:
975
dd Filter.end - Filter.1
972
dd Filter.end - Filter.1
976
.1:
973
.1:
977
db 'TXT',0
974
db 'TXT',0
978
.end:
975
.end:
979
db 0
976
db 0
980
 
977
 
981
align 4
978
align 4
982
map: ;ª®®à¤¨­ âë ª àâë
979
map: ;ª®®à¤¨­ âë ª àâë
983
  .coord_x dd 0 ;ª®®à¤¨­ â  x
980
  .coord_x dd 0 ;ª®®à¤¨­ â  x
984
  .coord_y dd 0 ;ª®®à¤¨­ â  y
981
  .coord_y dd 0 ;ª®®à¤¨­ â  y
985
  .zoom    db 1 ;¬ áèâ ¡
982
  .zoom    db 1 ;¬ áèâ ¡
986
 
983
 
987
align 4
984
align 4
988
tile_00 rb size_tile_struc * max_tiles_count
985
tile_00 rb size_tile_struc * max_tiles_count
989
 
986
 
990
;íâ®â ª®¤ ­¥ ¬®©, ®­ ¯à¥®¡à §ã¥â ç¨á«® ¢ áâபã
987
;íâ®â ª®¤ ­¥ ¬®©, ®­ ¯à¥®¡à §ã¥â ç¨á«® ¢ áâபã
991
;input:
988
;input:
992
; eax = value
989
; eax = value
993
; edi = string buffer
990
; edi = string buffer
994
;output:
991
;output:
995
; edi =
992
; edi =
996
align 4
993
align 4
997
tl_convert_to_str:
994
tl_convert_to_str:
998
  pushad
995
  pushad
999
    mov dword[edi+1],0;0x20202020
996
    mov dword[edi+1],0;0x20202020
1000
    call .str
997
    call .str
1001
  popad
998
  popad
1002
  ret
999
  ret
1003
 
1000
 
1004
align 4
1001
align 4
1005
.str:
1002
.str:
1006
  mov ecx,0x0a ;§ ¤ ¥âáï á¨á⥬  áç¨á«¥­¨ï ¨§¬¥­ïîâáï ॣ¨áâàë ebx,eax,ecx,edx ¢å®¤­ë¥ ¯ à ¬¥âàë eax - ç¨á«®
1003
  mov ecx,0x0a ;§ ¤ ¥âáï á¨á⥬  áç¨á«¥­¨ï ¨§¬¥­ïîâáï ॣ¨áâàë ebx,eax,ecx,edx ¢å®¤­ë¥ ¯ à ¬¥âàë eax - ç¨á«®
1007
    ;¯à¥à¥¢®¤ ç¨á«  ¢ ASCII áâப㠢§®¤­ë¥ ¤ ­­ë¥ ecx=á¨á⥬  áç¨á«¥­ï edi  ¤à¥á ªã¤  § ¯¨á뢠âì, ¡ã¤¥¬ áâபã, ¯à¨ç¥¬ ª®­¥æ ¯¥à¥¬¥­­®© 
1004
    ;¯à¥à¥¢®¤ ç¨á«  ¢ ASCII áâப㠢§®¤­ë¥ ¤ ­­ë¥ ecx=á¨á⥬  áç¨á«¥­ï edi  ¤à¥á ªã¤  § ¯¨á뢠âì, ¡ã¤¥¬ áâபã, ¯à¨ç¥¬ ª®­¥æ ¯¥à¥¬¥­­®© 
1008
  cmp eax,ecx  ;áà ¢­¨âì ¥á«¨ ¢ eax ¬¥­ìè¥ ç¥¬ ¢ ecx â® ¯¥à¥©â¨ ­  @@-1 â.¥. ­  pop eax
1005
  cmp eax,ecx  ;áà ¢­¨âì ¥á«¨ ¢ eax ¬¥­ìè¥ ç¥¬ ¢ ecx â® ¯¥à¥©â¨ ­  @@-1 â.¥. ­  pop eax
1009
  jb @f
1006
  jb @f
1010
  xor edx,edx  ;®ç¨áâ¨âì edx
1007
  xor edx,edx  ;®ç¨áâ¨âì edx
1011
  div ecx      ;à §¤¥«¨âì - ®áâ â®ª ¢ edx
1008
  div ecx      ;à §¤¥«¨âì - ®áâ â®ª ¢ edx
1012
  push edx     ;¯®«®¦¨âì ¢ á⥪
1009
  push edx     ;¯®«®¦¨âì ¢ á⥪
1013
  ;dec edi             ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
1010
  ;dec edi             ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
1014
  call .str;¯¥à¥©â¨ ­  á ¬ã ᥡï â.¥. ¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥­â  ¯®ª  ¢ eax ­¥ áâ ­¥â ¬¥­ìè¥ ç¥¬ ¢ ecx
1011
  call .str;¯¥à¥©â¨ ­  á ¬ã ᥡï â.¥. ¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥­â  ¯®ª  ¢ eax ­¥ áâ ­¥â ¬¥­ìè¥ ç¥¬ ¢ ecx
1015
  pop eax
1012
  pop eax
1016
  @@: ;cmp al,10 ;¯à®¢¥à¨âì ­¥ ¬¥­ìè¥ «¨ §­ ç¥­¨¥ ¢ al 祬 10 (¤«ï á¨á⥬ë áç¨á«¥­ï 10 ¤ ­­ ï ª®¬ ­¤  - «¨è­ ï))
1013
  @@: ;cmp al,10 ;¯à®¢¥à¨âì ­¥ ¬¥­ìè¥ «¨ §­ ç¥­¨¥ ¢ al 祬 10 (¤«ï á¨á⥬ë áç¨á«¥­ï 10 ¤ ­­ ï ª®¬ ­¤  - «¨è­ ï))
1017
  or al,0x30  ;¤ ­­ ï ª®¬ ­¤  ª®à®ç¥  祬 ¤¢¥ ¢ëè¥
1014
  or al,0x30  ;¤ ­­ ï ª®¬ ­¤  ª®à®ç¥  祬 ¤¢¥ ¢ëè¥
1018
  stosb       ;§ ¯¨á âì í«¥¬¥­â ¨§ ॣ¨áâà  al ¢ ï祪㠯 ¬ï⨠es:edi
1015
  stosb       ;§ ¯¨á âì í«¥¬¥­â ¨§ ॣ¨áâà  al ¢ ï祪㠯 ¬ï⨠es:edi
1019
  ret	      ;¢¥à­ãâìáï ç¥­ì ¨­â¥à¥á­ë© 室 â.ª. ¯®ª  ¢ á⥪¥ åà ­¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï
1016
  ret	      ;¢¥à­ãâìáï ç¥­ì ¨­â¥à¥á­ë© 室 â.ª. ¯®ª  ¢ á⥪¥ åà ­¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï
1020
 
1017
 
1021
 
1018
 
1022
hed db 'Planet viewer 27.05.10',0 ;¯®¤¯¨áì ®ª­ 
1019
hed db 'Planet viewer 27.05.10',0 ;¯®¤¯¨áì ®ª­ 
1023
 
1020
 
1024
sc system_colors  ;á¨á⥬­ë¥ 梥â 
1021
sc system_colors  ;á¨á⥬­ë¥ 梥â 
1025
mouse_dd dd 0 ;­ã¦­® ¤«ï Shift-  ¢ editbox
1022
mouse_dd dd 0 ;­ã¦­® ¤«ï Shift-  ¢ editbox
1026
i_end:
1023
i_end:
1027
	rb 1024
1024
	rb 1024
1028
	align 16
1025
	align 16
1029
	procinfo process_information
1026
	procinfo process_information
1030
stacktop:
1027
stacktop:
1031
	sys_path rb 4096
1028
	sys_path rb 4096
1032
	file_name:
1029
	file_name:
1033
		rb 4096
1030
		rb 4096
1034
	plugin_path:
1031
	plugin_path:
1035
		rb 4096
1032
		rb 4096
1036
	openfile_path:
1033
	openfile_path:
1037
		rb 4096
1034
		rb 4096
1038
	filename_area:
1035
	filename_area:
1039
		rb 256
1036
		rb 256
1040
mem:
1037
mem: