update 'buf2d.obj' and 'nu pogodi'

git-svn-id: svn://kolibrios.org@1538 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2010-07-30 17:42:39 +00:00
parent 2462a14655
commit 0c189bcb2f
3 changed files with 288 additions and 40 deletions

View File

@ -62,7 +62,7 @@ table { font-size: 15px; }
С ее помощьью можно создавать буфера с изображениями в памяти, и при необходимости выводить их на экран.
Изображения можно накладывать одно на другое, поддерживается работа с прозрачными изображениями, есть функция рисования лини пока на этом все.</p>
<p>Последнее обновление библиотеки 29.07.10.</p>
<p>Последнее обновление библиотеки 30.07.10.</p>
<h1><a name="f_buf">Форматы буферов</a></h1>
<p>Поддерживается 3 формата буферов.
@ -178,6 +178,8 @@ stdcall [buf2d_convert_text_matrix], buf_1</pre>
<h1><a name="const">Константы</a></h1>
<h4>BUF2D_OPT_CROP_TOP equ 1</h4>
<p>Константа для функции buf2d_crop_color, обозначает обрезку буфера сверху</p>
<h4>BUF2D_OPT_CROP_LEFT equ 2</h4>
<p>Константа для функции buf2d_crop_color, обозначает обрезку буфера слева</p>
<h4>BUF2D_OPT_CROP_BOTTOM equ 4</h4>
<p>Константа для функции buf2d_crop_color, обозначает обрезку буфера снизу</p>
<h4>BUF2D_OPT_CROP_RIGHT equ 8</h4>

View File

