Subversion Repositories Kolibri OS

Rev

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

Rev 1705 Rev 1706
1
align 4
1
align 4
2
draw_obj_info:
2
draw_obj_info:
3
	mov eax,13 ;rect
3
	mov eax,13 ;rect
4
	mov edx,WND_CAPT_COLOR
4
	mov edx,WND_CAPT_COLOR
5
	mov ebx,[wndObjI.left]
5
	mov ebx,[wndObjI.left]
6
	shl ebx,16
6
	shl ebx,16
7
	add ebx,[wndObjI.width]
7
	add ebx,[wndObjI.width]
8
	mov ecx,[wndObjI.top]
8
	mov ecx,[wndObjI.top]
9
	add ecx,[recMain.top]
9
	add ecx,[recMain.top]
10
	shl ecx,16
10
	shl ecx,16
11
	add ecx,[wndObjI.height]
11
	add ecx,[wndObjI.height]
12
	sub ecx,[recMain.top]
12
	sub ecx,[recMain.top]
13
	mov edx,0xffffff ;0x80ffffff
13
	mov edx,0xffffff ;0x80ffffff
14
	int 0x40 ;¯àאַ㣮«ì­¨ª ¤«ï ®ª­ 
14
	int 0x40 ;¯àאַ㣮«ì­¨ª ¤«ï ®ª­ 
15
 
15
 
16
	mov ecx,[wndObjI.top] ;draw caption
16
	mov ecx,[wndObjI.top] ;draw caption
17
	shl ecx,16
17
	shl ecx,16
18
	add ecx,[recMain.top]
18
	add ecx,[recMain.top]
19
	mov edx,WND_CAPT_COLOR
19
	mov edx,WND_CAPT_COLOR
20
	int 0x40
20
	int 0x40
21
 
21
 
22
	mov edx,[foc_obj] ;init icon pointers
22
	mov edx,[foc_obj] ;init icon pointers
23
	cmp edx,0
23
	cmp edx,0
24
	je .exit_fun
24
	je .exit_fun
25
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
25
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
26
    pushad
26
    pushad
27
    ;draw caption wndObjI
27
    ;draw caption wndObjI
28
    mov eax,4 ;¯®¤¯¨áì - ­ §¢ ­¨¥ ®¡ê¥ªâ 
28
    mov eax,4 ;¯®¤¯¨áì - ­ §¢ ­¨¥ ®¡ê¥ªâ 
29
 
29
 
30
    mov bl,[edx]
30
    mov bl,[edx]
31
    call find_obj_in_opt
31
    call find_obj_in_opt
32
    mov edx,edi
32
    mov edx,edi
33
 
33
 
34
    mov ebx,[wndObjI.left]
34
    mov ebx,[wndObjI.left]
35
    add ebx,[recMain.left]
35
    add ebx,[recMain.left]
36
    add ebx,4
36
    add ebx,4
37
    shl ebx,16
37
    shl ebx,16
38
    add ebx,[wndObjI.top]
38
    add ebx,[wndObjI.top]
39
    add ebx,4
39
    add ebx,4
40
    mov ecx,0xc0d000ff
40
    mov ecx,0xc0d000ff
41
    mov edi,WND_CAPT_COLOR
41
    mov edi,WND_CAPT_COLOR
42
    add edx,obj_opt.info-obj_opt
42
    add edx,obj_opt.info-obj_opt
43
    int 0x40
43
    int 0x40
44
 
44
 
45
	mov eax,8 ;ª­®¯ª  ¤«ï á®åà ­¥­¨ï ¨§¬¥­¥­¨©
45
	mov eax,8 ;ª­®¯ª  ¤«ï á®åà ­¥­¨ï ¨§¬¥­¥­¨©
46
	mov ebx,125*65536+20
46
	mov ebx,125*65536+20
47
	mov ecx,161*65536+10
47
	mov ecx,161*65536+10
48
	mov edx,10
48
	mov edx,10
49
	mov esi,0xd040
49
	mov esi,0xd040
50
	int 0x40
50
	int 0x40
51
    popad
51
    popad
52
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
52
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
53
	stdcall [edit_box_draw], dword edit2
53
	stdcall [edit_box_draw], dword edit2
54
	stdcall [edit_box_draw], dword edit3
54
	stdcall [edit_box_draw], dword edit3
55
	stdcall [edit_box_draw], dword edit4
55
	stdcall [edit_box_draw], dword edit4
56
	stdcall [edit_box_draw], dword edit5
56
	stdcall [edit_box_draw], dword edit5
57
	stdcall [edit_box_draw], dword edit6
57
	stdcall [edit_box_draw], dword edit6
58
	stdcall [edit_box_draw], dword edit7
58
	stdcall [edit_box_draw], dword edit7
59
	stdcall [edit_box_draw], dword edit8
59
	stdcall [edit_box_draw], dword edit8
