diff --git a/programs/games/rstearth/build_en.bat b/programs/games/rstearth/build_en.bat index 7aae0cad65..47f7459482 100644 --- a/programs/games/rstearth/build_en.bat +++ b/programs/games/rstearth/build_en.bat @@ -4,6 +4,7 @@ if not exist bin mkdir rstearth_eng_bin @fasm -m 16384 rstearth.asm rstearth_eng_bin\rstearth.kex @erase lang.inc @kpack rstearth_eng_bin\rstearth.kex +@copy resources\font_russo_1bpp.png rstearth_eng_bin\font_russo_1bpp.png @copy resources\base_8bpp.png rstearth_eng_bin\base_8bpp.png @copy resources\red_brick_8bpp.png rstearth_eng_bin\red_brick_8bpp.png @copy resources\white_brick_8bpp.png rstearth_eng_bin\white_brick_8bpp.png diff --git a/programs/games/rstearth/build_ru.bat b/programs/games/rstearth/build_ru.bat index b4ea8e2192..d53edd1326 100644 --- a/programs/games/rstearth/build_ru.bat +++ b/programs/games/rstearth/build_ru.bat @@ -4,6 +4,7 @@ if not exist bin mkdir rstearth_rus_bin @fasm -m 16384 rstearth.asm rstearth_rus_bin\rstearth.kex @erase lang.inc @kpack rstearth_rus_bin\rstearth.kex +@copy resources\font_russo_1bpp.png rstearth_rus_bin\font_russo_1bpp.png @copy resources\base_8bpp.png rstearth_rus_bin\base_8bpp.png @copy resources\red_brick_8bpp.png rstearth_rus_bin\red_brick_8bpp.png @copy resources\white_brick_8bpp.png rstearth_rus_bin\white_brick_8bpp.png diff --git a/programs/games/rstearth/font.inc b/programs/games/rstearth/font.inc new file mode 100644 index 0000000000..3ada448f0e --- /dev/null +++ b/programs/games/rstearth/font.inc @@ -0,0 +1,34 @@ +;--------------------------------------------------------------------- +draw_font: + pusha + xor ebp,ebp + mov esi,edx + mov edx,ebx + cld +;-------------------------------------- +@@: + lodsb + test al,al + jz .exit + + movzx ebx,al + imul ebx, FONT_SIZE_X * FONT_SIZE_Y /8 + mov eax,[font_icons] + add ebx,[eax+28] + add ebx,eax + mov ecx,FONT_SIZE_X shl 16 + FONT_SIZE_Y + mov edi,[eax+20] ; palette + add edi,eax + + push esi + mov esi,1 + mcall 65 + pop esi + + add edx,FONT_REAL_SIZE_X shl 16 ; font size x + jmp @b +;-------------------------------------- +.exit: + popa + ret +;--------------------------------------------------------------------- \ No newline at end of file diff --git a/programs/games/rstearth/i_data.inc b/programs/games/rstearth/i_data.inc index 30d0cd3d90..a105d1b9ae 100644 --- a/programs/games/rstearth/i_data.inc +++ b/programs/games/rstearth/i_data.inc @@ -243,6 +243,7 @@ error_fs_text_9: db '9 - FAT table is destroyed',0 error_fs_text_10: db '10 - Access denied',0 error_fs_text_11: db '11 - Device error',0 ;--------------------------------------------------------------------- +font_icons_file_name db 'font_russo_1bpp.png',0 base_icons_file_name db 'base_8bpp.png',0 red_brick_icons_file_name db 'red_brick_8bpp.png',0 white_brick_icons_file_name db 'white_brick_8bpp.png',0 diff --git a/programs/games/rstearth/load.inc b/programs/games/rstearth/load.inc index e42a218a9f..a3a3dc39f3 100644 --- a/programs/games/rstearth/load.inc +++ b/programs/games/rstearth/load.inc @@ -65,14 +65,7 @@ load_and_convert_current_icon_set: mov eax,[raw_pointer] ret ;--------------------------------------------------------------------- -load_and_convert_all_icons: -; load and convert base icons - mov ebx,base_icons_file_name - call load_and_convert_current_icon_set - mov [base_icons],eax -; DEBUGF 1, "base_icons: %x\n",eax - -; load and convert base icons +; load and convert icons ; mov ebx,npc_miku_kick_icons_file_name ; call load_and_convert_current_icon_set ; mov [npc_miku_kick_icons],eax @@ -88,6 +81,19 @@ load_and_convert_all_icons: ; DEBUGF 1, "data size: %x\n",[eax+32] ; DEBUGF 1, "transparency offset: %x\n",[eax+36] ; DEBUGF 1, "transparency size: %x\n",[eax+40] +;--------------------------------------------------------------------- +load_and_convert_all_icons: +; load and convert font icons + mov ebx,font_icons_file_name + call load_and_convert_current_icon_set + mov [font_icons],eax +; DEBUGF 1, "font_icons: %x\n",eax + +; load and convert base icons + mov ebx,base_icons_file_name + call load_and_convert_current_icon_set + mov [base_icons],eax +; DEBUGF 1, "base_icons: %x\n",eax ; load and convert red brick mov ebx,red_brick_icons_file_name diff --git a/programs/games/rstearth/localization_eng.inc b/programs/games/rstearth/localization_eng.inc index 112e35c2eb..9e7de60d78 100644 --- a/programs/games/rstearth/localization_eng.inc +++ b/programs/games/rstearth/localization_eng.inc @@ -1,6 +1,6 @@ ;--------------------------------------------------------------------- title: - db 'Rusty Earth (Prototype 1.6) 24.12.2014',0 + db 'Rusty Earth (Prototype 1.7) 26.12.2014',0 ;--------------------------------------------------------------------- menu_game_label: db 'GAME',0 diff --git a/programs/games/rstearth/localization_rus.inc b/programs/games/rstearth/localization_rus.inc index dda174370f..e96591a5c2 100644 --- a/programs/games/rstearth/localization_rus.inc +++ b/programs/games/rstearth/localization_rus.inc @@ -2,7 +2,7 @@ ; Code page - Cyrillic OEM866 ;--------------------------------------------------------------------- title: - db 'Ржавая Земля (Прототип 1.6) 24.12.2014',0 + db 'Ржавая Земля (Прототип 1.7) 26.12.2014',0 ;--------------------------------------------------------------------- menu_game_label: db 'ИГРА',0 @@ -11,7 +11,7 @@ menu_settings_label: db 'НАСТРОЙКИ',0 ;-------------------------------------- menu_credits_label: - db 'БЛАГОДАРНОСТЬ',0 + db 'ПРИВЕТЫ',0 ;-------------------------------------- menu_help_label: db 'ПОМОЩЬ',0 @@ -36,8 +36,8 @@ menu_setting_exit: ;--------------------------------------------------------------------- menu_credits_text: .1: db 'Привет участникам команды KolibriOS Team!',0 -.2: db 'В игре использованы графические и звуковые материалы',0 -.3: db 'под свободными лицензиями, позаимствованные с сайтов:',0 +.2: db 'Графические и звуковые материалы под',0 +.3: db 'свободными лицензиями, взяты с сайтов:',0 .4: db 'http://untamed.wild-refuge.net/',0 .5: db 'http://opengameart.org',0 .6: db 'https://wiki.themanaworld.org',0 diff --git a/programs/games/rstearth/menu.inc b/programs/games/rstearth/menu.inc index 4f37d5fbee..621fa91280 100644 --- a/programs/games/rstearth/menu.inc +++ b/programs/games/rstearth/menu.inc @@ -5,6 +5,7 @@ main_menu_start: .red: mov [menu_text_pointers],main_menu_text_pointers mov [text_step_Y],SPRITE_SIZE_Y + mov [use_separate_draw_text],1 call draw_menu_window call draw_new_pointer ;--------------------------------------------------------------------- @@ -116,7 +117,7 @@ main_menu_start: clear_old_pointer: movzx ecx,byte [main_menu_pointer] imul ecx,SPRITE_SIZE_Y - add ecx,SPRITE_SIZE_Y*2 + 32 + add ecx,SPRITE_SIZE_Y*3 - 16 shl ecx,16 mov cx,SPRITE_SIZE_Y mcall 13,,,0 @@ -132,7 +133,7 @@ draw_new_pointer: movzx edx,byte [main_menu_pointer] imul edx,SPRITE_SIZE_Y - add edx,SPRITE_SIZE_Y*2 + 32 + add edx,SPRITE_SIZE_Y*3 - 16 add edx,SPRITE_SIZE_X*2 shl 16 mov eax,[npc_miku_icons] @@ -162,7 +163,16 @@ draw_menu_window: test edx,edx jz .end + cmp [use_separate_draw_text],1 + je .use_separate_draw_text + mcall + jmp .continue +;-------------------------------------- +.use_separate_draw_text: + call draw_font +;-------------------------------------- +.continue: add ebx,[text_step_Y] add esi,4 jmp @b @@ -186,10 +196,11 @@ menu_help: call snd_kick_action mov [menu_text_pointers],menu_help_text_pointers ;-------------------------------------- -.1: +.1: mov [text_step_Y],20 ;-------------------------------------- .red: + mov [use_separate_draw_text],0 call draw_menu_window ;--------------------------------------------------------------------- .still: @@ -253,6 +264,7 @@ settings_menu_start: mov [menu_text_pointers],settings_menu_text_pointers mov [text_step_Y],SPRITE_SIZE_Y call prepare_settings_text + mov [use_separate_draw_text],1 call draw_menu_window call draw_new_pointer ;--------------------------------------------------------------------- diff --git a/programs/games/rstearth/resources/font_russo_1bpp.png b/programs/games/rstearth/resources/font_russo_1bpp.png new file mode 100644 index 0000000000..e2a8105ee2 Binary files /dev/null and b/programs/games/rstearth/resources/font_russo_1bpp.png differ diff --git a/programs/games/rstearth/rstearth.asm b/programs/games/rstearth/rstearth.asm index 2b171e089f..91d52c1cf0 100644 --- a/programs/games/rstearth/rstearth.asm +++ b/programs/games/rstearth/rstearth.asm @@ -47,6 +47,10 @@ include '../../develop/libraries/box_lib/load_lib.mac' ;include '../../develop/libraries/box_lib/trunk/box_lib.mac' @use_library ;--------------------------------------------------------------------- +FONT_SIZE_X = 32 +FONT_REAL_SIZE_X = 32 +FONT_SIZE_Y = 32 +;--------------------------------------------------------------------- LEVEL_MAP_SIZE_X = 10 LEVEL_MAP_SIZE_Y = 10 SPRITE_SIZE_X = 64 @@ -207,6 +211,7 @@ include 'random.inc' include 'snd_api.inc' include 'sound.inc' include 'menu.inc' +include 'font.inc' ;--------------------------------------------------------------------- if lang eq ru include 'localization_rus.inc' diff --git a/programs/games/rstearth/sound.inc b/programs/games/rstearth/sound.inc index f26c6113ef..1c7bbf6d9f 100644 --- a/programs/games/rstearth/sound.inc +++ b/programs/games/rstearth/sound.inc @@ -180,12 +180,13 @@ snd_background_music_thread_start: mov ebx,[eax] add eax,4 mov ebp,eax -; DEBUGF 1, "src EAX: %x size EBX: %x\n",eax,ebx + add ebx,eax +; DEBUGF 1, "start EAX: %x\n",eax ;-------------------------------------- .loop: cmp [music_flag],0 je snd_background_music_thread_start -; DEBUGF 1, "src EAX: %x size EBX: %x\n",eax,ebx +; DEBUGF 1, "src EBP: %x size EBX: %x\n",ebp,ebx ; stdcall _WaveOut@12,[hBuff],eax,ebx stdcall _WaveOut@12,[hBuff1],ebp,8192 ; DEBUGF 1, "return EAX: %x\n",eax @@ -195,7 +196,7 @@ snd_background_music_thread_start: add ebp,8192*2 cmp ebx,ebp - jae .start + jbe .start sub ebp,8192 jmp .loop diff --git a/programs/games/rstearth/u_data.inc b/programs/games/rstearth/u_data.inc index 02502f7c01..ef4bf543d0 100644 --- a/programs/games/rstearth/u_data.inc +++ b/programs/games/rstearth/u_data.inc @@ -12,12 +12,14 @@ music_flag rb 1 snd_kick_flag rb 1 main_menu_pointer rb 1 settings_menu_pointer rb 1 +use_separate_draw_text rb 1 ;--------------------------------------------------------------------- align 4 N_error rd 1 error_type rd 1 error_path rd 1 ;--------------------------------------------------------------------- +font_icons rd 1 base_icons rd 1 red_brick_icons rd 1 white_brick_icons rd 1