@ -15,6 +15,7 @@ BUF_STRUCT_SIZE equ 21
buf2d_data equ dword[edi] ;¤ ­­ë¥ ¡ãä¥à  ¨§®¡à ¦¥­¨ï
buf2d_w equ dword[edi+8] ;è¨à¨­  ¡ãä¥à 
buf2d_h equ dword[edi+12] ;¢ëá®â  ¡ãä¥à 
buf2d_l equ word[edi+4]
buf2d_t equ word[edi+6] ;®âáâ㯠ᢥàåã
buf2d_size_lt equ dword[edi+4] ;®âáâ㯠᫥¢  ¨ á¯à ¢  ¤«ï ¡ãä¥à 
buf2d_color equ dword[edi+16] ;梥â ä®­  ¡ãä¥à 
@ -196,8 +197,14 @@ proc buf_clear, buf_struc:dword, color:dword ;
ret
endp
;äã­ªæ¨ï ¤«ï ®¡à¥§ ­¨ï ¡ãä¥à®¢ 8 ¨ 24 ¡¨â­ëå, ¯® § ¤ ­®¬ã 梥âã.
;¯ à ¬¥âà opt § ¤ ¥âáï ª®¬¡¨­ æ¨¥© ª®­áâ ­â:
; BUF2D_OPT_CROP_TOP - ®¡à¥§ª  ᢥàåã
; BUF2D_OPT_CROP_LEFT - ®¡à¥§ª  á«¥¢ 
; BUF2D_OPT_CROP_BOTTOM - ®¡à¥§ª  á­¨§ã
; BUF2D_OPT_CROP_RIGHT - ®¡à¥§ª  á¯à ¢ 
align 4
proc buf_crop_color, buf_struc:dword, color:dword, opt:dword ;®¡à¥§ª  ¡ãä¥à  ¯® § ¤ ­®¬ã 梥⮬ 梥âã
proc buf_crop_color, buf_struc:dword, color:dword, opt:dword
locals
crop_r dd ?
endl
@ -305,14 +312,14 @@ endl
add esi,buf2d_data ;esi - 㪠§ â¥«ì ­  ª®­¥æ ¡ãä¥à  ¨§®¡à ¦¥­¨ï
mov dword[crop_r],0
cld
.found_beg:
.24found_beg_right:
sub esi,3 ;¤¢¨£ ¥¬áï ­  1-­ã ª®«®­ªã ¢«¥¢®
mov ecx,buf2d_h ;¢®ááâ ­®¢«¥­¨¥ ecx ¤«ï ­®¢®£® 横« 
@@:
cmp word[esi],ax
jne .found
jne .24found_right
cmp byte[esi+2],dl
jne .found
jne .24found_right
sub esi,ebx ;¯à룠¥¬ ­  ¢¥àå­îî áâபã
loop @b
inc dword[crop_r]
@ -320,30 +327,30 @@ endl
mov ecx,buf2d_w
dec ecx ;1 ª®«®­ª  ­  § ¯ á
cmp dword[crop_r],ecx
jge .found
jge .24found_right
sub esi,3 ;¤¢¨£ ¥¬áï ­  1-­ã ª®«®­ªã ¢«¥¢®
mov ecx,buf2d_h ;¢®ááâ ­®¢«¥­¨¥ ecx ¤«ï ­®¢®£® 横« 
@@:
add esi,ebx ;¯à룠¥¬ ­  ­¨¦­îî áâபã
cmp word[esi],ax
jne .found
jne .24found_right
cmp byte[esi+2],dl
jne .found
jne .24found_right
loop @b
inc dword[crop_r]
mov ecx,buf2d_w
dec ecx ;1 ª®«®­ª  ­  § ¯ á
cmp dword[crop_r],ecx
jl .found_beg
jl .24found_beg_right
.found:
.24found_right:
cmp dword[crop_r],0
je .24no_crop_right
mov ecx,buf2d_w
sub ecx,dword[crop_r]
stdcall img_rgb_wcrop, buf2d_data, buf2d_w, ecx, buf2d_h ;®¡à¥§ ¥¬ ¡ãä¥à, ¯® ­®¢®¬ã à §¬¥àã
stdcall img_rgb_crop_r, buf2d_data, buf2d_w, ecx, buf2d_h ;®¡à¥§ ¥¬ ¡ãä¥à, ¯® ­®¢®¬ã à §¬¥àã
mov buf2d_w,ecx ;áâ ¢¨¬ ­®¢ãî è¨à¨­ã ¤«ï ¡ãä¥à 
mov ebx,buf2d_h
imul ecx,ebx
@ -352,6 +359,66 @@ endl
mov buf2d_data,eax ;­  á«ãç © ¥á«¨ ¨§¬¥­¨«áï 㪠§ â¥«ì ­  ¤ ­­ë¥
.24no_crop_right:
bt dword[opt],BUF2D_BIT_OPT_CROP_LEFT
jae .24no_crop_left
mov eax,dword[color]
mov edx,eax ;ax = colors - r,g
shr edx,16 ;dl = color - b
mov ebx,buf2d_w
lea ebx,[ebx+ebx*2]
mov esi,buf2d_data ;esi - 㪠§ â¥«ì ­  ­ ç®«® ¡ãä¥à  ¨§®¡à ¦¥­¨ï
mov dword[crop_r],0
cld
.24found_beg_left:
mov ecx,buf2d_h ;¢®ááâ ­®¢«¥­¨¥ ecx ¤«ï ­®¢®£® 横« 
@@:
cmp word[esi],ax
jne .24found_left
cmp byte[esi+2],dl
jne .24found_left
add esi,ebx ;¯à룠¥¬ ­  ­¨¦­îî áâபã
loop @b
inc dword[crop_r]
add esi,3 ;¤¢¨£ ¥¬áï ­  1-­ã ª®«®­ªã ¢¯à ¢®
mov ecx,buf2d_w
dec ecx ;1 ª®«®­ª  ­  § ¯ á
cmp dword[crop_r],ecx
jge .24found_left
mov ecx,buf2d_h ;¢®ááâ ­®¢«¥­¨¥ ecx ¤«ï ­®¢®£® 横« 
@@:
sub esi,ebx ;¯à룠¥¬ ­  ¢¥àå­îî áâபã
cmp word[esi],ax
jne .24found_left
cmp byte[esi+2],dl
jne .24found_left
loop @b
inc dword[crop_r]
add esi,3 ;¤¢¨£ ¥¬áï ­  1-­ã ª®«®­ªã ¢¯à ¢®
mov ecx,buf2d_w
dec ecx ;1 ª®«®­ª  ­  § ¯ á
cmp dword[crop_r],ecx
jl .24found_beg_left
.24found_left:
cmp dword[crop_r],0
je .24no_crop_left
mov ecx,buf2d_w
sub ecx,dword[crop_r]
stdcall img_rgb_crop_l, buf2d_data, buf2d_w, ecx, buf2d_h ;®¡à¥§ ¥¬ ¡ãä¥à, ¯® ­®¢®¬ã à §¬¥àã
mov buf2d_w,ecx ;áâ ¢¨¬ ­®¢ãî è¨à¨­ã ¤«ï ¡ãä¥à 
mov ebx,buf2d_h
imul ecx,ebx
lea ecx,[ecx+ecx*2]
invoke mem.realloc,buf2d_data,ecx
mov buf2d_data,eax ;­  á«ãç © ¥á«¨ ¨§¬¥­¨«áï 㪠§ â¥«ì ­  ¤ ­­ë¥
mov eax,dword[crop_r]
add buf2d_l,ax
.24no_crop_left:
.24end_f:
@ -479,7 +546,7 @@ endl
je .8no_crop_right
mov ecx,buf2d_w
sub ecx,edx
stdcall img_gray_wcrop, buf2d_data, buf2d_w, ecx, buf2d_h ;®¡à¥§ ¥¬ ¡ãä¥à, ¯® ­®¢®¬ã à §¬¥àã
stdcall img_gray_crop_r, buf2d_data, buf2d_w, ecx, buf2d_h ;®¡à¥§ ¥¬ ¡ãä¥à, ¯® ­®¢®¬ã à §¬¥àã
mov buf2d_w,ecx ;áâ ¢¨¬ ­®¢ãî è¨à¨­ã ¤«ï ¡ãä¥à 
mov ebx,buf2d_h
imul ecx,ebx
@ -487,19 +554,72 @@ endl
mov buf2d_data,eax ;­  á«ãç © ¥á«¨ ¨§¬¥­¨«áï 㪠§ â¥«ì ­  ¤ ­­ë¥
.8no_crop_right:
bt dword[opt],BUF2D_BIT_OPT_CROP_LEFT
jae .8no_crop_left
mov eax,dword[color]
mov ebx,buf2d_w
mov esi,buf2d_data ;esi - 㪠§ â¥«ì ­  ­ ç®«® ¡ãä¥à  ¨§®¡à ¦¥­¨ï
mov edx,0
cld
.8found_beg_left:
mov ecx,buf2d_h ;¢®ááâ ­®¢«¥­¨¥ ecx ¤«ï ­®¢®£® 横« 
@@:
cmp word[esi],ax
jne .8found_left
add esi,ebx ;¯à룠¥¬ ­  ­¨¦­îî áâபã
loop @b
inc edx
inc esi ;¤¢¨£ ¥¬áï ­  1-­ã ª®«®­ªã ¢¯à ¢®
mov ecx,buf2d_w
dec ecx ;1 ª®«®­ª  ­  § ¯ á
cmp edx,ecx
jge .8found_left
mov ecx,buf2d_h ;¢®ááâ ­®¢«¥­¨¥ ecx ¤«ï ­®¢®£® 横« 
@@:
sub esi,ebx ;¯à룠¥¬ ­  ¢¥àå­îî áâபã
cmp word[esi],ax
jne .8found_left
loop @b
inc edx
inc esi ;¤¢¨£ ¥¬áï ­  1-­ã ª®«®­ªã ¢¯à ¢®
mov ecx,buf2d_w
dec ecx ;1 ª®«®­ª  ­  § ¯ á
cmp edx,ecx
jl .8found_beg_left
.8found_left:
cmp edx,0
je .8no_crop_left
mov ecx,buf2d_w
sub ecx,edx
stdcall img_gray_crop_l, buf2d_data, buf2d_w, ecx, buf2d_h ;®¡à¥§ ¥¬ ¡ãä¥à, ¯® ­®¢®¬ã à §¬¥àã
mov buf2d_w,ecx ;áâ ¢¨¬ ­®¢ãî è¨à¨­ã ¤«ï ¡ãä¥à 
mov ebx,buf2d_h
imul ecx,ebx
invoke mem.realloc,buf2d_data,ecx
mov buf2d_data,eax ;­  á«ãç © ¥á«¨ ¨§¬¥­¨«áï 㪠§ â¥«ì ­  ¤ ­­ë¥
mov eax,edx
add buf2d_l,ax
.8no_crop_left:
.8end_f:
popad
ret
endp
;®¡à¥§ ¥¬ 梥⭮¥ ¨§®¡à ¦¥­¨¥ á ¯à ¢®© áâ®à®­ë
;input:
;data_rgb - pointer to rgb data
;size_w_old - width img in pixels
;size_w_new - new width img in pixels
;size_h - height img in pixels
align 4
proc img_rgb_wcrop, data_rgb:dword, size_w_old:dword, size_w_new:dword, size_h:dword
proc img_rgb_crop_r, data_rgb:dword, size_w_old:dword, size_w_new:dword, size_h:dword
pushad
mov eax, dword[size_w_old]
lea eax, dword[eax+eax*2] ;eax = width(old) * 3(rgb)
@ -525,13 +645,14 @@ proc img_rgb_wcrop, data_rgb:dword, size_w_old:dword, size_w_new:dword, size_h:d
ret
endp
;®¡à¥§ ¥¬ á¥à®¥ ¨§®¡à ¦¥­¨¥ á ¯à ¢®© áâ®à®­ë
;input:
;data_gray - pointer to gray data
;size_w_old - width img in pixels
;size_w_new - new width img in pixels
;size_h - height img in pixels
align 4
proc img_gray_wcrop, data_gray:dword, size_w_old:dword, size_w_new:dword, size_h:dword
proc img_gray_crop_r, data_gray:dword, size_w_old:dword, size_w_new:dword, size_h:dword
pushad
mov eax, dword[size_w_old]
mov ebx, dword[size_w_new]
@ -555,6 +676,68 @@ proc img_gray_wcrop, data_gray:dword, size_w_old:dword, size_w_new:dword, size_h
ret
endp
;®¡à¥§ ¥¬ 梥⭮¥ ¨§®¡à ¦¥­¨¥ á «¥¢®© áâ®à®­ë
;input:
;data_rgb - pointer to rgb data
;size_w_old - width img in pixels
;size_w_new - new width img in pixels
;size_h - height img in pixels
align 4
proc img_rgb_crop_l, data_rgb:dword, size_w_old:dword, size_w_new:dword, size_h:dword
pushad
mov edi,dword[data_rgb]
mov esi,edi
mov eax,dword[size_w_old]
mov ebx,dword[size_w_new]
cmp eax,ebx
jle .end_f ;áâ àë© à §¬¥à ¨§®¡à ¦¥­¨ï ­¥ ¬®¦¥â ¡ëâì ¬¥­ìè¥ ­®¢®£® (¯à¨ ãá«®¢¨¨ ®¡à¥§ ­¨ï ª à⨭ª¨)
lea eax,[eax+eax*2]
lea ebx,[ebx+ebx*2]
sub eax,ebx
mov edx,dword[size_h] ;¢ëá®â  ¨§®¡à ¦¥­¨ï
cld
@@:
add esi,eax
mov ecx,ebx
rep movsb
dec edx
cmp edx,0
jg @b
.end_f:
popad
ret
endp
;®¡à¥§ ¥¬ á¥à®¥ ¨§®¡à ¦¥­¨¥ á «¥¢®© áâ®à®­ë
;input:
;data_gray - pointer to gray data
;size_w_old - width img in pixels
;size_w_new - new width img in pixels
;size_h - height img in pixels
align 4
proc img_gray_crop_l, data_gray:dword, size_w_old:dword, size_w_new:dword, size_h:dword
pushad
mov edi,dword[data_gray]
mov esi,edi
mov eax,dword[size_w_old]
mov ebx,dword[size_w_new]
cmp eax,ebx
jle .end_f ;áâ àë© à §¬¥à ¨§®¡à ¦¥­¨ï ­¥ ¬®¦¥â ¡ëâì ¬¥­ìè¥ ­®¢®£® (¯à¨ ãá«®¢¨¨ ®¡à¥§ ­¨ï ª à⨭ª¨)
sub eax,ebx
mov edx,dword[size_h] ;¢ëá®â  ¨§®¡à ¦¥­¨ï
cld
@@:
add esi,eax
mov ecx,ebx
rep movsb
dec edx
cmp edx,0
jg @b
.end_f:
popad
ret
endp
;hoffs - ª®««¨ç¥á⢮ ¯¨ªá¥«¥© ­  ª®âàë¥ ¯®¤­¨¬ ¥âáï/®¯ã᪠¥âáï ¨§®¡à ¦¥­¨¥
;img_t - ¢ëá®â , á ª®â®à®© ­ ç¨­ ¥âáï ¤¢¨£ îé ïáï ç áâì ¨§®¡à ¦¥­¨ï
align 4
@ -888,20 +1071,20 @@ proc img_rgb24_wdiv2 data_rgb:dword, size:dword
lea ecx,[ecx+ecx*2]
cld
@@: ;§ â¥¬­¥­¨¥ æ¢¥â  ¯¨ªá¥«¥©
shr byte[eax],1
inc eax
loop @b
shr byte[eax],1
inc eax
loop @b
mov eax,dword[data_rgb]
mov ecx,dword[size] ;ecx = size
shr ecx,1
@@: ;á«®¦¥­¨¥ 梥⮢ ¯¨ªá¥«¥©
mov bx,word[eax+3] ;ª®¯¨à㥬 梥â á®á¥¤­¥£® ¯¨ªá¥«ï
add word[eax],bx
mov bl,byte[eax+5] ;ª®¯¨à㥬 梥â á®á¥¤­¥£® ¯¨ªá¥«ï
add byte[eax+2],bl
add eax,6 ;=2*3
loop @b
mov bx,word[eax+3] ;ª®¯¨à㥬 梥â á®á¥¤­¥£® ¯¨ªá¥«ï
add word[eax],bx
mov bl,byte[eax+5] ;ª®¯¨à㥬 梥â á®á¥¤­¥£® ¯¨ªá¥«ï
add byte[eax+2],bl
add eax,6 ;=2*3
loop @b
mov eax,dword[data_rgb]
add eax,3
@ -911,14 +1094,14 @@ proc img_rgb24_wdiv2 data_rgb:dword, size:dword
shr ecx,1
dec ecx ;«¨è­¨© ¯¨ªá¥«ì
@@: ;¯®¤¦ â¨¥ ¯¨ªá¥«¥©
mov edx,dword[ebx]
mov word[eax],dx
shr edx,16
mov byte[eax+2],dl
mov edx,dword[ebx]
mov word[eax],dx
shr edx,16
mov byte[eax+2],dl
add eax,3
add ebx,6
loop @b
add eax,3
add ebx,6
loop @b
;pop edx ecx ebx eax
ret
endp

