Subversion Repositories Kolibri OS

Rev

Rev 5092 | Rev 7524 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5092 Rev 7514
Line 1... Line 1...
1
use32
1
use32
2
	org 0x0
2
	org 0
3
	db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
-
 
4
	dd 0x1
3
	db 'MENUET01'
5
	dd start
-
 
6
	dd i_end ;à §¬¥à ¯à¨«®¦¥­¨ï
4
	dd 1,start,i_end,mem,stacktop,0,sys_path
7
	dd mem
-
 
8
	dd stacktop
-
 
9
	dd 0
-
 
10
	dd sys_path
-
 
Line 11... Line 5...
11
 
5
 
12
include '../../../macros.inc'
6
include '../../../macros.inc'
-
 
7
include '../../../proc32.inc'
-
 
8
include '../../../KOSfuncs.inc'
13
include '../../../proc32.inc'
9
include '../../../load_img.inc'
14
include '../../../develop/libraries/box_lib/load_lib.mac'
-
 
Line 15... Line 10...
15
include '../../../dll.inc'
10
include '../../../develop/libraries/box_lib/load_lib.mac'
16
 
11
 
17
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
-
 
18
hed db 'Life 05.09.14',0 ;¯®¤¯¨áì ®ª­ 
-
 
19
 
-
 
20
struct FileInfoBlock
-
 
21
	Function dd ?
-
 
22
	Position dd ?
-
 
23
	Flags	 dd ?
-
 
24
	Count	 dd ?
-
 
25
	Buffer	 dd ?
-
 
26
		db ?
-
 
Line 27... Line 12...
27
	FileName dd ?
12
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
28
ends
13
hed db 'Life 31.10.18',0 ;¯®¤¯¨áì ®ª­ 
Line 29... Line -...
29
 
-
 
30
run_file_70 FileInfoBlock
14
 
31
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
-
 
32
 
15
run_file_70 FileInfoBlock
Line 33... Line -...
33
fn_toolbar db 'toolbar.png',0
-
 
34
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
-
 
35
IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*9
-
 
36
image_data_toolbar dd 0
-
 
37
 
-
 
38
macro load_image_file path,buf,size { ;¬ ªà®á ¤«ï § £à㧪¨ ¨§®¡à ¦¥­¨©
-
 
39
	;path - ¬®¦¥â ¡ëâì ¯¥à¥¬¥­­®© ¨«¨ áâப®¢ë¬ ¯ à ¬¥â஬
-
 
40
	if path eqtype '' ;¯à®¢¥à塞 § ¤ ­ «¨ áâப®© ¯ à ¬¥âà path
-
 
41
		jmp @f
-
 
42
			local .path_str
-
 
43
			.path_str db path ;ä®à¬¨à㥬 «®ª «ì­ãî ¯¥à¥¬¥­­ãî
-
 
44
			db 0
-
 
45
		@@:
-
 
46
		;32 - áâ ­¤ àâ­ë©  ¤à¥á ¯® ª®â®à®¬ã ¤®«¦¥­ ¡ëâì ¡ãä¥à á á¨á⥬­ë¬ ¯ã⥬
-
 
47
		copy_path .path_str,[32],file_name,0x0
-
 
48
	else
-
 
49
		copy_path path,[32],file_name,0x0 ;ä®à¬¨à㥬 ¯®«­ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥­¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ®­ ¢ ®¤­®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
-
 
50
	end if
-
 
51
 
-
 
52
	stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥­¨ï
-
 
53
	mov [buf],eax
-
 
54
 
-
 
55
	mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
-
 
56
	mov [run_file_70.Function], 0
-
 
57
	mov [run_file_70.Position], 0
-
 
58
	mov [run_file_70.Flags], 0
-
 
59
	mov [run_file_70.Count], dword size
-
 
60
	m2m [run_file_70.Buffer], [buf]
-
 
61
	mov byte[run_file_70+20], 0
-
 
62
	mov [run_file_70.FileName], file_name
-
 
63
	mov ebx,run_file_70
-
 
64
	int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
-
 
65
	cmp ebx,0xffffffff
-
 
66
	je @f
-
 
67
		;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥­¨ï ¨ ¯¥à¥¢®¤¨¬ ¥£® ¢® ¢à¥¬¥­­ë© ¡ãä¥à image_data
-
 
68
		stdcall dword[img_decode], dword[buf],ebx,0
-
 
69
		mov dword[image_data],eax
-
 
70
		;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥­¨¥ ª ä®à¬ âã rgb
-
 
Line 71... Line 16...
71
		stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
16
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
72
		;㤠«ï¥¬ ¢à¥¬¥­­ë© ¡ãä¥à image_data
17
 
73
		stdcall dword[img_destroy], dword[image_data]
18
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
74
	@@:
19
image_data_toolbar dd 0
75
}
20
 
76
 
21
 
77
;--------------------------------------
22
;--------------------------------------
78
struct Cell
23
struct Cell
Line 79... Line 24...
79
	x dd ? ;+0
24
	x dd ? ;+0
80
	y dd ? ;+4
25
	y dd ? ;+4
Line 81... Line 26...
81
	tc dd ? ;+8
26
	tc  dd ? ;+8 ¯®ª®«¥­¨¥ ¢ ª®â®à®¬ த¨« áì ®á®¡ì
82
	liv db ? ;+12
27
	liv db ? ;+12 ¦¨¢ ï ï祩ª  ¨«¨ ­¥â
83
	so db ? ;+13
28
	so  db ? ;+13 ç¨á«® á®á¥¤¥©
Line 95... Line 40...
95
	mov reg,ind
40
	mov reg,ind
96
	imul reg,sizeof.Cell
41
	imul reg,sizeof.Cell
97
	add reg,dword[cell]
42
	add reg,dword[cell]
98
}
43
}
Line 99... Line -...
99
 
-
 
100
capt rb 50
44
 
101
er_oom db 0 ;­  á«ãç © ¨áç¥à¯ ­¨ï ¯ ¬ïâ¨
45
er_oom db 0 ;­  á«ãç © ¨áç¥à¯ ­¨ï ¯ ¬ïâ¨
102
tim_ch db 0 ; ¢â®¬ â¨ç¥áª¨ ¯à®áç¨â뢠âì ¯®ª®«¥­¨ï
46
tim_ch db 0 ; ¢â®¬ â¨ç¥áª¨ ¯à®áç¨â뢠âì ¯®ª®«¥­¨ï
103
poc_stop dd 1 ;¯à®áç¥â ­  ç¨á«® ¯®ª®«¥­¨©
47
poc_stop dd 1 ;¯à®áç¥â ­  ç¨á«® ¯®ª®«¥­¨©
104
Cor_x dd 0
48
Cor_x dd 0
Line 115... Line 59...
115
; col_pole - 梥⠯®«ï
59
; col_pole - 梥⠯®«ï
116
; col_cell_n - 梥⠭®¢®© ï祩ª¨
60
; col_cell_n - 梥⠭®¢®© ï祩ª¨
117
; col_cell_o - 梥â áâ à®© ï祩ª¨
61
; col_cell_o - 梥â áâ à®© ï祩ª¨
118
align 4
62
align 4
119
proc pole_init_colors uses eax ebx ecx edx esi edi, col_pole:dword, col_cell_n:dword, col_cell_o:dword
63
proc pole_init_colors uses eax ebx ecx edx esi edi, col_pole:dword, col_cell_n:dword, col_cell_o:dword
120
	mov esi,dword[CellColors]
64
	mov esi,[CellColors]
121
	mov ebx,dword[col_pole]
65
	mov ebx,[col_pole]
122
	mov dword[esi],ebx
66
	mov dword[esi],ebx
Line 123... Line 67...
123
 
67
 
124
	add esi,4
68
	add esi,4
125
	mov edi,COL_MEM
69
	mov edi,COL_MEM
126
	dec edi
70
	dec edi
127
	shl edi,2
71
	shl edi,2
128
	add edi,esi
72
	add edi,esi
129
	; esi - 㪠§ â¥«ì ­  1-© £à ¤¨¥­â­ë© 梥â
73
	; esi - 㪠§ â¥«ì ­  1-© £à ¤¨¥­â­ë© 梥â
130
	; edi - 㪠§ â¥«ì ­  ¯®á«¥¤­¨© £à ¤¨¥­â­ë© 梥â
74
	; edi - 㪠§ â¥«ì ­  ¯®á«¥¤­¨© £à ¤¨¥­â­ë© 梥â
131
	mov eax,dword[col_cell_n]
75
	mov eax,[col_cell_n]
Line 132... Line 76...
132
	mov ebx,dword[col_cell_o]
76
	mov ebx,[col_cell_o]
133
 
77
 
134
	mov dword[esi],eax
78
	mov dword[esi],eax
135
	mov dword[edi],ebx
79
	mov dword[edi],ebx
Line 144... Line 88...
144
; eax - 梥⠭ ç «ì­ë©
88
; eax - 梥⠭ ç «ì­ë©
145
; ebx - 梥⠪®­¥ç­ë©
89
; ebx - 梥⠪®­¥ç­ë©
146
;§ §àãè îâìáï: ecx, edx
90
;§ §àãè îâìáï: ecx, edx
147
align 4
91
align 4
148
proc middle_colors uses edi esi, i0:dword, i1:dword
92
proc middle_colors uses edi esi, i0:dword, i1:dword
149
	mov esi,dword[i0]
93
	mov esi,[i0]
150
	mov edi,dword[i1]
94
	mov edi,[i1]
151
	;¯¥à¥¤ ¢ë§®¢®¬ ä㭪樨
95
	;¯¥à¥¤ ¢ë§®¢®¬ ä㭪樨
152
	;dword[esi]=eax
96
	;dword[esi]=eax
153
	;dword[edi]=ebx
