Nu pogodi: new options in the configuration file

git-svn-id: svn://kolibrios.org@1577 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2010-08-22 20:42:46 +00:00
parent e2eede0de5
commit c9ef71b8bc
2 changed files with 38 additions and 9 deletions

View File

@ -66,10 +66,11 @@ FILE_NAME_MAX equ 20 ;
;§­ ç¥­¨ï ¨¬¥­ ¯® 㬮«ç ­¨î ;§­ ç¥­¨ï ¨¬¥­ ¯® 㬮«ç ­¨î
ini_def_decorat_file db 'curici.png',0 ini_def_decorat_file db 'curici.png',0
ini_def_unit_file db 'wolf.png',0 ini_def_unit_file db 'wolf.png',0
ini_def_objects_file db 'eggs.png',0
;¨¬¥­  ä ©«®¢ ;¨¬¥­  ä ©«®¢
fn_icon0 rb FILE_NAME_MAX ;¨¬ï ä ©«  á ¤¥ª®à æ¨ï¬¨ fn_icon0 rb FILE_NAME_MAX ;¨¬ï ä ©«  á ¤¥ª®à æ¨ï¬¨
fn_icon1 rb FILE_NAME_MAX ;¨¬ï ä ©«  á ¢®«ª®¬ ¨ § ©æ¥¬ fn_icon1 rb FILE_NAME_MAX ;¨¬ï ä ©«  á ¢®«ª®¬ ¨ § ©æ¥¬
fn_icon2 db 'eggs.png',0 ;¨¬ï ä ©«  á ï©æ ¬¨ fn_icon2 rb FILE_NAME_MAX ;¨¬ï ä ©«  á ï©æ ¬¨
fn_icon3 db 'chi.png',0 ;¨¬ï ä ©«  á 樯«ïâ ¬¨ fn_icon3 db 'chi.png',0 ;¨¬ï ä ©«  á 樯«ïâ ¬¨
fn_font db 'font8x9.bmp',0 fn_font db 'font8x9.bmp',0
@ -77,11 +78,17 @@ ini_name db 'nu_pogod.ini',0
ini_sec_files db 'Files',0 ini_sec_files db 'Files',0
key_file_decorat db 'file_decorat',0 key_file_decorat db 'file_decorat',0
key_file_unit db 'file_unit',0 key_file_unit db 'file_unit',0
key_file_objects db 'file_objects',0
key_displ_w db 'displ_w',0 key_displ_w db 'displ_w',0
key_displ_h db 'displ_h',0 key_displ_h db 'displ_h',0
key_shadow_x db 'offs_shadow_x',0 key_shadow_x db 'offs_shadow_x',0
key_shadow_y db 'offs_shadow_y',0 key_shadow_y db 'offs_shadow_y',0
ini_sec_game db 'Game',0
key_delay_a db 'delay_a',0
key_delay_b db 'delay_b',0
key_delay_min db 'delay_min',0
ini_sec_color db 'Colors',0 ini_sec_color db 'Colors',0
;ª«îç¨ ¤«ï áç¨â뢠­¨ï 梥⮢ ¨§ *.ini ä ©«  ;ª«îç¨ ¤«ï áç¨â뢠­¨ï 梥⮢ ¨§ *.ini ä ©« 
key_color_fon db 'background',0 key_color_fon db 'background',0
@ -166,6 +173,9 @@ some_text db '0'
rb 8 ;⥪áâ á ç¨á«®¬ ¯®©¬ ­­ëå ï¨æ rb 8 ;⥪áâ á ç¨á«®¬ ¯®©¬ ­­ëå ï¨æ
count_last db 0 ;áç¥â稪 ¯à®¯ã饭­ëå ï¨æ count_last db 0 ;áç¥â稪 ¯à®¯ã饭­ëå ï¨æ
game_spd dd 0 ;§ ¤¥à¦ª  ¨£àë game_spd dd 0 ;§ ¤¥à¦ª  ¨£àë
game_delay_a dd ? ;¯¥à¢®­ ç «ì­ ï § ¤¥à¦ª  ¤«ï ¨£àë €
game_delay_b dd ? ;¯¥à¢®­ ç «ì­ ï § ¤¥à¦ª  ¤«ï ¨£àë <20>
game_delay_min dd ? ;¬¨­¨¬ «ì­ ï § ¤¥à¦ª 
;¤«ï £¥­¥à æ¨¨ á«ãç ©­ëå ç¨á¥« ;¤«ï £¥­¥à æ¨¨ á«ãç ©­ëå ç¨á¥«
rand_x dd 0 rand_x dd 0
@ -410,7 +420,8 @@ CountEggsInc: ;㢥
and ax,0xf ;ç¥à¥§ ª ¦¤ë¥ 16 ï¨æ 㬥­ìè ¥¬ ¢à¥¬ï and ax,0xf ;ç¥à¥§ ª ¦¤ë¥ 16 ï¨æ 㬥­ìè ¥¬ ¢à¥¬ï
cmp ax,0 cmp ax,0
jne @f jne @f
cmp dword[game_spd],15 ;¬¨­¨¬ «ì­ ï § ¤¥à¦ª  mov edi,dword[game_delay_min] ;¬¨­¨¬ «ì­ ï § ¤¥à¦ª 
cmp dword[game_spd],edi
jle @f jle @f
dec dword[game_spd] dec dword[game_spd]
@@: @@:
@ -554,23 +565,25 @@ proc InitGame, b:dword ;
mov word[eggs_count],0 ;ª®««¨ç¥á⢮ ¯®©¬ ­ëå ï¨æ mov word[eggs_count],0 ;ª®««¨ç¥á⢮ ¯®©¬ ­ëå ï¨æ
mov byte[some_text],'0' mov byte[some_text],'0'
mov byte[some_text+1],0 ;⥪áâ á ç¨á«®¬ ¯®©¬ ­­ëå ï¨æ mov byte[some_text+1],0 ;⥪áâ á ç¨á«®¬ ¯®©¬ ­­ëå ï¨æ
mov byte[count_last],0 mov byte[count_last],0 ;èâà ä­ë¥ ®çª¨
mov dword[pos_eggs],0 mov dword[pos_eggs],0
mov byte[zaac_status],0 mov byte[zaac_status],0
push eax ebx
cmp dword[b],0 cmp dword[b],0
jne @f jne @f
mov byte[game_text+5],'€' mov byte[game_text+5],'€'
mov dword[game_spd],65 ;§ ¤¥à¦ª  ¨£àë mov eax,dword[game_delay_a]
mov dword[game_spd],eax ;§ ¤¥à¦ª  ¨£àë
jmp .end_init jmp .end_init
@@: @@:
mov byte[game_text+5],'<27>' mov byte[game_text+5],'<27>'
mov dword[game_spd],35 ;§ ¤¥à¦ª  ¨£àë mov eax,dword[game_delay_b]
mov dword[game_spd],eax ;§ ¤¥à¦ª  ¨£àë
.end_init: .end_init:
push eax ebx mcall 26,9
mcall 26,9 mov dword[rand_x],eax ;§ ¯®«­ï¥¬ 1-¥ á«ãç ©­®¥ ç¨á«®
mov dword[rand_x],eax ;§ ¯®«­ï¥¬ 1-¥ á«ãç ©­®¥ ç¨á«®
pop ebx eax pop ebx eax
ret ret
@ -626,11 +639,20 @@ start:
mov dword[displ_h],eax mov dword[displ_h],eax
stdcall dword[ini_get_str],file_name,ini_sec_files,key_file_decorat,fn_icon0,FILE_NAME_MAX,ini_def_decorat_file stdcall dword[ini_get_str],file_name,ini_sec_files,key_file_decorat,fn_icon0,FILE_NAME_MAX,ini_def_decorat_file
stdcall dword[ini_get_str],file_name,ini_sec_files,key_file_unit,fn_icon1,FILE_NAME_MAX,ini_def_unit_file stdcall dword[ini_get_str],file_name,ini_sec_files,key_file_unit,fn_icon1,FILE_NAME_MAX,ini_def_unit_file
stdcall dword[ini_get_str],file_name,ini_sec_files,key_file_objects,fn_icon2,FILE_NAME_MAX,ini_def_objects_file
stdcall dword[ini_get_int],file_name,ini_sec_files,key_shadow_x,2 stdcall dword[ini_get_int],file_name,ini_sec_files,key_shadow_x,2
mov dword[offs_shadow_x],eax mov dword[offs_shadow_x],eax
stdcall dword[ini_get_int],file_name,ini_sec_files,key_shadow_y,2 stdcall dword[ini_get_int],file_name,ini_sec_files,key_shadow_y,2
mov dword[offs_shadow_y],eax mov dword[offs_shadow_y],eax
;áç¨â뢠­¨¥ ­ áâ஥ª ¢«¨ïîé¨å ­  ᪮àáâì ¨£àë
stdcall dword[ini_get_int],file_name,ini_sec_game,key_delay_a,65
mov dword[game_delay_a],eax
stdcall dword[ini_get_int],file_name,ini_sec_game,key_delay_b,35
mov dword[game_delay_b],eax
stdcall dword[ini_get_int],file_name,ini_sec_game,key_delay_min,15
mov dword[game_delay_min],eax
stdcall dword[ini_get_color],file_name,ini_sec_color,key_color_fon,0xffffff stdcall dword[ini_get_color],file_name,ini_sec_color,key_color_fon,0xffffff
mov dword[color_fon],eax mov dword[color_fon],eax
stdcall dword[ini_get_color],file_name,ini_sec_color,key_color_shadows,0xd0d0d0 stdcall dword[ini_get_color],file_name,ini_sec_color,key_color_shadows,0xd0d0d0
@ -647,7 +669,9 @@ start:
mov ecx,3 mov ecx,3
cld cld
@@: @@:
push ecx ;äã­ªæ¨ï ini_get_color ¨¬¥¥â ¯à ¢® ¬ ­ïâì ॣ¨áâà ecx
stdcall dword[ini_get_color],file_name,ini_sec_color,key_color_decorat,0x000080 stdcall dword[ini_get_color],file_name,ini_sec_color,key_color_decorat,0x000080
pop ecx
mov dword[ebx],eax mov dword[ebx],eax
add ebx,4 add ebx,4
inc byte[key_color_decorat.ind] inc byte[key_color_decorat.ind]
@ -1026,7 +1050,7 @@ image_data dd 0 ;
image_data_gray dd 0 ;¯ ¬ïâì á ¢à¥¬¥­­ë¬¨ á¥à묨 ¨§®¡à ¦¥­¨ï¬¨ ¢ ä®à¬ â¥ 24-bit, ¨§ ª®â®àëå ¡ã¤ãâ ᮧ¤ ¢ âìáï âà ä à¥âë image_data_gray dd 0 ;¯ ¬ïâì á ¢à¥¬¥­­ë¬¨ á¥à묨 ¨§®¡à ¦¥­¨ï¬¨ ¢ ä®à¬ â¥ 24-bit, ¨§ ª®â®àëå ¡ã¤ãâ ᮧ¤ ¢ âìáï âà ä à¥âë
run_file_70 FileInfoBlock run_file_70 FileInfoBlock
hed db 'Nu pogodi 20.08.10',0 ;¯®¤¯¨áì ®ª­  hed db 'Nu pogodi 22.08.10',0 ;¯®¤¯¨áì ®ª­ 
sc system_colors ;á¨á⥬­ë¥ æ¢¥â  sc system_colors ;á¨á⥬­ë¥ 梥â 
align 4 align 4

View File

@ -3,8 +3,13 @@ displ_w=315
displ_h=210 displ_h=210
file_decorat=curici.png file_decorat=curici.png
file_unit=wolf.png file_unit=wolf.png
file_objects=eggs.png
offs_shadow_x=2 offs_shadow_x=2
offs_shadow_y=2 offs_shadow_y=2
[Game]
delay_a=65
delay_b=35
delay_min=15
[Colors] [Colors]
background=255,255,255 ;öâĺň ôîíŕ background=255,255,255 ;öâĺň ôîíŕ
shadows=200,200,200 ;öâĺň ňĺíĺé shadows=200,200,200 ;öâĺň ňĺíĺé