60
	stdcall [edit_box_draw], dword edit9
60
	stdcall [edit_box_draw], dword edit9
61
 
61
 
62
	xor ebx,ebx ;­®¬¥à ¯®«ï
62
	xor ebx,ebx ;­®¬¥à ¯®«ï
63
	.draw_column:
63
	.draw_column:
64
		mov eax,ebx
64
		mov eax,ebx
65
		imul eax,[recMain.height]
65
		imul eax,[recMain.height]
66
		add eax,[recMain.top]
66
		add eax,[recMain.top]
67
		add eax,[wndObjI.top]
67
		add eax,[wndObjI.top]
68
		stdcall draw_icon_obj,[edx],ebx,eax
68
		stdcall draw_icon_obj,[edx],ebx,eax
69
 
69
 
70
		inc ebx
70
		inc ebx
71
		cmp ebx,MAX_OPT_FIELDS
71
		cmp ebx,MAX_OPT_FIELDS
72
	jl .draw_column
72
	jl .draw_column
73
	.exit_fun:
73
	.exit_fun:
74
	ret
74
	ret
-
 
75
 
75
 
76
;¯®¤­¨¬ ¥¬ ®¡ê¥ªâ ¢¢¥àå ¯® ᯨáªã
76
align 4
77
align 4
77
but_obj_move_up:
78
but_obj_move_up:
78
	stdcall [tl_node_move_up], tree2
79
	stdcall [tl_node_move_up], tree2
79
	ret
80
	ret
-
 
81
 
80
 
82
;®¯ã᪠¥¬ ®¡ê¥ªâ ¢­¨§ ¯® ᯨáªã
81
align 4
83
align 4
82
but_obj_move_down:
84
but_obj_move_down:
83
	stdcall [tl_node_move_down], tree2
85
	stdcall [tl_node_move_down], tree2
84
	ret
86
	ret
-
 
87
 
-
 
88
;ª®¯¨à㥬 ®¡ê¥ªâ
-
 
89
align 4
-
 
90
but_obj_copy:
-
 
91
push ecx esi edi
-
 
92
	stdcall [tl_node_get_data], tree2
-
 
93
	pop esi
-
 
94
	mov edi,[tree2.data_info] ;¤ ­­ë¥ 0-£® 㧫 , ¨á¯®«ì§ã¥¬ ¤«ï ª®¯¨à®¢ ­¨ï
-
 
95
	xor ecx,ecx
-
 
96
	mov cx,word[tree2.info_size]
-
 
97
	cld
-
 
98
	rep movsb
-
 
99
pop edi esi ecx
-
 
100
	ret
-
 
101
 
-
 
102
;¢áâ ¢«ï¥¬ ®¡ê¥ªâ
-
 
103
align 4
-
 
104
but_obj_paste:
-
 
105
push eax ebx ecx edi
-
 
106
		mov eax,[tree2.data_info] ;¤ ­­ë¥ 0-£® 㧫 , ¨á¯®«ì§ã¥¬ ¤«ï ª®¯¨à®¢ ­¨ï
-
 
107
		mov bl,byte[eax]
-
 
108
		call find_obj_in_opt
-
 
109
		xor ecx,ecx
-
 
110
		mov cx,word[edi+obj_opt.img-obj_opt] ;cx - ¨­¤¥ªá £« ¢­®© ¨ª®­ª¨ ¤®¡ ¢«ï¥¬®£® ®¡ê¥ªâ 
-
 
111
		shl ecx,16
-
 
112
		stdcall [tl_node_add], eax, ecx, tree2 ;¤®¡ ¢«ï¥¬ ®¡ê¥ªâ
-
 
113
		stdcall [tl_draw], tree2
-
 
114
pop edi ecx ebx eax
-
 
115
	ret
85
 
116
 
86
;®¡­®¢«¥­¨¥ ®¡ê¥ªâ®¢ ¢ tree2, ¯® §­ ç¥­¨ï¬ ⥪á⮢ëå ¯®«¥©
117
;®¡­®¢«¥­¨¥ ®¡ê¥ªâ®¢ ¢ tree2, ¯® §­ ç¥­¨ï¬ ⥪á⮢ëå ¯®«¥©
87
;äã­ªæ¨ï ®¡à â­ ï ª ¤ ­­®© on_file_object_select
118
;äã­ªæ¨ï ®¡à â­ ï ª ¤ ­­®© on_file_object_select
88
align 4
119
align 4
89
but_element_change:
120
but_element_change:
90
	;foc_obj - 㪠§ â¥«ì ­  ¯®á«¥¤­¨© ¢ë¡à ­­ë© 㧥« ¢ tree2
121
	;foc_obj - 㪠§ â¥«ì ­  ¯®á«¥¤­¨© ¢ë¡à ­­ë© 㧥« ¢ tree2
91
	cmp dword[foc_obj],0