97
	;dword[edi]=ebx
154
	sub edi,esi
98
	sub edi,esi
155
	shr edi,1
99
	shr edi,1
Line 183... Line 127...
183
	@@:
127
	@@:
184
	ret
128
	ret
185
endp
129
endp
Line 186... Line 130...
186
 
130
 
187
align 4
-
 
188
pole_clear:
131
align 4
189
	push eax ecx edi
132
proc pole_clear uses eax ecx edi
190
	xor eax,eax
133
	xor eax,eax
191
	mov dword[tim],eax
134
	mov dword[tim],eax
192
	mov dword[osob],eax
135
	mov dword[osob],eax
193
	mov  byte[tim_ch],al
136
	mov  byte[tim_ch],al
194
	mov dword[Cor_x],eax
137
	mov dword[Cor_x],eax
195
	mov dword[Cor_y],eax
138
	mov dword[Cor_y],eax
196
	mov dword[b_sort],eax
139
	mov dword[b_sort],eax
197
	mov  byte[er_oom],al
140
	mov  byte[er_oom],al
198
	cld
-
 
199
	mov ecx,MAX_CELL
141
	cld
200
	imul ecx,sizeof.Cell
142
	mov ecx,(MAX_CELL*sizeof.Cell)/4
201
	mov edi,dword[cell]
143
	mov edi,[cell]
202
	repne stosb ;memset(cell,0,sizeof(Cell)*MAX_CELL);
144
	rep stosd ;memset(cell,0,sizeof(Cell)*MAX_CELL);
203
	mov edi,dword[memCell]
145
	mov edi,[memCell]
204
	mov ecx,MAX_CELL
146
	mov ecx,MAX_CELL
205
	@@:
147
	@@:
