Subversion Repositories Kolibri OS

Rev

Rev 8262 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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