122
	cmp dword[foc_obj],0
92
	je @f
123
	je @f
93
		pushad
124
		pushad
94
		stdcall get_obj_win_param, 0,edit2
125
		stdcall get_obj_win_param, 0,edit2
95
		stdcall get_obj_win_param, 1,edit3
126
		stdcall get_obj_win_param, 1,edit3
96
		stdcall get_obj_win_param, 2,edit4
127
		stdcall get_obj_win_param, 2,edit4
97
		stdcall get_obj_win_param, 3,edit5
128
		stdcall get_obj_win_param, 3,edit5
98
		stdcall get_obj_win_param, 4,edit6
129
		stdcall get_obj_win_param, 4,edit6
99
		stdcall get_obj_win_param, 5,edit7
130
		stdcall get_obj_win_param, 5,edit7
100
		stdcall get_obj_win_param, 6,edit8
131
		stdcall get_obj_win_param, 6,edit8
101
		stdcall get_obj_win_param, 7,edit9
132
		stdcall get_obj_win_param, 7,edit9
102
		popad
133
		popad
103
	@@:
134
	@@:
104
	call draw_constructor ;®¡­®¢«ï¥¬ ®ª­® ª®­áâàãªâ®à 
135
	call draw_constructor ;®¡­®¢«ï¥¬ ®ª­® ª®­áâàãªâ®à 
105
	call draw_window
136
	call draw_window
106
	ret
137
	ret
107
 
138
 
108
align 4
139
align 4
109
proc get_obj_win_param, col:dword, edit:dword
140
proc get_obj_win_param, col:dword, edit:dword
110
;pushad
141
;pushad
111
		stdcall get_obj_text_col, [foc_obj], [col] ;edx - ᬥ饭¨¥ ¤«ï ⥪áâ 
142
		stdcall get_obj_text_col, [foc_obj], [col] ;edx - ᬥ饭¨¥ ¤«ï ⥪áâ 
112
		stdcall get_obj_text_len_col, [foc_obj], [col] ;eax - ¤«¨­­  ¯®«ï
143
		stdcall get_obj_text_len_col, [foc_obj], [col] ;eax - ¤«¨­­  ¯®«ï
113
		cld
144
		cld
114
		mov edi,[edit]
145
		mov edi,[edit]
115
		mov esi,ed_text
146
		mov esi,ed_text
116
		mov edi,edx
147
		mov edi,edx
117
		mov ecx,eax
148
		mov ecx,eax
118
		rep movsb
149
		rep movsb
119
	ret
150
	ret
120
;popad
151
;popad
121
endp
152
endp
122
 
153
 
123
;input:
154
;input:
124
;  obj - pointer to object
155
;  obj - pointer to object
125
;  ind - column index
156
;  ind - column index
126
;output:
157
;output:
127
;  edx + offset
158
;  edx + offset
128
;  edx = 0 if not text
159
;  edx = 0 if not text
129
align 4
160
align 4
130
proc get_obj_text_col, obj:dword, ind:dword
161
proc get_obj_text_col, obj:dword, ind:dword
131
	mov edx,dword[obj]
162
	mov edx,dword[obj]
132
	inc edx ;goto text
163
	inc edx ;goto text
133
push ebx
164
push ebx
134
	mov ebx,dword[ind]
165
	mov ebx,dword[ind]
135
	cmp bx,0
166
	cmp bx,0
136
	je .end_fun
167
	je .end_fun
137
 
168
 
138
	shl ebx,8 ;¢ bh ¯®¯ ¤ ¥â ­®¬¥à ¨áª®¬®© ª®«®­ª¨
169
	shl ebx,8 ;¢ bh ¯®¯ ¤ ¥â ­®¬¥à ¨áª®¬®© ª®«®­ª¨
139
	mov bl,byte[edx-1] ;¢ bl ¯®¯ ¤ ¥â ª®¤ ®¡ê¥ªâ 
170
	mov bl,byte[edx-1] ;¢ bl ¯®¯ ¤ ¥â ª®¤ ®¡ê¥ªâ 
140
 
171
 
141
	push ecx edi
172
	push ecx edi
142
	call find_obj_in_opt ;¨é¥¬ áâàãªâãàã á ®¯æ¨ï¬¨ ®¡ê¥ªâ 
173
	call find_obj_in_opt ;¨é¥¬ áâàãªâãàã á ®¯æ¨ï¬¨ ®¡ê¥ªâ 
143
 
174
 
144
	add edi,obj_opt.Col-obj_opt
175
	add edi,obj_opt.Col-obj_opt
145
	dec bh
176
	dec bh
146
	and ebx,0xff00
177
	and ebx,0xff00
147
	shr ebx,7 ;ᤢ¨£ ¥¬ ­  7, â.ª. ­ã¦­® §­ ç¥­¨¥ bh 㬭®¦¥­­®¥ ­  2