206
		stosd ;for(i=0;i
-
 
207
		;mov dword[edi],eax
-
 
208
		;add edi,4
148
		stosd ;for(i=0;i
209
		inc eax
149
		inc eax
210
		loop @b
-
 
211
	pop edi ecx eax
150
		loop @b
212
	ret
151
	ret
213
 
152
endp
214
align 4
153
align 4
215
proc pole_cell_creat, x:dword, y:dword, li:dword
154
proc pole_cell_creat, x:dword, y:dword, li:dword
Line 216... Line 155...
216
	pushad ;eax ebx ecx edx edi
155
	pushad ;eax ebx ecx edx edi
Line 233... Line 172...
233
		jmp .fun_e
172
		jmp .fun_e
234
	@@:
173
	@@:
Line 235... Line 174...
235
 
174
 
236
	; *** ᮧ¤ ­¨¥ ­®¢®© ï祩ª¨
175
	; *** ᮧ¤ ­¨¥ ­®¢®© ï祩ª¨
237
	; ­ å®¤¨¬ ­®¬¥à ᢮¡®¤­®© ï祩ª¨ (i) ¤«ï ¤®¡ ¢«¥­¨ï ­®¢®©
176
	; ­ å®¤¨¬ ­®¬¥à ᢮¡®¤­®© ï祩ª¨ (i) ¤«ï ¤®¡ ¢«¥­¨ï ­®¢®©
238
	mov edi,dword[memCell]
177
	mov edi,[memCell]
239
	inc dword[edi]
178
	inc dword[edi]
240
	cmp dword[edi],MAX_CELL
179
	cmp dword[edi],MAX_CELL
241
	jne @f
180
	jne @f
242
		dec dword[edi]
181
		dec dword[edi]
243
		mov byte[tim_ch],0
182
		mov byte[tim_ch],0
244
		;... need call message: "eror out of memory" ...
183
		;... need call message: "eror out of memory" ...
245
		;... ¢ë¢®¤ á®®¡é¥­¨ï ¯¥à¥¯®«­¥­¨ï ­ ¤® ¤®¡ ¢¨âì  ...
184
		;... ¢ë¢®¤ á®®¡é¥­¨ï ¯¥à¥¯®«­¥­¨ï ­ ¤® ¤®¡ ¢¨âì  ...
246
		mov byte[er_oom],0
185
		mov byte[er_oom],0
247
		jmp .fun_e ;return;
186
		jmp .fun_e ;return;
248
	@@:
187
	@@:
249
	mov eax,dword[edi]
188
	mov eax,[edi]
250
	shl eax,2
189
	shl eax,2
251
	add eax,dword[memCell] ;eax -> memCell[firstC]
190
	add eax,[memCell] ;eax -> memCell[firstC]
Line 252... Line 191...
252
	get_cell_offset ebx,dword[eax]
191
	get_cell_offset ebx,[eax]
253
 
192
 
254
	mov ecx,dword[x]
193
	mov ecx,[x]
255
	mov dword[ebx],ecx ;+0 = .x
194
	mov dword[ebx],ecx ;+0 = .x
256
	mov edx,dword[y]
195
	mov edx,[y]
257
	mov dword[ebx+4],edx ;+4 = .y
196
	mov dword[ebx+4],edx ;+4 = .y
258
	mov eax,dword[tim]
197
	mov eax,[tim]
Line 259... Line 198...
259
	mov dword[ebx+8],eax ;+8 = .tc
198
	mov dword[ebx+8],eax ;+8 = .tc
260
	mov byte[ebx+12],0 ;+12 = .liv
199
	mov byte[ebx+12],0 ;+12 = .liv
Line 267... Line 206...
267
	mov byte[ebx+13],0 ;+13 = .so
206
	mov byte[ebx+13],0 ;+13 = .so
Line 268... Line 207...
268
 
207
 
269
	.creat_border_cells:
208
	.creat_border_cells:
270
		inc dword[osob]
209
		inc dword[osob]
271
		or byte[ebx+12],1 ;+12 = .liv
210
		or byte[ebx+12],1 ;+12 = .liv
272
		mov ecx,dword[x]
211
		mov ecx,[x]
273
		dec ecx
212
		dec ecx
274
		mov edx,dword[y]
213
		mov edx,[y]
275
		dec edx
214
		dec edx
276
		stdcall pole_cell_creat,ecx,edx,0
215
		stdcall pole_cell_creat,ecx,edx,0
277
		inc edx
216
		inc edx
278
		stdcall pole_cell_creat,ecx,edx,0
217
		stdcall pole_cell_creat,ecx,edx,0
Line 295... Line 234...
295
 
234
 
296
;output:
235
;output:
297
; eax - index
236
; eax - index
298
align 4
237
align 4
299
proc pole_cell_find, x:dword, y:dword
238
proc pole_cell_find, x:dword, y:dword
300
	mov eax,dword[memCell]
239
	mov eax,[memCell]
301
	cmp dword[eax],0
240
	cmp dword[eax],0
302
	jne @f
241
	jne @f
303
		xor eax,eax ;if(!fristC) return 0;
242
		xor eax,eax ;if(!fristC) return 0;
304
		jmp .fun_e
243
		jmp .fun_e
Line 309... Line 248...
309
	je @f
248
	je @f
310
		stdcall pole_bin_find, [memCell], [x],[y], [b_sort] ;i=BinFind(memCell, x,y, b_sort);
249
		stdcall pole_bin_find, [memCell], [x],[y], [b_sort] ;i=BinFind(memCell, x,y, b_sort);
311
		cmp eax,0
250
		cmp eax,0
312
		je @f
251
		je @f
313
			shl eax,2
252
			shl eax,2
314
			add eax,dword[memCell]
253
			add eax,[memCell]
315
			mov eax,dword[eax] ;if(i) fnd=memCell[i];
254
			mov eax,[eax] ;if(i) fnd=memCell[i];
316
			jmp .fun_e
255
			jmp .fun_e
317
	@@:
256
	@@:
Line 318... Line 257...
318
 
257
 
319
	cmp eax,0
258
	cmp eax,0
320
	jne @f ;if(!fnd){ // ¯®¨áª ï祩ª¨ §  ¡¨­ à­ë¬ ¤¥à¥¢®¬
259
	jne @f ;if(!fnd){ // ¯®¨áª ï祩ª¨ §  ¡¨­ à­ë¬ ¤¥à¥¢®¬
321
		push ebx ecx edx edi esi
260
		push ebx ecx edx edi esi
322
		;ebx -> i
261
		;ebx -> i
323
		;ecx -> firstC
262
		;ecx -> firstC
324
		;edx -> &memCell[i]
263
		;edx -> &memCell[i]
325
		;edi -> cell[memCell[i]]
264
		;edi -> cell[memCell[i]]
326
		mov ecx,dword[memCell]
265
		mov ecx,[memCell]
327
		mov ebx,dword[b_sort]
266
		mov ebx,[b_sort]
328
		mov edx,ebx
267
		mov edx,ebx
329
		shl edx,2
268
		shl edx,2
330
		add edx,ecx
269
		add edx,ecx
331
		mov ecx,dword[ecx]
270
		mov ecx,[ecx]
332
		.cycle_b: ;for(i=b_sort+1;i<=fristC;i++)
271
		.cycle_b: ;for(i=b_sort+1;i<=fristC;i++)
333
			inc ebx
272
			inc ebx
334
			cmp ebx,ecx
273
			cmp ebx,ecx
335
			jg .cycle_e
274
			jg .cycle_e
336
			add edx,4
275
			add edx,4
337
			get_cell_offset edi,dword[edx]
276
			get_cell_offset edi,[edx]
338
			mov esi,dword[x]
277
			mov esi,[x]
339
			cmp dword[edi],esi ;+0 = .x
278
			cmp dword[edi],esi ;+0 = .x
340
			jne .if_e
279
			jne .if_e
341
			mov esi,dword[y]
280
			mov esi,[y]
342
			cmp dword[edi+4],esi ;+4 = .y
281
			cmp dword[edi+4],esi ;+4 = .y
343
			jne .if_e
282
			jne .if_e
344
				;if(cell[memCell[i]].x==x && cell[memCell[i]].y==y){
283
				;if(cell[memCell[i]].x==x && cell[memCell[i]].y==y){
345
				mov eax,dword[edx] ;fnd=memCell[i];
284
				mov eax,[edx] ;fnd=memCell[i];
346
				jmp .cycle_e ;break;
285
				jmp .cycle_e ;break;
347
			.if_e:
286
			.if_e:
348
			jmp .cycle_b
287
			jmp .cycle_b
349
		.cycle_e:
288
		.cycle_e:
Line 377... Line 316...
377
	.cycle_b: ;do{
316
	.cycle_b: ;do{
378
		shr ebx,1 ;por>>=1;
317
		shr ebx,1 ;por>>=1;
Line 379... Line 318...
379
 
318
 
380
		mov edi,ecx
319
		mov edi,ecx
381
		shl edi,2
320
		shl edi,2
382
		add edi,dword[mas]
321
		add edi,[mas]
383
		;if(compare_cells_mb(mas[i],fx,fy)){
322
		;if(compare_cells_mb(mas[i],fx,fy)){
384
		stdcall pole_compare_cells_mb_coords, dword[edi],[fx],[fy]
323
		stdcall pole_compare_cells_mb_coords, dword[edi],[fx],[fy]
385
		cmp dl,0
324
		cmp dl,0
386
		je .if_u0_e
325
		je .if_u0_e
387
			@@: ;while(i+por>k)
326
			@@: ;while(i+por>k)
388
			mov edx,ecx
327
			mov edx,ecx
389
			add edx,ebx
328
			add edx,ebx
390
			cmp edx,dword[k] ;i+por>k
329
			cmp edx,[k] ;i+por>k
391
			jle @f
330
			jle @f
392
				shr ebx,1 ;por>>=1;
331
				shr ebx,1 ;por>>=1;
393
				jmp @b
332
				jmp @b
394
			@@:
333
			@@:
Line 418... Line 357...
418
align 4
357
align 4
419
proc pole_compare_cells_bm_coords, i0:dword, fx:dword, fy:dword
358
proc pole_compare_cells_bm_coords, i0:dword, fx:dword, fy:dword
420
	push eax ebx ecx
359
	push eax ebx ecx
421
	get_cell_offset eax,[i0]
360
	get_cell_offset eax,[i0]
422
	;eax -> cell[i0]
361
	;eax -> cell[i0]
423
	mov ebx,dword[fx]
362
	mov ebx,[fx]
424
	cmp dword[eax],ebx
363
	cmp dword[eax],ebx
425
	jle @f
364
	jle @f
426
		mov dl,1
365
		mov dl,1
427
		jmp .fun_e
366
		jmp .fun_e
428
	@@:
367
	@@:
429
	mov ecx,dword[fy]
368
	mov ecx,[fy]
430
	cmp dword[eax+4],ecx
369
	cmp dword[eax+4],ecx
431
	jle @f
370
	jle @f
432
	cmp dword[eax],ebx
371
	cmp dword[eax],ebx
433
	jne @f
372
	jne @f
434
		mov dl,1
373
		mov dl,1
Line 445... Line 384...
445
align 4
384
align 4
446
proc pole_compare_cells_mb_coords, i0:dword, fx:dword, fy:dword
385
proc pole_compare_cells_mb_coords, i0:dword, fx:dword, fy:dword
447
	push eax ebx ecx
386
	push eax ebx ecx
448
	get_cell_offset eax,[i0]
387
	get_cell_offset eax,[i0]
449
	;eax -> cell[i0]
388
	;eax -> cell[i0]
450
	mov ebx,dword[fx]
389
	mov ebx,[fx]
451
	cmp dword[eax],ebx
390
	cmp dword[eax],ebx
452
	jge @f
391
	jge @f
453
		mov dl,1
392
		mov dl,1
454
		jmp .fun_e
393
		jmp .fun_e
455
	@@:
394
	@@:
456
	mov ecx,dword[fy]
395
	mov ecx,[fy]
457
	cmp dword[eax+4],ecx
396
	cmp dword[eax+4],ecx
458
	jge @f
397
	jge @f
459
	cmp dword[eax],ebx
398
	cmp dword[eax],ebx
460
	jne @f
399
	jne @f
461
		mov dl,1
400
		mov dl,1
Line 472... Line 411...
472
align 4
411
align 4
473
proc pole_compare_cells_bm, i0:dword, i1:dword
412
proc pole_compare_cells_bm, i0:dword, i1:dword
474
	push eax ebx ecx
413
	push eax ebx ecx
475
	get_cell_offset eax,[i0] ;eax -> cell[i0]
414
	get_cell_offset eax,[i0] ;eax -> cell[i0]
476
	get_cell_offset ebx,[i1] ;ebx -> cell[i1]
415
	get_cell_offset ebx,[i1] ;ebx -> cell[i1]
477
	mov ecx,dword[ebx] ;+0 = .x
416
	mov ecx,[ebx] ;+0 = .x
478
	cmp dword[eax],ecx
417
	cmp dword[eax],ecx
479
	jle @f ;x0>x1
418
	jle @f ;x0>x1
480
		mov dl,1
419
		mov dl,1
481
		jmp .fun_e
420
		jmp .fun_e
482
	@@:
421
	@@:
483
	jne @f ;x0==x1
422
	jne @f ;x0==x1
484
	mov ecx,dword[ebx+4] ;+4 = .y
423
	mov ecx,[ebx+4] ;+4 = .y
485
	cmp dword[eax+4],ecx
424
	cmp dword[eax+4],ecx
486
	jle @f ;y0>y1
425
	jle @f ;y0>y1
487
		mov dl,1
426
		mov dl,1
488
		jmp .fun_e
427
		jmp .fun_e
489
	@@:
428
	@@:
Line 500... Line 439...
500
	;ebx -> i
439
	;ebx -> i
501
	;ecx -> cell[memCell[i]]
440
	;ecx -> cell[memCell[i]]
502
	;edx -> color
441
	;edx -> color
503
	;edi -> coord_x
442
	;edi -> coord_x
504
	;esi -> coord_y
443
	;esi -> coord_y
505
	mov eax,dword[memCell]
444
	mov eax,[memCell]
506
	cmp dword[eax],0
445
	cmp dword[eax],0
507
	je .no_draw
446
	je .no_draw
Line 508... Line 447...
508
 
447
 
509
	mov eax,dword[eax]
448
	mov eax,[eax]
Line 510... Line 449...
510
	mov ebx,1
449
	mov ebx,1
511
 
450
 
512
;---
451
;---
513
	@@: ;while(i
452
	@@: ;while(i
514
		cmp ebx,dword[b_sort]
453
		cmp ebx,[b_sort]
515
		jge @f ;¯¥à¥å®¤¨¬ ­  ­ ç «® ­¨¦­¥£® 横« 
454
		jge @f ;¯¥à¥å®¤¨¬ ­  ­ ç «® ­¨¦­¥£® 横« 
516
		mov ecx,ebx
455
		mov ecx,ebx
517
		shl ecx,2
456
		shl ecx,2
518
		add ecx,dword[memCell]
457
		add ecx,[memCell]
519
		get_cell_offset ecx,dword[ecx]
458
		get_cell_offset ecx,[ecx]
520
		mov edx,dword[ecx] ;+0 = .x
459
		mov edx,[ecx] ;+0 = .x
521
		add edx,dword[Cor_x]
460
		add edx,[Cor_x]
522
		cmp edx,0
461
		cmp edx,0
523
		jge @f ;¯¥à¥å®¤¨¬ ­  ­ ç «® ­¨¦­¥£® 横« 
462
		jge @f ;¯¥à¥å®¤¨¬ ­  ­ ç «® ­¨¦­¥£® 横« 
524
			inc ebx ;i++; // ¤«ï ¯à®¯ã᪠ ï祥ª §  ®ª­®¬ á«¥¢ 
463
			inc ebx ;i++; // ¤«ï ¯à®¯ã᪠ ï祥ª §  ®ª­®¬ á«¥¢ 
Line 528... Line 467...
528
	cmp byte[zoom],2
467
	cmp byte[zoom],2
529
	jge .zoom2
468
	jge .zoom2
530
	@@: ;for(;i<=fristC;i++){
469
	@@: ;for(;i<=fristC;i++){
531
		mov ecx,ebx
470
		mov ecx,ebx
532
		shl ecx,2
471
		shl ecx,2
533
		add ecx,dword[memCell]
472
		add ecx,[memCell]
534
		get_cell_offset ecx,dword[ecx]
473
		get_cell_offset ecx,[ecx]
535
;...
474
;...
536
		mov edi,dword[Cor_x]
475
		mov edi,[Cor_x]
537
		add edi,dword[ecx] ;+0 = .x
476
		add edi,[ecx] ;+0 = .x
538
		mov esi,dword[Cor_y]
477
		mov esi,[Cor_y]
539
		add esi,dword[ecx+4] ;+4 = .y
478
		add esi,[ecx+4] ;+4 = .y
540
		bt word[ecx+12],0 ;+12 = .liv
479
		bt word[ecx+12],0 ;+12 = .liv
541
		jc .cell_1
480
		jc .cell_1
542
			;­¥ ¦¨¢ ï ï祩ª 
481
			;­¥ ¦¨¢ ï ï祩ª 
543
			mov edx,dword[CellColors]
482
			mov edx,[CellColors]
544
			mov edx,dword[edx]
483
			mov edx,[edx]
545
			jmp .cell_0
484
			jmp .cell_0
546
		.cell_1:
485
		.cell_1:
547
			;¦¨¢ ï ï祩ª 
486
			;¦¨¢ ï ï祩ª 
548
			mov edx,dword[tim]
487
			mov edx,[tim]
549
			inc edx
488
			inc edx
550
			sub edx,dword[ecx+8] ;+8 = .tc
489
			sub edx,[ecx+8] ;+8 = .tc
551
			cmp edx,COL_MEM
490
			cmp edx,COL_MEM
552
			jle .in_color
491
			jle .in_color
553
				mov edx,COL_MEM
492
				mov edx,COL_MEM
554
			.in_color:
493
			.in_color:
555
			shl edx,2
494
			shl edx,2
556
			add edx,dword[CellColors]
495
			add edx,[CellColors]
557
			mov edx,dword[edx]
496
			mov edx,[edx]
558
		.cell_0:
497
		.cell_0:
559
		stdcall [buf2d_set_pixel], buf_0, edi, esi, edx
498
		stdcall [buf2d_set_pixel], buf_0, edi, esi, edx
560
;...
499
;...
561
		inc ebx
500
		inc ebx
562
		cmp ebx,eax
501
		cmp ebx,eax
Line 566... Line 505...
566
	.zoom2:
505
	.zoom2:
Line 567... Line 506...
567
 
506
 
568
	@@: ;for(;i<=fristC;i++){
507
	@@: ;for(;i<=fristC;i++){
569
		mov ecx,ebx
508
		mov ecx,ebx
570
		shl ecx,2
509
		shl ecx,2
571
		add ecx,dword[memCell]
510
		add ecx,[memCell]
Line 572... Line 511...
572
		get_cell_offset ecx,dword[ecx]
511
		get_cell_offset ecx,[ecx]
573
 
512
 
574
		xor edx,edx
513
		xor edx,edx
575
		mov dl,byte[zoom] ;edx ¨á¯®«ì§ã¥âáï ¤«ï ¢­¥á¥­¨ï zoom ¢ 4 ¡ ©â­®¥ ç¨á«®
514
		mov dl,byte[zoom] ;edx ¨á¯®«ì§ã¥âáï ¤«ï ¢­¥á¥­¨ï zoom ¢ 4 ¡ ©â­®¥ ç¨á«®
576
		mov edi,dword[ecx] ;+0 = .x
515
		mov edi,[ecx] ;+0 = .x
577
		add edi,dword[Cor_x]
516
		add edi,[Cor_x]
578
		imul edi,edx
517
		imul edi,edx
579
		mov esi,dword[ecx+4] ;+4 = .y
518
		mov esi,[ecx+4] ;+4 = .y
580
		add esi,dword[Cor_y]
519
		add esi,[Cor_y]
581
		imul esi,edx
520
		imul esi,edx
582
		bt word[ecx+12],0 ;+12 = .liv
521
		bt word[ecx+12],0 ;+12 = .liv
583
		jc .z2_cell_1
522
		jc .z2_cell_1
584
			;­¥ ¦¨¢ ï ï祩ª 
523
			;­¥ ¦¨¢ ï ï祩ª 
585
			mov edx,dword[CellColors]
524
			mov edx,[CellColors]
586
			mov edx,dword[edx]
525
			mov edx,[edx]
587
			jmp .z2_cell_0
526
			jmp .z2_cell_0
588
		.z2_cell_1:
527
		.z2_cell_1:
589
			;¦¨¢ ï ï祩ª 
528
			;¦¨¢ ï ï祩ª 
590
			mov edx,dword[tim]
529
			mov edx,[tim]
591
			inc edx
530
			inc edx
592
			sub edx,dword[ecx+8] ;+8 = .tc
531
			sub edx,[ecx+8] ;+8 = .tc
593
			cmp edx,COL_MEM
532
			cmp edx,COL_MEM
594
			jle .z2_in_color
533
			jle .z2_in_color
595
				mov edx,COL_MEM
534
				mov edx,COL_MEM
596
			.z2_in_color:
535
			.z2_in_color:
597
			shl edx,2
536
			shl edx,2
598
			add edx,dword[CellColors]
537
			add edx,[CellColors]
599
			mov edx,dword[edx]
538
			mov edx,[edx]
600
		.z2_cell_0:
539
		.z2_cell_0:
601
		xor ecx,ecx
540
		xor ecx,ecx
602
		mov cl,byte[zoom] ;ecx ¨á¯®«ì§ã¥âáï ¤«ï ¢­¥á¥­¨ï zoom ¢ 4 ¡ ©â­®¥ ç¨á«®
541
		mov cl,byte[zoom] ;ecx ¨á¯®«ì§ã¥âáï ¤«ï ¢­¥á¥­¨ï zoom ¢ 4 ¡ ©â­®¥ ç¨á«®
Line 616... Line 555...
616
	;eax -> firstC
555
	;eax -> firstC
617
	;ebx -> i
556
	;ebx -> i
618
	;ecx -> &memCell[i]
557
	;ecx -> &memCell[i]
619
	;edx -> cell[memCell[i]]
558
	;edx -> cell[memCell[i]]
Line 620... Line 559...
620
 
559
 
621
	mov eax,dword[memCell]
560
	mov eax,[memCell]
622
	mov ecx,eax
561
	mov ecx,eax
623
	mov eax,dword[eax]
562
	mov eax,[eax]
624
	cmp eax,1
563
	cmp eax,1
625
	jl .fun_e
564
	jl .fun_e
626
	inc dword[tim]
565
	inc dword[tim]
627
	mov ebx,1
566
	mov ebx,1
628
	@@: ;for(i=1;i<=firstC;i++)
567
	@@: ;for(i=1;i<=firstC;i++)
629
		add ecx,4
568
		add ecx,4
630
		get_cell_offset edx,dword[ecx]
569
		get_cell_offset edx,[ecx]
631
		bt word[edx+12],0 ;+12 = .liv
570
		bt word[edx+12],0 ;+12 = .liv
632
		jae .if_0_e
571
		jae .if_0_e
633
			; á®åà ­¥­¨¥ ï祩ª¨ (á®á¥¤¥© 2 ¨«¨ 3)
572
			; á®åà ­¥­¨¥ ï祩ª¨ (á®á¥¤¥© 2 ¨«¨ 3)
634
			cmp byte[edx+13],2 ;+13 = .so
573
			cmp byte[edx+13],2 ;+13 = .so
Line 645... Line 584...
645
				jmp .if_2_e
584
				jmp .if_2_e
646
		.if_1_e:
585
		.if_1_e:
647
			; 㤠«¥­¨¥ ¯ãá⮩ ï祩ª¨ ¤«ï ®á¢®¡®¦¤¥­¨ï ¯ ¬ïâ¨
586
			; 㤠«¥­¨¥ ¯ãá⮩ ï祩ª¨ ¤«ï ®á¢®¡®¦¤¥­¨ï ¯ ¬ïâ¨
648
			cmp byte[edx+13],0 ;+13 = .so
587
			cmp byte[edx+13],0 ;+13 = .so
649
			jne .if_2_e
588
			jne .if_2_e
650
			mov edi,dword[edx+8] ;+8 = .tc
589
			mov edi,[edx+8] ;+8 = .tc
651
			add edi,5 ; 5 - ¢à¥¬ï á®åà ­¥­¨ï ¯ãá⮩ ï祩ª¨, ¤® ¥ñ 㤠«¥­¨ï
590
			add edi,5 ; 5 - ¢à¥¬ï á®åà ­¥­¨ï ¯ãá⮩ ï祩ª¨, ¤® ¥ñ 㤠«¥­¨ï
652
			cmp edi,dword[tim]
591
			cmp edi,[tim]
653
			jge .if_2_e
592
			jge .if_2_e
654
				mov edi,eax
593
				mov edi,eax
655
				shl edi,2
594
				shl edi,2
656
				add edi,dword[memCell] ;edi -> &memCell[fristC]
595
				add edi,[memCell] ;edi -> &memCell[fristC]
657
				mov esi,dword[edi] ;swp=memCell[fristC];
596
				mov esi,[edi] ;swp=memCell[fristC];
658
				mov edx,dword[ecx] ;edx - 㦥 ­¥ ¨á¯®«ì§ã¥¬, ¯®â®¬ã ¬®¦¥¬ ¯®àâ¨âì
597
				mov edx,[ecx] ;edx - 㦥 ­¥ ¨á¯®«ì§ã¥¬, ¯®â®¬ã ¬®¦¥¬ ¯®àâ¨âì
659
				mov dword[edi],edx ;memCell[fristC]=memCell[i];
598
				mov dword[edi],edx ;memCell[fristC]=memCell[i];
660
				mov dword[ecx],esi ;memCell[i]=swp;
599
				mov dword[ecx],esi ;memCell[i]=swp;
661
				dec eax
600
				dec eax
662
				dec ebx
601
				dec ebx
663
				sub ecx,4
602
				sub ecx,4
664
		.if_2_e:
603
		.if_2_e:
Line 665... Line 604...
665
 
604
 
666
		inc ebx
605
		inc ebx
667
		cmp ebx,eax
606
		cmp ebx,eax
668
		jle @b
607
		jle @b
669
	mov ebx,dword[memCell]
608
	mov ebx,[memCell]
Line 670... Line 609...
670
	mov dword[ebx],eax ;firstC <- eax
609
	mov dword[ebx],eax ;firstC <- eax
671
 
610
 
Line 672... Line 611...
672
	mov dword[b_sort],eax
611
	mov dword[b_sort],eax
673
	stdcall pole_fl_sort, dword[memCell],eax
612
	stdcall pole_fl_sort, dword[memCell],eax
674
 
613
 
675
	mov ecx,dword[memCell]
614
	mov ecx,[memCell]
676
	mov ebx,1
615
	mov ebx,1
677
	@@: ;for(i=1;i<=firstC;i++)
616
	@@: ;for(i=1;i<=firstC;i++)
678
		add ecx,4
617
		add ecx,4
679
		get_cell_offset edx,dword[ecx]
618
		get_cell_offset edx,[ecx]
680
		bt word[edx+12],1 ;+12 = .liv
619
		bt word[edx+12],1 ;+12 = .liv
681
		jae .no_change
620
		jae .no_change
682
			xor byte[edx+12],3 ;+12 = .liv
621
			xor byte[edx+12],3 ;+12 = .liv
683
			mov edi,dword[tim]
622
			mov edi,[tim]
684
			mov dword[edx+8],edi ;+8 = .tc
623
			mov dword[edx+8],edi ;+8 = .tc
685
			bt word[edx+12],0 ;+12 = .liv
624
			bt word[edx+12],0 ;+12 = .liv
686
			jc .new_cell
625
			jc .new_cell
687
				push eax
626
				push eax
688
				mov edi,dword[edx]
627
				mov edi,[edx]
689
				dec edi
628
				dec edi
690
				mov esi,dword[edx+4]
629
				mov esi,[edx+4]
691
				dec esi
630
				dec esi
692
				dec dword[osob]
631
				dec dword[osob]
Line 724... Line 663...
724
				dec byte[edx+13] ;+13 = .so
663
				dec byte[edx+13] ;+13 = .so
725
				pop eax
664
				pop eax
726
				jmp .no_change
665
				jmp .no_change
727
			.new_cell: ; ¯®ï¢¨« áì ­®¢ ï ï祩ª 
666
			.new_cell: ; ¯®ï¢¨« áì ­®¢ ï ï祩ª 
728
				inc dword[osob]
667
				inc dword[osob]
729
				mov edi,dword[edx]
668
				mov edi,[edx]
730
				dec edi
669
				dec edi
731
				mov esi,dword[edx+4]
670
				mov esi,[edx+4]
732
				dec esi
671
				dec esi
733
				stdcall pole_cell_creat,edi,esi,0
672
				stdcall pole_cell_creat,edi,esi,0
734
				inc esi
673
				inc esi
735
				stdcall pole_cell_creat,edi,esi,0
674
				stdcall pole_cell_creat,edi,esi,0
736
				inc esi
675
				inc esi
Line 755... Line 694...
755
 
694
 
756
;‘®àâ¨à®¢ª  ¢¥ªâ®à  a[1..n] ¬¥â®¤®¬ ”«®©¤ 
695
;‘®àâ¨à®¢ª  ¢¥ªâ®à  a[1..n] ¬¥â®¤®¬ ”«®©¤ 
757
align 4
696
align 4
758
proc pole_fl_sort, a:dword, n:dword
697
proc pole_fl_sort, a:dword, n:dword
759
	pushad
698
	pushad
760
	mov ecx,dword[a]
699
	mov ecx,[a]
761
	;”®à¬¨à®¢ âì ¨á室­®¥ ç áâ¨ç­® 㯮à冷祭­®¥ ¤¥à¥¢®
700
	;”®à¬¨à®¢ âì ¨á室­®¥ ç áâ¨ç­® 㯮à冷祭­®¥ ¤¥à¥¢®
762
	mov eax,dword[n]
701
	mov eax,[n]
763
	shr eax,1
702
	shr eax,1
764
	@@: ;for(i=n>>1; i>=2; i--)
703
	@@: ;for(i=n>>1; i>=2; i--)
765
		stdcall pole_fl_surface, ecx,eax,[n] ;(a,i,n)
704
		stdcall pole_fl_surface, ecx,eax,[n] ;(a,i,n)
766
		dec eax
705
		dec eax
767
		cmp eax,2
706
		cmp eax,2
768
		jge @b
707
		jge @b
769
	;‚믮«­¨âì ¯à®æ¥¤ãà㠢ᯫëâ¨ï ”«®©¤  ¤«ï ª ¦¤®£® ¯®¤¤¥à¥¢ 
708
	;‚믮«­¨âì ¯à®æ¥¤ãà㠢ᯫëâ¨ï ”«®©¤  ¤«ï ª ¦¤®£® ¯®¤¤¥à¥¢ 
770
	mov eax,dword[n]
709
	mov eax,[n]
771
	@@: ;for(i=n; i>=2; i--){
710
	@@: ;for(i=n; i>=2; i--){
772
		stdcall pole_fl_surface, ecx,1,eax ;(a,1,i)
711
		stdcall pole_fl_surface, ecx,1,eax ;(a,1,i)
773
		;®¬¥áâ¨âì ­ ©¤¥­­ë© ¬ ªá¨¬ «ì­ë© í«¥¬¥­â ¢ ª®­¥æ ᯨ᪠
712
		;®¬¥áâ¨âì ­ ©¤¥­­ë© ¬ ªá¨¬ «ì­ë© í«¥¬¥­â ¢ ª®­¥æ ᯨ᪠
774
		mov edi,eax
713
		mov edi,eax
775
		shl edi,2
714
		shl edi,2
776
		add edi,ecx ;edi -> &a[i]
715
		add edi,ecx ;edi -> &a[i]
777
		mov esi,dword[edi] ;w=a[i];
716
		mov esi,[edi] ;w=a[i];
778
		mov edx,dword[ecx+4]
717
		mov edx,[ecx+4]
779
		mov dword[edi],edx ;a[i]=a[1];
718
		mov dword[edi],edx ;a[i]=a[1];
Line 780... Line 719...
780
		mov dword[ecx+4],esi ;a[1]=w;
719
		mov dword[ecx+4],esi ;a[1]=w;
781
 
720
 
Line 794... Line 733...
794
endl
733
endl
795
	pushad
734
	pushad
796
	;edx -> ...
735
	;edx -> ...
797
	;edi -> m
736
	;edi -> m
798
	;esi -> j
737
	;esi -> j
799
	mov eax,dword[a]
738
	mov eax,[a]
800
	mov ebx,dword[i]
739
	mov ebx,[i]
801
	mov ecx,dword[k]
740
	mov ecx,[k]
Line 802... Line 741...
802
 
741
 
803
	mov edx,ebx
742
	mov edx,ebx
804
	shl edx,2
743
	shl edx,2
805
	add edx,eax
744
	add edx,eax
806
	mov edx,dword[edx]
745
	mov edx,[edx]
807
	mov dword[copy],edx ;copy=a[i];
746
	mov dword[copy],edx ;copy=a[i];
808
	mov edi,ebx
747
	mov edi,ebx
809
	shl edi,1 ;m=i<<1;
748
	shl edi,1 ;m=i<<1;
810
	.cycle_b: ;while (m<=k) {
749
	.cycle_b: ;while (m<=k) {
Line 851... Line 790...
851
	.cycle_e:
790
	.cycle_e:
Line 852... Line 791...
852
 
791
 
853
	;§­ ç¥­¨ï ¬­®£¨å ॣ¨áâ஢ 㦥 ­¥ ¢ ¦­ë â. ª. ª®­¥æ ä㭪樨
792
	;§­ ç¥­¨ï ¬­®£¨å ॣ¨áâ஢ 㦥 ­¥ ¢ ¦­ë â. ª. ª®­¥æ ä㭪樨
854
	shl ebx,2
793
	shl ebx,2
855
	add eax,ebx
794
	add eax,ebx
856
	mov edx,dword[copy]
795
	mov edx,[copy]
Line 857... Line 796...
857
	mov dword[eax],edx ;a[i]=copy;
796
	mov dword[eax],edx ;a[i]=copy;
858
 
797
 
859
	popad
798
	popad
Line 867... Line 806...
867
	load_libraries l_libs_start,l_libs_end
806
	load_libraries l_libs_start,l_libs_end
868
	;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ­ è  «¨¡ 
807
	;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ­ è  «¨¡ 
869
	mov	ebp,lib_7
808
	mov	ebp,lib_7
870
	cmp	dword [ebp+ll_struc_size-4],0
809
	cmp	dword [ebp+ll_struc_size-4],0
871
	jz	@f
810
	jz	@f
872
		mcall -1 ;exit not correct
811
		mcall SF_TERMINATE_PROCESS ;exit not correct
873
	@@:
812
	@@:
874
	mcall 48,3,sc,sizeof.system_colors
813
	mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
875
	mcall 40,0x27
814
	mcall SF_SET_EVENTS_MASK,0x27
876
	stdcall [OpenDialog_Init],OpenDialog_data ;¯®¤£®â®¢ª  ¤¨ «®£ 
815
	stdcall [OpenDialog_Init],OpenDialog_data ;¯®¤£®â®¢ª  ¤¨ «®£ 
Line 877... Line 816...
877
 
816
 
Line 878... Line 817...
878
	stdcall [buf2d_create], buf_0 ;ᮧ¤ ­¨¥ ¡ãä¥à 
817
	stdcall [buf2d_create], buf_0 ;ᮧ¤ ­¨¥ ¡ãä¥à 
879
 
818
 
880
	stdcall mem.Alloc,MAX_CELL*sizeof.Cell
819
	stdcall mem.Alloc,MAX_CELL*sizeof.Cell
881
	mov [cell],eax
820
	mov [cell],eax
882
	stdcall mem.Alloc,MAX_CELL*4
821
	stdcall mem.Alloc,MAX_CELL*4
883
	mov [memCell],eax
822
	mov [memCell],eax
884
	stdcall mem.Alloc,(COL_MEM+1)*4
823
	stdcall mem.Alloc,(COL_MEM+1)*4
Line 885... Line 824...
885
	mov [CellColors],eax
824
	mov [CellColors],eax
886
	load_image_file fn_toolbar, image_data_toolbar,IMAGE_TOOLBAR_SIZE
825
	include_image_file 'toolbar.png', image_data_toolbar
887
 
826
 
888
	;­ áâனª  梥⮢ ï祥ª
827
	;­ áâனª  梥⮢ ï祥ª
Line 893... Line 832...
893
	;xor eax,eax
832
	;xor eax,eax
894
	;mov edi,txt_zoom.zi
833
	;mov edi,txt_zoom.zi
895
	;mov al,byte[zoom]
834
	;mov al,byte[zoom]
896
	;call tl_convert_to_str
835
	;call tl_convert_to_str
Line 897... Line 836...
897
 
836
 
898
	mcall 26,9
837
	mcall SF_SYSTEM_GET,SSF_TIME_COUNT
Line 899... Line 838...
899
	mov [last_time],eax
838
	mov [last_time],eax
900
 
839
 
901
align 4
840
align 4
Line 902... Line 841...
902
red_win:
841
red_win:
903
	call draw_window
842
	call draw_window
904
 
843
 
905
align 4
844
align 4
906
still:
845
still:
907
	mcall 26,9
846
	mcall SF_SYSTEM_GET,SSF_TIME_COUNT
908
	mov ebx,[last_time]
847
	mov ebx,[last_time]
909
	add ebx,10 ;§ ¤¥à¦ª 
848
	add ebx,10 ;§ ¤¥à¦ª 
910
	cmp ebx,eax
849
	cmp ebx,eax
911
	jge @f
850
	jge @f
912
		mov ebx,eax
851
		mov ebx,eax
913
	@@:
-
 
914
	sub ebx,eax
-
 
915
	;cmp ebx,10 ;§ ¤¥à¦ª 
-
 
916
	;ja timer_funct
-
 
917
	;test ebx,ebx
852
	@@:
918
	;jz timer_funct
853
	sub ebx,eax
Line 919... Line 854...
919
	mcall 23
854
	mcall SF_WAIT_EVENT_TIMEOUT
920
	cmp eax,0
855
	cmp eax,0
Line 930... Line 865...
930
	jmp still
865
	jmp still
Line 931... Line 866...
931
 
866
 
932
align 4
867
align 4
933
timer_funct:
868
timer_funct:
934
	pushad
869
	pushad
935
	mcall 26,9
870
	mcall SF_SYSTEM_GET,SSF_TIME_COUNT
Line 936... Line 871...
936
	mov [last_time],eax
871
	mov [last_time],eax
937
 
872
 
938
	cmp byte[tim_ch],0
873
	cmp byte[tim_ch],0
939
	je @f
874
	je @f
940
		;call but_next_gen
875
		;call but_next_gen
941
		cld
876
		cld
942
		mov ecx,dword[poc_stop]
877
		mov ecx,[poc_stop]
943
		cmp ecx,1
878
		cmp ecx,1
944
		jg .clear
879
		jg .clear
945
			mov ecx,1 ;¨á¯à ¢«¥­¨¥ ecx ­  á«ãç © ç¨á¥« ¬¥­ìè¨å 1
880
			mov ecx,1 ;¨á¯à ¢«¥­¨¥ ecx ­  á«ãç © ç¨á¥« ¬¥­ìè¨å 1
Line 957... Line 892...
957
	jmp still
892
	jmp still
Line 958... Line 893...
958
 
893
 
959
align 4
894
align 4
960
draw_window:
895
draw_window:
961
pushad
-
 
962
	mcall 12,1
-
 
963
	xor eax,eax
-
 
964
	mov ebx,(20 shl 16)+485
896
pushad
965
	mov ecx,(20 shl 16)+415
897
	mcall SF_REDRAW,SSF_BEGIN_DRAW
966
	mov edx,[sc.work]
898
	mov edx,[sc.work]
967
	or  edx,(3 shl 24)+0x10000000+0x20000000
899
	or  edx,0x33000000
968
	mov edi,hed
900
	mov edi,hed
Line 969... Line -...
969
	int 0x40
-
 
970
 
-
 
971
	mov eax,8
-
 
972
	mov ebx,(5 shl 16)+20
-
 
973
	mov ecx,(5 shl 16)+20
901
	mcall SF_CREATE_WINDOW,(20 shl 16)+485,(20 shl 16)+415
974
	mov edx,3
-
 
Line 975... Line 902...
975
	mov esi,[sc.work_button]
902
 
976
	int 0x40
-
 
977
 
903
	mcall SF_DEFINE_BUTTON,(5 shl 16)+20,(5 shl 16)+20,3, [sc.work_button]
978
	mov ebx,(30 shl 16)+20
904
 
Line 979... Line 905...
979
	mov ecx,(5 shl 16)+20
905
	mov ebx,(30 shl 16)+20
980
	mov edx,4
-
 
981
	int 0x40
906
	mov edx,4
982
 
907
	int 0x40
Line 983... Line 908...
983
	mov ebx,(55 shl 16)+20
908
 
984
	mov ecx,(5 shl 16)+20
-
 
985
	mov edx,5
909
	mov ebx,(55 shl 16)+20
986
	int 0x40
910
	mov edx,5
Line 987... Line 911...
987
 
911
	int 0x40
988
	mov ebx,(85 shl 16)+20
-
 
989
	mov ecx,(5 shl 16)+20
912
 
990
	mov edx,6
913
	mov ebx,(85 shl 16)+20
Line 991... Line 914...
991
	int 0x40
914
	mov edx,6
992
 
-
 
993
	mov ebx,(110 shl 16)+20
915
	int 0x40
994
	mov ecx,(5 shl 16)+20
916
 
Line 995... Line 917...
995
	mov edx,7
917
	mov ebx,(110 shl 16)+20
996
	int 0x40
-
 
997
 
918
	mov edx,7
998
	mov ebx,(135 shl 16)+20
919
	int 0x40
Line 999... Line 920...
999
	mov ecx,(5 shl 16)+20
920
 
1000
	mov edx,8
-
 
1001
	int 0x40
921
	mov ebx,(135 shl 16)+20
1002
 
922
	mov edx,8
Line 1003... Line 923...
1003
	mov ebx,(165 shl 16)+20
923
	int 0x40
1004
	mov ecx,(5 shl 16)+20
-
 
1005
	mov edx,9
924
 
1006
	int 0x40
925
	mov ebx,(165 shl 16)+20
Line 1007... Line 926...
1007
 
926
	mov edx,9
1008
	mov ebx,(190 shl 16)+20
-
 
1009
	mov ecx,(5 shl 16)+20
927
	int 0x40
1010
	mov edx,10
928
 
Line 1011... Line 929...
1011
	int 0x40
929
	mov ebx,(190 shl 16)+20
1012
 
-
 
1013
	mov ebx,(220 shl 16)+20
930
	mov edx,10
1014
	mov ecx,(5 shl 16)+20
931
	int 0x40
Line 1015... Line 932...
1015
	mov edx,11
932
 
1016
	int 0x40
-
 
1017
 
933
	mov ebx,(220 shl 16)+20
1018
	mov ebx,(245 shl 16)+20
934
	mov edx,11
Line 1019... Line -...
1019
	mov ecx,(5 shl 16)+20
-
 
1020
	mov edx,12
935
	int 0x40
1021
	int 0x40
-
 
1022
 
-
 
1023
	mov ebx,(270 shl 16)+20
-
 
Line 1024... Line 936...
1024
	mov ecx,(5 shl 16)+20
936
 
1025
	mov edx,13
937
	mov ebx,(245 shl 16)+20
1026
	int 0x40
938
	mov edx,12
Line 1069... Line 981...
1069
 
981
 
Line 1070... Line 982...
1070
	call draw_pok
982
	call draw_pok
Line 1071... Line 983...
1071
 
983
 
1072
	stdcall [buf2d_draw], buf_0
984
	stdcall [buf2d_draw], buf_0
1073
 
985
 
Line 1074... Line 986...
1074
	mcall 12,2
986
	mcall SF_REDRAW,SSF_END_DRAW
1075
popad
987
popad
1076
	ret
988
	ret
1077
 
989
 
1078
align 4
990
align 4
1079
draw_pok:
991
draw_pok:
1080
	mov eax,4 ;à¨á®¢ ­¨¥ ⥪áâ 
992
	mov eax,SF_DRAW_TEXT
1081
	mov ebx,325*65536+5
993
	mov ebx,325*65536+5
Line 1089... Line 1001...
1089
	int 0x40
1001
	int 0x40
1090
	add bx,9
1002
	add bx,9
1091
	mov edx,txt_osob
1003
	mov edx,txt_osob
1092
	int 0x40
1004
	int 0x40
Line 1093... Line 1005...
1093
 
1005
 
1094
	mov eax,47
1006
	mov eax,SF_DRAW_NUMBER
1095
	xor ecx,ecx
1007
	xor ecx,ecx
1096
	mov cl,byte[zoom]
1008
	mov cl,byte[zoom]
1097
	mov ebx,(2 shl 16)
1009
	mov ebx,(2 shl 16)
1098
	mov edx,(325+6*9)*65536+5
1010
	mov edx,(325+6*9)*65536+5
Line 1110... Line 1022...
1110
	int 0x40 ;¯®¯ã«ïæ¨ï
1022
	int 0x40 ;¯®¯ã«ïæ¨ï
1111
	ret
1023
	ret
Line 1112... Line 1024...
1112
 
1024
 
1113
align 4
1025
align 4
1114
key:
1026
key:
1115
	mcall 2
1027
	mcall SF_GET_KEY
Line 1116... Line 1028...
1116
	jmp still
1028
	jmp still
1117
 
1029
 
1118
 
1030
 
1119
align 4
1031
align 4
1120
button:
1032
button:
1121
	mcall 17
1033
	mcall SF_GET_BUTTON
-
 
1034
	cmp ah,3
1122
	cmp ah,3
1035
	jne @f
1123
	jne @f
1036
		call but_new_file
1124
		call but_new_file
1037
		jmp still
1125
	@@:
1038
	@@:
-
 
1039
	cmp ah,4
1126
	cmp ah,4
1040
	jne @f
1127
	jne @f
1041
		call but_open_file
1128
		call but_open_file
1042
		jmp still
1129
	@@:
1043
	@@:
-
 
1044
	cmp ah,5
1130
	cmp ah,5
1045
	jne @f
1131
	jne @f
1046
		call but_save_file
1132
		call but_save_file
1047
		jmp still
1133
	@@:
1048
	@@:
-
 
1049
	cmp ah,6
1134
	cmp ah,6
1050
	jne @f
1135
	jne @f
1051
		call but_next_gen
1136
		call but_next_gen
1052
		jmp still
1137
	@@:
1053
	@@:
-
 
1054
	cmp ah,7
1138
	cmp ah,7
1055
	jne @f
1139
	jne @f
1056
		call but_run
1140
		call but_run
1057
		jmp still
1141
	@@:
1058
	@@:
-
 
1059
	cmp ah,8
1142
	cmp ah,8
1060
	jne @f
1143
	jne @f
1061
		call but_stop
1144
		call but_stop
1062
		jmp still
1145
	@@:
1063
	@@:
-
 
1064
	cmp ah,9
1146
	cmp ah,9
1065
	jne @f
1147
	jne @f
1066
		call but_zoom_p
1148
		call but_zoom_p
1067
		jmp still
1149
	@@:
1068
	@@:
-
 
1069
	cmp ah,10
1150
	cmp ah,10
1070
	jne @f
1151
	jne @f
1071
		call but_zoom_m
1152
		call but_zoom_m
1072
		jmp still
1153
	@@:
1073
	@@:
-
 
1074
	cmp ah,11
1154
	cmp ah,11
1075
	jne @f
1155
	jne @f
1076
		call but_pole_up
1156
		call but_pole_up
1077
		jmp still
1157
	@@:
1078
	@@:
-
 
1079
	cmp ah,12
1158
	cmp ah,12
1080
	jne @f
1159
	jne @f
1081
		call but_pole_dn
1160
		call but_pole_dn
1082
		jmp still
1161
	@@:
1083
	@@:
-
 
1084
	cmp ah,13
1162
	cmp ah,13
1085
	jne @f
1163
	jne @f
1086
		call but_pole_left
1164
		call but_pole_left
1087
		jmp still
1165
	@@:
1088
	@@:
-
 
1089
	cmp ah,14
1166
	cmp ah,14
1090
	jne @f
1167
	jne @f
1091
		call but_pole_right
1168
		call but_pole_right
1092
		jmp still
1169
	@@:
1093
	@@:
1170
	cmp ah,1
1094
	cmp ah,1
-
 
1095
	jne still
1171
	jne still
1096
.exit:
1172
.exit:
1097
	stdcall [buf2d_delete],buf_0
1173
	stdcall [buf2d_delete],buf_0
1098
	stdcall mem.Free,[open_file_lif]
1174
	stdcall mem.Free,[cell]
1099
	stdcall mem.Free,[cell]
1175
	stdcall mem.Free,[memCell]
1100
	stdcall mem.Free,[memCell]
Line 1176... Line 1101...
1176
	stdcall mem.Free,[CellColors]
1101
	stdcall mem.Free,[CellColors]
1177
	stdcall mem.Free,[image_data_toolbar]
1102
	stdcall mem.Free,[image_data_toolbar]
1178
	mcall -1
1103
	mcall SF_TERMINATE_PROCESS
Line 1179... Line 1104...
1179
 
1104
 
1180
 
1105
 
1181
align 4
1106
align 4
1182
but_new_file:
-
 
Line 1183... Line 1107...
1183
	ret
1107
but_new_file:
1184
 
1108
	ret
1185
align 4
1109
 
1186
open_file_lif:
1110
align 4
Line 1195... Line 1119...
1195
	stdcall [OpenDialog_Start],OpenDialog_data
1119
	stdcall [OpenDialog_Start],OpenDialog_data
1196
	cmp [OpenDialog_data.status],2
1120
	cmp [OpenDialog_data.status],2
1197
	je .end_open_file
1121
	je .end_open_file
1198
	;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
1122
	;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
Line 1199... Line -...
1199
 
-
 
1200
	mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
1123
 
1201
	mov [run_file_70.Function], 0
1124
	mov [run_file_70.Function], SSF_GET_INFO
1202
	mov [run_file_70.Position], 0
1125
	mov [run_file_70.Position], 0
1203
	mov [run_file_70.Flags], 0
1126
	mov [run_file_70.Flags], 0
1204
	mov dword[run_file_70.Count], open_file_lif.end-open_file_lif
1127
	mov dword[run_file_70.Count], 0
1205
	m2m [run_file_70.Buffer], open_file_lif
1128
	mov dword[run_file_70.Buffer], open_b
1206
	mov byte[run_file_70+20], 0
1129
	mov byte[run_file_70+20], 0
1207
	mov dword[run_file_70.FileName], openfile_path
1130
	mov dword[run_file_70.FileName], openfile_path
-
 
1131
	mcall SF_FILE,run_file_70
-
 
1132
 
-
 
1133
	mov ecx,dword[open_b+32] ;+32 qword: à §¬¥à ä ©«  ¢ ¡ ©â å
-
 
1134
	inc ecx ;for text files
-
 
1135
	stdcall mem.ReAlloc,[open_file_lif],ecx
-
 
1136
	mov [open_file_lif],eax
-
 
1137
	dec ecx ;for text files
-
 
1138
	mov byte[eax+ecx],0 ;for text files
-
 
1139
	
-
 
1140
	mov [run_file_70.Function], SSF_READ_FILE
-
 
1141
	mov [run_file_70.Position], 0
-
 
1142
	mov [run_file_70.Flags], 0
-
 
1143
	mov [run_file_70.Count], ecx
-
 
1144
	m2m dword[run_file_70.Buffer], dword[open_file_lif]
-
 
1145
	mov byte[run_file_70+20], 0
1208
	mov ebx,run_file_70
1146
	mov dword[run_file_70.FileName], openfile_path
-
 
1147
	mcall SF_FILE,run_file_70 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
-
 
1148
	test eax,eax
1209
	int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
1149
	jnz .end_open_file
1210
	cmp ebx,0xffffffff
1150
	cmp ebx,0xffffffff
Line 1211... Line 1151...
1211
	je .end_open_file
1151
	je .end_open_file
1212
 
-
 
1213
	add ebx,open_file_lif
1152
 
Line 1214... Line 1153...
1214
	mov byte[ebx],0 ;­  á«ãç © ¥á«¨ à ­¥¥ ¡ë« ®âªàëâ ä ©« ¡®«ì襣® à §¬¥à  ç¨á⨬ ª®­¥æ ¡ãä¥à  á ä ©«®¬
1153
	mov [open_file_size],ebx
1215
	mcall 71,1,openfile_path
1154
	mcall SF_SET_CAPTION,1,openfile_path
1216
 
1155
 
1217
	call pole_clear
1156
	call pole_clear
1218
	mov eax,dword[buf_0.w]
1157
	mov eax,[buf_0.w]
1219
	shr eax,1
1158
	shr eax,1
1220
	xor ecx,ecx
1159
	xor ecx,ecx
1221
	mov cl,byte[zoom]
1160
	mov cl,byte[zoom]
1222
	cmp cx,2
1161
	cmp cx,2
1223
	jl @f ;¤¥«¥­¨¥ ­  ¢¥«¨ç¨­ã zoom
1162
	jl @f ;¤¥«¥­¨¥ ­  ¢¥«¨ç¨­ã zoom
1224
		xor edx,edx
1163
		xor edx,edx
1225
		div ecx
1164
		div ecx
1226
	@@:
1165
	@@:
1227
	add dword[Cor_x],eax
1166
	add [Cor_x],eax
1228
	mov eax,dword[buf_0.h]
1167
	mov eax,[buf_0.h]
1229
	shr eax,1
1168
	shr eax,1
1230
	cmp cx,2
1169
	cmp cx,2
1231
	jl @f ;¤¥«¥­¨¥ ­  ¢¥«¨ç¨­ã zoom
1170
	jl @f ;¤¥«¥­¨¥ ­  ¢¥«¨ç¨­ã zoom
1232
		xor edx,edx
1171
		xor edx,edx
Line 1233... Line 1172...
1233
		div ecx
1172
		div ecx
1234
	@@:
1173
	@@:
1235
	add dword[Cor_y],eax
1174
	add [Cor_y],eax
-
 
1175
 
1236
 
1176
	;eax - first x position
1237
	;eax - first x position
1177
	;ebx - x position
1238
	;ebx - x position
1178
	;ecx - y position
1239
	;ecx - y position
1179
	;edx - ª®­¥æ ä ©« 
-
 
1180
	mov edi,[open_file_lif]
-
 
1181
	xor ebx,ebx
1240
	mov edi,open_file_lif
1182
	xor ecx,ecx
1241
	xor ebx,ebx
1183
	mov eax,ebx
1242
	xor ecx,ecx
1184
	mov edx,[open_file_lif]
1243
	mov eax,ebx
1185
	add edx,[open_file_size]
1244
	@@:
1186
	@@:
Line 1283... Line 1225...
1283
			stdcall conv_str_to_int,edi
1225
			stdcall conv_str_to_int,edi
1284
			mov ecx,eax
1226
			mov ecx,eax
1285
			mov eax,ebx ;¢®ááâ ­®¢«¥­¨¥ «¥¢®£® ®âáâ㯠 ¢ eax
1227
			mov eax,ebx ;¢®ááâ ­®¢«¥­¨¥ «¥¢®£® ®âáâ㯠 ¢ eax
1286
		.pos:
1228
		.pos:
1287
		inc edi
1229
		inc edi
1288
		cmp byte[edi],0
1230
		cmp edi,edx
1289
		jne @b
1231
		jl @b
1290
	;---
1232
	;---
1291
	stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
1233
	stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
1292
	call pole_paint ;à¨á㥬 ¯®«¥ (­  á«ãç © ¥á«¨ ¥áâì á¥âª  ¨«¨ ⥪áâ®¢ë¥ ¯®¤¯¨á¨)
1234
	call pole_paint ;à¨á㥬 ¯®«¥ (­  á«ãç © ¥á«¨ ¥áâì á¥âª  ¨«¨ ⥪áâ®¢ë¥ ¯®¤¯¨á¨)
1293
	stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
1235
	stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
1294
	.end_open_file:
1236
	.end_open_file:
Line 1334... Line 1276...
1334
		pushad
1276
		pushad
1335
		;¢ëç¨á«¥­¨¥ ᤢ¨£®¢ ¤«ï ¯®«ï, ª®â®àë¥ ®¡¥á¯¥ç â 業â஢ªã ¯®«ï ¯à¨ 㢥«¨ç¥­¨¨ ¬ áèâ ¡ 
1277
		;¢ëç¨á«¥­¨¥ ᤢ¨£®¢ ¤«ï ¯®«ï, ª®â®àë¥ ®¡¥á¯¥ç â 業â஢ªã ¯®«ï ¯à¨ 㢥«¨ç¥­¨¨ ¬ áèâ ¡ 
1336
		xor ecx,ecx
1278
		xor ecx,ecx
1337
		mov cl,byte[zoom]
1279
		mov cl,byte[zoom]
1338
		xor edx,edx
1280
		xor edx,edx
1339
		mov eax,dword[buf_0.w]
1281
		mov eax,[buf_0.w]
1340
		shr eax,1 ;¢ eax ¯®«®¢¨­  è¨à¨­ë ¯®«ï
1282
		shr eax,1 ;¢ eax ¯®«®¢¨­  è¨à¨­ë ¯®«ï
1341
		mov ebx,eax ;¤¥« ¥¬ १¥à¢­ãî ª®¯¨î eax
1283
		mov ebx,eax ;¤¥« ¥¬ १¥à¢­ãî ª®¯¨î eax
1342
		div ecx ;¤¥«¨¬ eax ­  ⥪ã騩 ¬ áèâ ¡
1284
		div ecx ;¤¥«¨¬ eax ­  ⥪ã騩 ¬ áèâ ¡
1343
		xchg eax,ebx
1285
		xchg eax,ebx
1344
		xor edx,edx
1286
		xor edx,edx
Line 1347... Line 1289...
1347
		sub ebx,eax ;¢ëç¨á«ï¥âáï ᤢ¨£ ¯®«ï ª®â®àë© ®¡¥á¯¥ç¨â 業â஢ªã ¯®«ï
1289
		sub ebx,eax ;¢ëç¨á«ï¥âáï ᤢ¨£ ¯®«ï ª®â®àë© ®¡¥á¯¥ç¨â 業â஢ªã ¯®«ï
1348
		sub dword[Cor_x],ebx ;ᤢ¨£ ¥¬ ¯®«¥ §à¥­¨ï ¯® ®á¨ x
1290
		sub dword[Cor_x],ebx ;ᤢ¨£ ¥¬ ¯®«¥ §à¥­¨ï ¯® ®á¨ x
1349
		xor ecx,ecx
1291
		xor ecx,ecx
1350
		mov cl,byte[zoom]
1292
		mov cl,byte[zoom]
1351
		xor edx,edx
1293
		xor edx,edx
1352
		mov eax,dword[buf_0.h]
1294
		mov eax,[buf_0.h]
1353
		shr eax,1
1295
		shr eax,1
1354
		mov ebx,eax
1296
		mov ebx,eax
1355
		div ecx
1297
		div ecx
1356
		xchg eax,ebx
1298
		xchg eax,ebx
1357
		xor edx,edx
1299
		xor edx,edx
Line 1386... Line 1328...
1386
		pushad
1328
		pushad
1387
		;¢ëç¨á«¥­¨¥ ᤢ¨£®¢ ¤«ï ¯®«ï, ª®â®àë¥ ®¡¥á¯¥ç â 業â஢ªã ¯®«ï ¯à¨ 㬥­ì襭¨¨ ¬ áèâ ¡ 
1329
		;¢ëç¨á«¥­¨¥ ᤢ¨£®¢ ¤«ï ¯®«ï, ª®â®àë¥ ®¡¥á¯¥ç â 業â஢ªã ¯®«ï ¯à¨ 㬥­ì襭¨¨ ¬ áèâ ¡ 
1388
		xor ecx,ecx
1330
		xor ecx,ecx
1389
		mov cl,byte[zoom]
1331
		mov cl,byte[zoom]
1390
		xor edx,edx
1332
		xor edx,edx
1391
		mov eax,dword[buf_0.w]
1333
		mov eax,[buf_0.w]
1392
		shr eax,1 ;¢ eax ¯®«®¢¨­  è¨à¨­ë ¯®«ï
1334
		shr eax,1 ;¢ eax ¯®«®¢¨­  è¨à¨­ë ¯®«ï
1393
		mov ebx,eax ;¤¥« ¥¬ १¥à¢­ãî ª®¯¨î eax
1335
		mov ebx,eax ;¤¥« ¥¬ १¥à¢­ãî ª®¯¨î eax
1394
		div ecx ;¤¥«¨¬ eax ­  ⥪ã騩 ¬ áèâ ¡
1336
		div ecx ;¤¥«¨¬ eax ­  ⥪ã騩 ¬ áèâ ¡
1395
		xchg eax,ebx
1337
		xchg eax,ebx
1396
		xor edx,edx
1338
		xor edx,edx
Line 1399... Line 1341...
1399
		sub ebx,eax ;¢ëç¨á«ï¥âáï ᤢ¨£ ¯®«ï ª®â®àë© ®¡¥á¯¥ç¨â 業â஢ªã ¯®«ï
1341
		sub ebx,eax ;¢ëç¨á«ï¥âáï ᤢ¨£ ¯®«ï ª®â®àë© ®¡¥á¯¥ç¨â 業â஢ªã ¯®«ï
1400
		sub dword[Cor_x],ebx ;ᤢ¨£ ¥¬ ¯®«¥ §à¥­¨ï ¯® ®á¨ x
1342
		sub dword[Cor_x],ebx ;ᤢ¨£ ¥¬ ¯®«¥ §à¥­¨ï ¯® ®á¨ x
1401
		xor ecx,ecx
1343
		xor ecx,ecx
1402
		mov cl,byte[zoom]
1344
		mov cl,byte[zoom]
1403
		xor edx,edx
1345
		xor edx,edx
1404
		mov eax,dword[buf_0.h]
1346
		mov eax,[buf_0.h]
1405
		shr eax,1
1347
		shr eax,1
1406
		mov ebx,eax
1348
		mov ebx,eax
1407
		div ecx
1349
		div ecx
1408
		xchg eax,ebx
1350
		xchg eax,ebx
1409
		xor edx,edx
1351
		xor edx,edx
Line 1432... Line 1374...
1432
	ret
1374
	ret
Line 1433... Line 1375...
1433
 
1375
 
1434
align 4
1376
align 4
1435
but_pole_up:
1377
but_pole_up:
1436
	push eax ecx edx
1378
	push eax ecx edx
1437
	mov eax,dword[buf_0.h]
1379
	mov eax,[buf_0.h]
1438
	shr eax,2
1380
	shr eax,2
1439
	xor ecx,ecx
1381
	xor ecx,ecx
1440
	mov cl,byte[zoom]
1382
	mov cl,byte[zoom]
1441
	cmp cx,2
1383
	cmp cx,2
Line 1451... Line 1393...
1451
	ret
1393
	ret
Line 1452... Line 1394...
1452
 
1394
 
1453
align 4
1395
align 4
1454
but_pole_dn:
1396
but_pole_dn:
1455
	push eax ecx edx
1397
	push eax ecx edx
1456
	mov eax,dword[buf_0.h]
1398
	mov eax,[buf_0.h]
1457
	shr eax,2
1399
	shr eax,2
1458
	xor ecx,ecx
1400
	xor ecx,ecx
1459
	mov cl,byte[zoom]
1401
	mov cl,byte[zoom]
1460
	cmp cx,2
1402
	cmp cx,2
Line 1470... Line 1412...
1470
	ret
1412
	ret
Line 1471... Line 1413...
1471
 
1413
 
1472
align 4
1414
align 4
1473
but_pole_left:
1415
but_pole_left:
1474
	push eax ecx edx
1416
	push eax ecx edx
1475
	mov eax,dword[buf_0.w]
1417
	mov eax,[buf_0.w]
1476
	shr eax,2
1418
	shr eax,2
1477
	xor ecx,ecx
1419
	xor ecx,ecx
1478
	mov cl,byte[zoom]
1420
	mov cl,byte[zoom]
1479
	cmp cx,2
1421
	cmp cx,2
Line 1489... Line 1431...
1489
	ret
1431
	ret
Line 1490... Line 1432...
1490
 
1432
 
1491
align 4
1433
align 4
1492
but_pole_right:
1434
but_pole_right:
1493
	push eax ecx edx
1435
	push eax ecx edx
1494
	mov eax,dword[buf_0.w]
1436
	mov eax,[buf_0.w]
1495
	shr eax,2
1437
	shr eax,2
1496
	xor ecx,ecx
1438
	xor ecx,ecx
1497
	mov cl,byte[zoom]
1439
	mov cl,byte[zoom]
1498
	cmp cx,2
1440
	cmp cx,2