View File

@ -31,8 +31,8 @@ BUF_STRUCT_SIZE equ 21
buf2d_data equ dword[edi] ;¤ ­­ë¥ ¡ãä¥à  ¨§®¡à ¦¥­¨ï
buf2d_w equ dword[edi+8] ;è¨à¨­  ¡ãä¥à 
buf2d_h equ dword[edi+12] ;¢ëá®â  ¡ãä¥à 
buf2d_t equ word[edi+6] ;®âáâ㯠ᢥàåã
buf2d_l equ word[edi+4] ;®âáâ㯠᫥¢ 
buf2d_t equ word[edi+6] ;®âáâ㯠ᢥàåã
buf2d_size_lt equ dword[edi+4] ;®âáâ㯠᫥¢  ¨ á¯à ¢  ¤«ï ¡ãä¥à 
buf2d_color equ dword[edi+16] ;梥â ä®­  ¡ãä¥à 
buf2d_bits equ byte[edi+20] ;ª®«¨ç¥á⢮ ¡¨â ¢ 1-© â®çª¥ ¨§®¡à ¦¥­¨ï
@ -54,12 +54,23 @@ OFFS_SHADOW_X equ 2 ;ᤢ
OFFS_SHADOW_Y equ 2 ;ᤢ¨£ ⥭¥© ¯® ®á¨ 'y'
IMAGE_FONT_SIZE equ 128*144*3
use_but equ 1
if use_but eq 1
BUT1_T equ 10 ;®âáâ㯠ᢥàåã
BUT1_L equ 15 ;®âáâ㯠᫥¢ 
BUT1_W equ 50 ;è¨à¨­ 
BUT1_H equ 20 ;¢ëá®â 
BUT1_NEXT_TOP equ (BUT1_T+BUT1_H)*65536
end if
fn_icon0 db 'curici.png',0 ;¨¬ï ä ©«  á ¤¥ª®à æ¨ï¬¨
fn_icon1 db 'wolf.png',0 ;¨¬ï ä ©«  á ¢®«ª®¬ ¨ § ©æ¥¬
fn_icon2 db 'eggs.png',0 ;¨¬ï ä ©«  á ï©æ ¬¨
fn_icon3 db 'chi.png',0 ;¨¬ï ä ©«  á 樯«ïâ ¬¨
fn_font db 'font8x9.bmp',0
;æ¢¥â  ¢ ¨£à¥
color_fon dd 0xffffff
color_shadows dd 0xd0d0d0 ;梥â ⥭¥©
color_trees dd 0x008000 ;梥â âà ¢ë
@ -68,6 +79,9 @@ color_egg dd 0x404080 ;梥
color_chick dd 0x00d0d0 ;梥â 樯«¥­ª 
color_curici dd 0x8080d0 ;梥⠪ãà¨æë
color_perilo dd 0x000080 ;梥⠯¥à¨«  (£à¥¡­ï)
;æ¢¥â  ¨­â¥à䥩á 
color_but_sm dd 0x808080 ;梥⠬ «¥­ìª¨å ª­®¯®ª
color_but_bi dd 0x8080ff ;梥⠡®«ìè¨å ª­®¯®ª
macro load_image_file path,buf,size { ;¬ ªà®á ¤«ï § £à㧪¨ ¨§®¡à ¦¥­¨©
stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥­¨ï
@ -113,7 +127,10 @@ mask_chi_cr_l equ 1000000000000000000000b ;
mask_chi_cr_r equ 1000000000000000000000000000b ;¬ áª  ¤«ï ᮧ¤ ­¨ï ¯à ¢®£®
bit_chi_left equ 21 ;1-© ¡¨â ª®â®àë© ®â¢¥ç ¥â §  ¡¥£ã饣® á«¥¢ 
bit_chi_right equ 27 ;1-© ¡¨â ª®â®àë© ®â¢¥ç ¥â §  ¡¥£ã饣® ¯à ¢ 
val_zaac_time_y equ 5 ;ª®««¨ç¥á⢮ ⠪⮢, ª®â®à®¥ ®¡ï§ â¥«ì­® ¤®«¦¥­ ¯à®¢¨á¥âì § ïæ
val_zaac_time_n equ 7 ;ª®««¨ç¥á⢮ ⠪⮢, ª®â®à®¥ ®¡ï§ â¥«ì­® ¤®«¦¥­ ¡ëâì á¯àïâ ­­ë¬ § ïæ
zaac_status db 0
pos_wolf db 0 ;¯®§¨æ¨ï ¢®«ª  0-© ¡¨â á«¥¢ /á¯à ¢ , 1-© ¡¨â ᢥàåã/¢­¨§
;rb 1
pos_eggs dd 0 ;¯®§¨æ¨¨ à á¯®«®¦¥­¨ï ï¨æ ¨ 樯«ïâ
@ -149,7 +166,8 @@ proc CreateTrapharetBuffer, buf:dword, img_data:dword
mov edi,dword[buf]
stdcall [buf2d_create_f_img], edi,[img_data] ;ᮧ¤ ¥¬ ¡ãä¥à
stdcall [buf2d_conv_24_to_8], edi,1 ;¤¥« ¥¬ ¡ãä¥à ¯à®§à ç­®á⨠8¡¨â
stdcall [buf2d_crop_color], edi,buf2d_color,BUF2D_OPT_CROP_TOP+BUF2D_OPT_CROP_BOTTOM+BUF2D_OPT_CROP_RIGHT
;®¡à¥§ ¥¬ «¨è­¨¥ ªà ï ¡ãä¥à , ¤«ï ¡®«¥¥ ¡ëáâண® à¨á®¢ ­¨ï
stdcall [buf2d_crop_color], edi,buf2d_color,BUF2D_OPT_CROP_TOP+BUF2D_OPT_CROP_BOTTOM+BUF2D_OPT_CROP_RIGHT+BUF2D_OPT_CROP_LEFT
pop edi
ret
endp
@ -444,14 +462,23 @@ MoveEggs:
and dword[pos_eggs],mask_clear_all ;®ç¨á⪠ 㯠¢è¨å ï¨æ ¨ ¤®¡¥¦ ¢è¨å ªã३
call rand_next
bt dword[rand_x],6
jc @f
bt dword[rand_x],8
jc @f
bt dword[rand_x],9
cmp byte[zaac_status],0
jle @f
dec byte[zaac_status]
jmp .no_zaac_move ;§ ïæ ¯®ª  ­¥ ¤¢¨£ ¥âáï
@@:
bt dword[rand_x],6 ;§ ïæ ®â ä®­ àï ¬¥­ï¥â áâ âãá
jc @f
xor byte[pos_wolf],val_zaac ;¢ëᮢ뢠¥¬/§ á®¢ë¢ ¥¬ § ©æ 
bt word[pos_wolf],val_zaac
jc .zaac_n
mov byte[zaac_status],val_zaac_time_y ;áâ ¢¨¬ ¬¨­¨¬ «ì­®¥ ¢à¥¬ï ¤«ï ᬥ­ë áâ âãá 
jmp @f
.zaac_n:
mov byte[zaac_status],val_zaac_time_n ;áâ ¢¨¬ ¬¨­¨¬ «ì­®¥ ¢à¥¬ï ¤«ï ᬥ­ë áâ âãá 
@@:
.no_zaac_move:
;ᮧ¤ ­¨¥ ­®¢ëå ï¨æ
bt dword[rand_x],4 ;¯à®¢¥à塞 ¡ã¤¥¬ «¨ ᮧ¤ ¢ âì ­®¢®¥ ï©æ®
@ -486,6 +513,7 @@ proc InitGame, b:dword ;
mov byte[some_text+1],0 ;⥪áâ á ç¨á«®¬ ¯®©¬ ­­ëå ï¨æ
mov byte[count_last],0
mov dword[pos_eggs],0
mov byte[zaac_status],0
cmp dword[b],0
jne @f
@ -697,8 +725,8 @@ draw_window:
mcall 12,1
xor eax,eax
mov ebx,20*65536+370
mov ecx,20*65536+280
mov ebx,20*65536+480
mov ecx,20*65536+270
mov edx,[sc.work]
;or edx,0x33000000
or edx,0x73000000
@ -739,6 +767,32 @@ draw_window:
inc esi
.draw_s:
if use_but eq 1
; *** à¨á®¢ ­¨¥ ª­®¯®ª ***
push esi
mov eax,8
xor ebx,ebx
mov bx,buf2d_l
add ebx,buf2d_w
add ebx,BUT1_L
shl ebx,16
mov bx,BUT1_W
mov ecx,BUT1_T*65536+BUT1_H
mov edx,5
;or edx,0x40000000
mov esi,dword[color_but_sm]
int 0x40
inc edx
add ecx,BUT1_NEXT_TOP
int 0x40
pop esi
; *** ¢®ááâ ­®¢«¥­¨¥ ¯ à ¬¥â஢ ***
mov eax,13 ;à¨á®¢ ­¨¥ ¯àאַ㣮«ì­¨ª 
mov edx,[sc.work]
end if
mov ebx,esi
mov ecx,dword[procinfo.client_box.height]
inc ecx
@ -785,6 +839,15 @@ draw_display:
align 4
button:
mcall 17 ;¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨
if use_but eq 1
cmp ah,5
jne @f
stdcall InitGame,0
@@:
cmp ah,6
jne @f
stdcall InitGame,1
@@: end if
cmp ah,1
jne still
.exit:
@ -887,7 +950,7 @@ image_data dd 0 ;
image_data_gray dd 0 ;¯ ¬ïâì á ¢à¥¬¥­­ë¬¨ á¥à묨 ¨§®¡à ¦¥­¨ï¬¨ ¢ ä®à¬ â¥ 24-bit, ¨§ ª®â®àëå ¡ã¤ãâ ᮧ¤ ¢ âìáï âà ä à¥âë
run_file_70 FileInfoBlock
hed db 'Nu pogodi 29.07.10',0 ;¯®¤¯¨áì ®ª­ 
hed db 'Nu pogodi 30.07.10',0 ;¯®¤¯¨áì ®ª­ 
sc system_colors ;á¨á⥬­ë¥ 梥â 
align 4