178
	shr ebx,7 ;ᤢ¨£ ¥¬ ­  7, â.ª. ­ã¦­® §­ ç¥­¨¥ bh 㬭®¦¥­­®¥ ­  2
148
	add edi,ebx ;+ ¡ë¢è¥¥ bh*2
179
	add edi,ebx ;+ ¡ë¢è¥¥ bh*2
149
	xor ecx,ecx
180
	xor ecx,ecx
150
	mov cx,word[edi] ;ecx - ᤨ£ ¤«ï ¨áª®¬®£® ¯®«ï
181
	mov cx,word[edi] ;ecx - ᤨ£ ¤«ï ¨áª®¬®£® ¯®«ï
151
	add edx,ecx
182
	add edx,ecx
152
 
183
 
153
	cmp cx,0
184
	cmp cx,0
154
	jg @f
185
	jg @f
155
		mov edx,0 ;not text
186
		mov edx,0 ;not text
156
	@@:
187
	@@:
157
	cmp cx,MAX_LEN_OBJ_TXT
188
	cmp cx,MAX_LEN_OBJ_TXT
158
	jl @f
189
	jl @f
159
		mov edx,0 ;not text
190
		mov edx,0 ;not text
160
	@@:
191
	@@:
161
 
192
 
162
	pop edi ecx
193
	pop edi ecx
163
	.end_fun:
194
	.end_fun:
164
pop ebx
195
pop ebx
165
	ret
196
	ret
166
endp
197
endp
167
 
198
 
168
;input:
199
;input:
169
;  obj - 㪠§ â¥«ì ­  ®¡ê¥ªâ
200
;  obj - 㪠§ â¥«ì ­  ®¡ê¥ªâ
170
;  ind - ­®¬¥à ¯®«ï ¢­ãâਠ®¡ê¥ªâ 
201
;  ind - ­®¬¥à ¯®«ï ¢­ãâਠ®¡ê¥ªâ 
171
;output:
202
;output:
172
;  eax - ¤«¨­­  ⥪á⮢®£® ¯®«ï ¢­ãâਠ®¡ê¥ªâ 
203
;  eax - ¤«¨­­  ⥪á⮢®£® ¯®«ï ¢­ãâਠ®¡ê¥ªâ 
173
align 4
204
align 4
174
proc get_obj_text_len_col, obj:dword, ind:dword
205
proc get_obj_text_len_col, obj:dword, ind:dword
175
	xor eax,eax
206
	xor eax,eax
176
push ebx
207
push ebx
177
	mov ebx,dword[ind]
208
	mov ebx,dword[ind]
178
	shl ebx,8 ;¢ bh ¯®¯ ¤ ¥â ­®¬¥à ¨áª®¬®© ª®«®­ª¨
209
	shl ebx,8 ;¢ bh ¯®¯ ¤ ¥â ­®¬¥à ¨áª®¬®© ª®«®­ª¨
179
	mov eax,dword[obj]
210
	mov eax,dword[obj]
180
	mov bl,byte[eax] ;¢ bl ¯®¯ ¤ ¥â ª®¤ ®¡ê¥ªâ 
211
	mov bl,byte[eax] ;¢ bl ¯®¯ ¤ ¥â ª®¤ ®¡ê¥ªâ 
181
	xor eax,eax
212
	xor eax,eax
182
 
213
 
183
	push edi
214
	push edi
184
	call find_obj_in_opt ;¨é¥¬ áâàãªâãàã á ®¯æ¨ï¬¨ ®¡ê¥ªâ 
215
	call find_obj_in_opt ;¨é¥¬ áâàãªâãàã á ®¯æ¨ï¬¨ ®¡ê¥ªâ 
185
 
216
 
186
	add edi,obj_opt.Col-obj_opt
217
	add edi,obj_opt.Col-obj_opt
187
	and ebx,0xff00
218
	and ebx,0xff00
188
	shr ebx,7 ;ᤢ¨£ ¥¬ ­  7, â.ª. ­ã¦­® §­ ç¥­¨¥ bh 㬭®¦¥­­®¥ ­  2
219
	shr ebx,7 ;ᤢ¨£ ¥¬ ­  7, â.ª. ­ã¦­® §­ ç¥­¨¥ bh 㬭®¦¥­­®¥ ­  2
189
	add edi,ebx ;+ ¡ë¢è¥¥ bh*2
220
	add edi,ebx ;+ ¡ë¢è¥¥ bh*2
190
 
221
 
191
	mov ax,word[edi] ;eax - ᤨ£ ¤«ï á«¥¤ã饣® ¯®«ï
222
	mov ax,word[edi] ;eax - ᤨ£ ¤«ï á«¥¤ã饣® ¯®«ï
192
	cmp ax,0
223
	cmp ax,0
193
	jg @f
224
	jg @f
