2015-11-15 22:02:34 +01:00
|
|
|
|
;
; <EFBFBD>㭪<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> ᮧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
;
;color_s0 - ᨣ<EFBFBD><EFBFBD><EFBFBD> 0
;color_s1 - ᨣ<EFBFBD><EFBFBD><EFBFBD> 1
;color_s2 - <EFBFBD><EFBFBD>窠 <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD>
;color_s3 - <EFBFBD>६<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>࠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
size_sign equ 10
sign_x equ 0
sign_y equ 4
sign_a equ 8
sign_z equ 9
sign_data dd 0 ;㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>ᨢ <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ࠬ<EFBFBD> ᨣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
sign_count dd 0 ;⥪<EFBFBD><EFBFBD>. <EFBFBD><EFBFBD><EFBFBD>. ᨣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
sign_max dd 0 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <EFBFBD><EFBFBD><EFBFBD>. ᨣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
align 4
proc sign_init uses eax ecx, m_count:dword
mov ecx,[m_count]
mov [sign_max],ecx
imul ecx,size_sign
stdcall mem.Alloc, ecx
mov [sign_data],eax
call sign_clear
ret
endp
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD>⪠ <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
align 4
proc sign_clear uses eax ecx edi
xor eax,eax
mov dword[time],eax
mov dword[sign_count],eax
mov ecx,[sign_max]
imul ecx,size_sign
mov edi,[sign_data]
cld
rep stosb
ret
endp
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD>⪠ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
align 4
proc sign_clear_one uses ecx edi esi, p_sign:dword
mov ecx,size_sign
mov esi,[sign_count]
dec esi
imul esi,ecx
add esi,[sign_data]
mov edi,[p_sign]
cld
rep movsb
dec dword[sign_count]
ret
endp
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>⮩ <EFBFBD><EFBFBD><EFBFBD>ᨢ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> ᨣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
align 4
proc sign_delete
stdcall mem.Free, dword[sign_data]
ret
endp
;<EFBFBD>㭪<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>६<EFBFBD>饭<EFBFBD><EFBFBD> ᨣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
align 4
proc sign_move
pushad
mov ecx,[sign_count]
cmp ecx,1
jl .end_f
mov esi,ecx
dec esi
imul esi,size_sign
add esi,[sign_data]
;cld
.cycle_beg:
mov eax,[esi+sign_x]
mov ebx,[esi+sign_y]
movzx edi,byte[esi+sign_a]
movzx edx,byte[esi+sign_z]
cmp edx,0
je @f
or edi,0x100
@@:
;<EFBFBD><EFBFBD>⠥<EFBFBD><EFBFBD><EFBFBD> ᮧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<EFBFBD><EFBFBD>⢫<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
stdcall move_rotate_n90, 0,-1,edi
inc edi
stdcall sign_creat,eax,ebx,edi
stdcall move_rotate_n90, -2,0,edi
add edi,2
stdcall sign_creat,eax,ebx,edi
mov eax,[esi+sign_x]
mov ebx,[esi+sign_y]
inc edi
mov eax,[esi+sign_x]
mov ebx,[esi+sign_y]
shl edx,2
add edx,shem_colors
stdcall draw_signal_rect, eax,ebx, dword[edx] ;<EFBFBD><EFBFBD><EFBFBD>㥬 ᨣ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
.move_1:
stdcall move_rotate_x_n90, 1,edi
mov edi,eax
stdcall pole_cell_find, pole, edi,ebx
cmp eax,0
jne @f
stdcall sign_clear_one,esi ;㤠<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>襫 <EFBFBD> <EFBFBD>㯨<EFBFBD>
jmp .cycle_next
@@:
imul eax,sizeof.Cell
add eax,dword[cell]
movzx edx,byte[esi+sign_z]
cmp byte[eax+offs_cell_liv],2
jne @f
;<EFBFBD> <EFBFBD>⮨<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov eax,edi
movzx edi,byte[esi+sign_a]
jmp .move_1
@@:
cmp byte[eax+offs_cell_liv],dl
jne @f
stdcall sign_clear_one,esi ;㤠<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>襭<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 梥⮬
jmp .cycle_next
@@:
mov byte[eax+offs_cell_liv],dl ;<EFBFBD>⠢<EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov [esi+sign_x],edi
mov [esi+sign_y],ebx
.cycle_next:
sub esi,size_sign
;loop .cycle_beg
dec ecx
jnz .cycle_beg
;stdcall [buf2d_draw], buf_0
.end_f:
popad
ret
endp
align 4
proc sign_creat coord_x:dword, coord_y:dword, opt:dword
pushad
mov edi,[sign_count]
cmp edi,[sign_max]
jge .end_f
mov esi,[coord_x]
mov ebx,[coord_y]
.found:
stdcall pole_cell_find, pole, esi,ebx
cmp eax,0
je .end_f
mov ecx,[opt]
get_cell_offset edx,eax
cmp byte[edx+offs_cell_liv],2
jne @f
mov eax,esi
stdcall move_rotate_x_n90,1,ecx
mov esi,eax
jmp .found
@@:
cmp ch,byte[edx+offs_cell_liv] ;<EFBFBD><EFBFBD><EFBFBD>塞 <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
je .end_f
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>⠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>⪨ <EFBFBD> <EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>㡫<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ப<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
imul edi,size_sign
add edi,[sign_data]
mov [edi+sign_x],esi
mov [edi+sign_y],ebx
mov [edi+sign_a],cl
mov [edi+sign_z],ch
inc dword[sign_count]
mov [edx+offs_cell_liv],ch ;<EFBFBD>⠢<EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
;stdcall draw_signal_rect, [coord_x],[coord_y], 0x800080
.end_f:
popad
ret
endp
;description:
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>㭪<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ᮢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD>奬<EFBFBD>
align 4
proc draw_signal_rect uses eax ebx edi, x0:dword,y0:dword, color:dword
movzx edi,byte[zoom]
mov ebx,[y0]
mov eax,[x0]
add ebx,[Cor_y]
imul ebx,edi
add eax,[Cor_x]
imul eax,edi
stdcall [buf2d_filled_rect_by_size], buf_0, eax,ebx,edi,edi, dword[color]
ret
endp
align 4
proc sign_from_elems
locals
s_inp dd ?
n_leg dd ?
endl
pushad
mov edi,pole
;*** ᮧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᨣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᪨<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⮢ ***
stdcall dword[tl_node_p
|