194
		mov eax,MAX_LEN_OBJ_TXT ;¯®á«¥¤­¨¥ ¯®«ï ¤«ï 㤮¡á⢠ ª®¤¨àãîâáï 0,   ­¥ MAX_LEN_OBJ_TXT, ¨á¯à ¢«ï¥¬ á¨âã æ¨î
225
		mov eax,MAX_LEN_OBJ_TXT ;¯®á«¥¤­¨¥ ¯®«ï ¤«ï 㤮¡á⢠ ª®¤¨àãîâáï 0,   ­¥ MAX_LEN_OBJ_TXT, ¨á¯à ¢«ï¥¬ á¨âã æ¨î
195
	@@:
226
	@@:
196
	cmp dword[ind],0
227
	cmp dword[ind],0
197
	je .end_fun ;¤«ï ¯¥à¢®£® ¯®«ï ᤨ£ = 0, ¯®â®¬ã ¢ áâàãªâãॠ®­ ­¥ åà ­¨âáï, â.ª. ¨§¢¥á⥭ § à ­¥¥
228
	je .end_fun ;¤«ï ¯¥à¢®£® ¯®«ï ᤨ£ = 0, ¯®â®¬ã ¢ áâàãªâãॠ®­ ­¥ åà ­¨âáï, â.ª. ¨§¢¥á⥭ § à ­¥¥
198
	sub ax,word[edi-2] ;®â­¨¬ ¥¬ ᤨ£ ¤«ï ¨áª®¬®£® ¯®«ï, ¯®«ãç ¥¬ ¤«¨­­ã ¯®«ï
229
	sub ax,word[edi-2] ;®â­¨¬ ¥¬ ᤨ£ ¤«ï ¨áª®¬®£® ¯®«ï, ¯®«ãç ¥¬ ¤«¨­­ã ¯®«ï
199
 
230
 
200
	cmp word[edi-2],0
231
	cmp word[edi-2],0
201
	jg @f
232
	jg @f
202
		mov eax,0 ;¯®«¥ ¯ãá⮥, ­¥ ¨á¯®«ì§ã¥âáï
233
		mov eax,0 ;¯®«¥ ¯ãá⮥, ­¥ ¨á¯®«ì§ã¥âáï
203
	@@:
234
	@@:
204
	cmp ax,MAX_LEN_OBJ_TXT
235
	cmp ax,MAX_LEN_OBJ_TXT
205
	jl @f
236
	jl @f
206
		mov eax,0 ;not text
237
		mov eax,0 ;not text
207
	@@:
238
	@@:
208
 
239
 
209
	pop edi
240
	pop edi
210
	.end_fun:
241
	.end_fun:
211
pop ebx
242
pop ebx
212
	ret
243
	ret
213
endp
244
endp
214
 
245
 
215
align 4
246
align 4
216
proc draw_icon_obj, o_type:dword,n_col:dword, coord_y:dword
247
proc draw_icon_obj, o_type:dword,n_col:dword, coord_y:dword
217
	pushad
248
	pushad
218
	xor ebx,ebx
249
	xor ebx,ebx
219
	mov bl,byte[o_type]
250
	mov bl,byte[o_type]
220
	call find_obj_in_opt
251
	call find_obj_in_opt
221
 
252
 
222
	add edi,obj_opt.img-obj_opt ;get index (+0)
253
	add edi,obj_opt.img-obj_opt ;get index (+0)
223
	mov ebx,[n_col]
254
	mov ebx,[n_col]
224
	shl ebx,1
255
	shl ebx,1
225
	add edi,ebx ;move index (+bh)
256
	add edi,ebx ;move index (+bh)
226
	xor ecx,ecx
257
	xor ecx,ecx
227
	mov cx,[edi]
258
	mov cx,[edi]
228
 
259
 
229
	cmp cx,0
260
	cmp cx,0
230
	jge @f
261
	jge @f
231
		jmp .end_fun ;error icon index
262
		jmp .end_fun ;error icon index
232
	@@:
263
	@@:
233
 
264
 
234
	mov ebx,bmp_icon
265
	mov ebx,bmp_icon
235
	imul ecx,0x300
266
	imul ecx,0x300
236
	add ebx,ecx
267
	add ebx,ecx
237
 
268
 
238
	mov eax,7
269
	mov eax,7
239
	mov ecx,0x100010 ;ecx - size:16*16
270
	mov ecx,0x100010 ;ecx - size:16*16
240
	mov edx,[wndObjI.left]
271
	mov edx,[wndObjI.left]
241
	add edx,5
272
	add edx,5
242
	shl edx,16
273
	shl edx,16
243
	add edx,[coord_y]
274
	add edx,[coord_y]
244
	int 0x40
275
	int 0x40
245
	.end_fun:
276
	.end_fun:
246
	popad
277
	popad
247
	ret
278
	ret
248
endp
279
endp
249
 
280
 
250
align 4
281
align 4
251
proc draw_icon, ind:dword,coord_x:dword,coord_y:dword
282
proc draw_icon, ind:dword,coord_x:dword,coord_y:dword
252
	pushad
283
	pushad
253
	mov ecx,[ind]
284
	mov ecx,[ind]
254
	cmp ecx,0
285
	cmp ecx,0
255
	jl .end_fun
286
	jl .end_fun
256
		mov ebx,bmp_icon
287
		mov ebx,bmp_icon
257
		imul ecx,0x300
288
		imul ecx,0x300
258
		add ebx,ecx
289
		add ebx,ecx
259
 
290
 
260
		mov eax,7
291
		mov eax,7
261
		mov ecx,0x100010 ;ecx - size:16*16
292
		mov ecx,0x100010 ;ecx - size:16*16
262
		mov edx,[coord_x]
293
		mov edx,[coord_x]
263
		shl edx,16
294
		shl edx,16
264
		add edx,[coord_y]
295
		add edx,[coord_y]
265
		int 0x40
296
		int 0x40
266
	.end_fun:
297
	.end_fun:
267
	popad
298
	popad
268
	ret
299
	ret
269
endp
300
endp
270
 
301
 
271
;input
302
;input
272
;  bl = cod object
303
;  bl = cod object
273
;output:
304
;output:
274
;  edi = pointer to option struct
305
;  edi = pointer to option struct
275
align 4
306
align 4
276
find_obj_in_opt:
307
find_obj_in_opt:
277
	push ecx
308
	push ecx
278
	xor ecx,ecx ;find 'bl' in options
309
	xor ecx,ecx ;find 'bl' in options
279
	mov edi,obj_opt
310
	mov edi,obj_opt
280
	@@:
311
	@@:
281
		cmp bl,[edi] ;find
312
		cmp bl,[edi] ;find
282
		je @f
313
		je @f
283
		inc ecx
314
		inc ecx
284
		cmp ecx,MAX_OBJ_TYPES
315
		cmp ecx,MAX_OBJ_TYPES
285
		je @f ;not find
316
		je @f ;not find
286
		add edi,sizeof.ObjOpt
317
		add edi,sizeof.ObjOpt
287
		jmp @b
318
		jmp @b
288
	@@:
319
	@@:
289
	pop ecx
320
	pop ecx
290
	ret
321
	ret
291
 
322
 
292
 
323
 
293
obj_find_last dd 0 ;㪠§ â¥«ì ­  ¯®á«¥¤­¨© 㤠筮 ­ ©¤¥­­ë© ®¡ê¥ªâ,
324
obj_find_last dd 0 ;㪠§ â¥«ì ­  ¯®á«¥¤­¨© 㤠筮 ­ ©¤¥­­ë© ®¡ê¥ªâ,
294
	;­ã¦¥­ ¤«ï ã᪮७¨ï ¯®á«¥¤ã饣® ¯®¨áª 
325
	;­ã¦¥­ ¤«ï ã᪮७¨ï ¯®á«¥¤ã饣® ¯®¨áª 
295
 
326
 
296
;¢ë室:
327
;¢ë室:
297
;eax - 㪠§ â¥«ì ­  áâàãªâãàã ­ ©¤¥­­®£® ®¡ê¥ªâ 
328
;eax - 㪠§ â¥«ì ­  áâàãªâãàã ­ ©¤¥­­®£® ®¡ê¥ªâ 
298
align 4
329
align 4
299
proc find_obj_in_file, o_type:dword
330
proc find_obj_in_file, o_type:dword
300
push ebx esi
331
push ebx esi
301
	mov ebx,[o_type]
332
	mov ebx,[o_type]
302
	stdcall dword[tl_node_poi_get_info], 0,tree2
333
	stdcall dword[tl_node_poi_get_info], 0,tree2
303
	pop esi
334
	pop esi
304
 
335
 
305
	@@:
336
	@@:
306
		cmp esi,0
337
		cmp esi,0
307
		je .find_no
338
		je .find_no
308
 
339
 
309
		stdcall dword[tl_node_poi_get_data], esi,tree2
340
		stdcall dword[tl_node_poi_get_data], esi,tree2
310
		pop eax ;¯®«ãç ¥¬ ¤ ­­ë¥ 㧫 
341
		pop eax ;¯®«ãç ¥¬ ¤ ­­ë¥ 㧫 
311
		cmp eax,0
342
		cmp eax,0
312
		je .find_no
343
		je .find_no
313
 
344
 
314
		cmp byte[eax],bl ;ᬮâਬ ®¯¨á ­ «¨ ¨áª®¬ë© ®¡ê¥ªâ ¢ 㧫¥
345
		cmp byte[eax],bl ;ᬮâਬ ®¯¨á ­ «¨ ¨áª®¬ë© ®¡ê¥ªâ ¢ 㧫¥
315
		je .find_yes
346
		je .find_yes
316
 
347
 
317
		stdcall dword[tl_node_poi_get_next_info], esi,tree2
348
		stdcall dword[tl_node_poi_get_next_info], esi,tree2
318
		pop esi ;¯¥à¥å®¤¨¬ ª á«¥¤ã饬ã 㧫ã
349
		pop esi ;¯¥à¥å®¤¨¬ ª á«¥¤ã饬ã 㧫ã
319
 
350
 
320
		jmp @b
351
		jmp @b
321
 
352
 
322
	.find_yes:
353
	.find_yes:
323
		mov dword[obj_find_last],esi
354
		mov dword[obj_find_last],esi
324
		jmp @f
355
		jmp @f
325
	.find_no:
356
	.find_no:
326
		mov dword[obj_find_last],0
357
		mov dword[obj_find_last],0
327
		xor eax,eax
358
		xor eax,eax
328
	@@:
359
	@@:
329
pop esi ebx
360
pop esi ebx
330
	ret
361
	ret
331
endp
362
endp
332
 
363
 
333
;¢ë室:
364
;¢ë室:
334
;eax - 㪠§ â¥«ì ­  áâàãªâãàã ­ ©¤¥­­®£® ®¡ê¥ªâ 
365
;eax - 㪠§ â¥«ì ­  áâàãªâãàã ­ ©¤¥­­®£® ®¡ê¥ªâ 
335
align 4
366
align 4
336
proc find_obj_in_file_next, o_type:dword
367
proc find_obj_in_file_next, o_type:dword
337
push ebx esi
368
push ebx esi
338
	cmp dword[obj_find_last],0
369
	cmp dword[obj_find_last],0
339
	je .find_no
370
	je .find_no
340
 
371
 
341
	mov ebx,[o_type]
372
	mov ebx,[o_type]
342
 
373
 
343
	stdcall dword[tl_node_poi_get_next_info], dword[obj_find_last],tree2
374
	stdcall dword[tl_node_poi_get_next_info], dword[obj_find_last],tree2
344
	pop esi ;¯¥à¥å®¤¨¬ ª á«¥¤ã饬ã 㧫ã
375
	pop esi ;¯¥à¥å®¤¨¬ ª á«¥¤ã饬ã 㧫ã
345
 
376
 
346
	@@:
377
	@@:
347
		cmp esi,0
378
		cmp esi,0
348
		je .find_no
379
		je .find_no
349
 
380
 
350
		stdcall dword[tl_node_poi_get_data], esi,tree2
381
		stdcall dword[tl_node_poi_get_data], esi,tree2
351
		pop eax ;¯®«ãç ¥¬ ¤ ­­ë¥ 㧫 
382
		pop eax ;¯®«ãç ¥¬ ¤ ­­ë¥ 㧫 
352
		cmp eax,0
383
		cmp eax,0
353
		je .find_no
384
		je .find_no
354
 
385
 
355
		cmp byte[eax],bl ;ᬮâਬ ®¯¨á ­ «¨ ¨áª®¬ë© ®¡ê¥ªâ ¢ 㧫¥
386
		cmp byte[eax],bl ;ᬮâਬ ®¯¨á ­ «¨ ¨áª®¬ë© ®¡ê¥ªâ ¢ 㧫¥
356
		je .find_yes
387
		je .find_yes
357
 
388
 
358
		stdcall dword[tl_node_poi_get_next_info], esi, tree2
389
		stdcall dword[tl_node_poi_get_next_info], esi, tree2
359
		pop esi ;¯¥à¥å®¤¨¬ ª á«¥¤ã饬ã 㧫ã
390
		pop esi ;¯¥à¥å®¤¨¬ ª á«¥¤ã饬ã 㧫ã
360
 
391
 
361
		jmp @b
392
		jmp @b
362
 
393
 
363
	.find_yes:
394
	.find_yes:
364
		mov dword[obj_find_last],esi
395
		mov dword[obj_find_last],esi
365
		jmp @f
396
		jmp @f
366
	.find_no:
397
	.find_no:
367
		mov dword[obj_find_last],0
398
		mov dword[obj_find_last],0
368
		xor eax,eax
399
		xor eax,eax
369
	@@:
400
	@@:
370
pop esi ebx
401
pop esi ebx
371
	ret
402
	ret
372
endp
403
endp
373
 
404
 
374
align 4
405
align 4
375
but_show_constructor:
406
but_show_constructor:
376
	mov byte[show_mode],0
407
	mov byte[show_mode],0
377
	stdcall [buf2d_draw], buf_fon
408
	stdcall [buf2d_draw], buf_fon
378
	ret
409
	ret
379
 
410
 
380
align 4
411
align 4
381
but_show_code:
412
but_show_code:
382
	mov byte[show_mode],1
413
	mov byte[show_mode],1
383
	stdcall [ted_draw], tedit0
414
	stdcall [ted_draw], tedit0
384
	ret
415
	ret
385
 
416
 
386
;input:
417
;input:
387
; buf - 㪠§ â¥«ì ­  áâபã, ç¨á«® ¤®«¦­® ¡ëâì ¢ 10 ¨«¨ 16 à¨ç­®¬ ¢¨¤¥
418
; buf - 㪠§ â¥«ì ­  áâபã, ç¨á«® ¤®«¦­® ¡ëâì ¢ 10 ¨«¨ 16 à¨ç­®¬ ¢¨¤¥
388
;output:
419
;output:
389
; eax - ç¨á«®
420
; eax - ç¨á«®
390
align 4
421
align 4
391
proc conv_str_to_int, buf:dword
422
proc conv_str_to_int, buf:dword
392
	xor eax,eax
423
	xor eax,eax
393
	push ebx esi
424
	push ebx esi
394
	xor ebx,ebx
425
	xor ebx,ebx
395
	mov esi,[buf]
426
	mov esi,[buf]
396
	cmp word[esi],'0x'
427
	cmp word[esi],'0x'
397
	je .load_digit_16
428
	je .load_digit_16
398
 
429
 
399
	.load_digit_10: ;áç¨â뢠­¨¥ 10-â¨ç­ëå æ¨äà
430
	.load_digit_10: ;áç¨â뢠­¨¥ 10-â¨ç­ëå æ¨äà
400
		mov bl,byte[esi]
431
		mov bl,byte[esi]
401
		cmp bl,'0'
432
		cmp bl,'0'
402
		jl @f
433
		jl @f
403
		cmp bl,'9'
434
		cmp bl,'9'
404
		jg @f
435
		jg @f
405
			sub bl,'0'
436
			sub bl,'0'
406
			imul eax,10
437
			imul eax,10
407
			add eax,ebx
438
			add eax,ebx
408
			inc esi
439
			inc esi
409
			jmp .load_digit_10
440
			jmp .load_digit_10
410
	jmp @f
441
	jmp @f
411
 
442
 
412
	.load_digit_16: ;áç¨â뢠­¨¥ 16-à¨ç­ëå æ¨äà
443
	.load_digit_16: ;áç¨â뢠­¨¥ 16-à¨ç­ëå æ¨äà
413
		add esi,2
444
		add esi,2
414
	.cycle_16:
445
	.cycle_16:
415
		mov bl,byte[esi]
446
		mov bl,byte[esi]
416
		cmp bl,'0'
447
		cmp bl,'0'
417
		jl @f
448
		jl @f
418
		cmp bl,'f'
449
		cmp bl,'f'
419
		jg @f
450
		jg @f
420
		cmp bl,'9'
451
		cmp bl,'9'
421
		jle .us1
452
		jle .us1
422
			cmp bl,'A'
453
			cmp bl,'A'
423
			jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'9' ¨ <'A'
454
			jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'9' ¨ <'A'
424
		.us1: ;á®áâ ¢­®¥ ãá«®¢¨¥
455
		.us1: ;á®áâ ¢­®¥ ãá«®¢¨¥
425
		cmp bl,'F'
456
		cmp bl,'F'
426
		jle .us2
457
		jle .us2
427
			cmp bl,'a'
458
			cmp bl,'a'
428
			jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'F' ¨ <'a'
459
			jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'F' ¨ <'a'
429
			sub bl,32 ;¯¥à¥¢®¤¨¬ ᨬ¢®«ë ¢ ¢¥àå­¨© ॣ¨áâà, ¤«ï ã¯à®é¥­¨ï ¨å ¯®á«¥¤ã饩 ®¡à ¡®âª¨
460
			sub bl,32 ;¯¥à¥¢®¤¨¬ ᨬ¢®«ë ¢ ¢¥àå­¨© ॣ¨áâà, ¤«ï ã¯à®é¥­¨ï ¨å ¯®á«¥¤ã饩 ®¡à ¡®âª¨
430
		.us2: ;á®áâ ¢­®¥ ãá«®¢¨¥
461
		.us2: ;á®áâ ¢­®¥ ãá«®¢¨¥
431
			sub bl,'0'
462
			sub bl,'0'
432
			cmp bl,9
463
			cmp bl,9
433
			jle .cor1
464
			jle .cor1
434
				sub bl,7 ;convert 'A' to '10'
465
				sub bl,7 ;convert 'A' to '10'
435
			.cor1:
466
			.cor1:
436
			shl eax,4
467
			shl eax,4
437
			add eax,ebx
468
			add eax,ebx
438
			inc esi
469
			inc esi
439
			jmp .cycle_16
470
			jmp .cycle_16
440
	@@:
471
	@@:
441
 
472
 
442
	pop esi ebx
473
	pop esi ebx
443
	ret
474
	ret
444
endp
475
endp
445
>
476
>
446
>
477
>