diff --git a/programs/cmm/eolite/include/about.h b/programs/cmm/eolite/include/about.h index 18e1ce263e..8f13f4bfcd 100644 --- a/programs/cmm/eolite/include/about.h +++ b/programs/cmm/eolite/include/about.h @@ -3,25 +3,19 @@ #define BROWSER_PATH "/sys/network/webview" #define BROWSER_LINK "http://kolibri-n.org/inf/eolite/eolite_p1" -#ifdef LANG_RUS - ?define DEVELOPERS_TEXT "Разработчики:\nLeency Veliant PunkJoker Pavelyakov\nKolibriOS Team\n2008-2016" - ?define CLOSE_BUTTON_TEXT "Закрыть" -#else - ?define DEVELOPERS_TEXT "Developers:\nLeency Veliant PunkJoker Pavelyakov\nKolibriOS Team\n2008-2016" - ?define CLOSE_BUTTON_TEXT "Close" -#endif void about_dialog() { byte id; proc_info about_form; + int about_x; if (active_about) {cmd_free=2;ExitProcess();} else active_about=1; loop() switch(WaitEvent()) { case evButton: id=GetButtonID(); - IF (id==1) || (id==10) + IF (id==1) { active_about=0; cmd_free = 2; @@ -40,17 +34,18 @@ void about_dialog() break; case evReDraw: - DefineAndDrawWindow(Form.left+Form.width/2,Form.top+Form.height/2-114,440,200+GetSkinHeight(),0x34,system.color.work,0); + DefineAndDrawWindow(Form.left+Form.width/2,Form.top+Form.height/2-114,310,300+GetSkinHeight(),0x34,system.color.work,0); GetProcessInfo(#about_form, SelfInfo); if (about_form.status_window>2) break; logo_pal[0] = system.color.work; - PutPaletteImage(#logo,86,86,10,23,8,#logo_pal); - WriteTextB(112,16,0x82,0xD49CD2,ABOUT_TITLE); - WriteTextB(110,14,0x82,0xBF40BF,ABOUT_TITLE); - WriteTextLines(110,53,10010000b,0,DEVELOPERS_TEXT,21); + PutPaletteImage(#logo,86,86,about_form.cwidth-86/2,10,8,#logo_pal); + about_x = -strlen(ABOUT_TITLE)*18+about_form.cwidth/2; + WriteTextB(about_x+2,107,0x82,0xD49CD2,ABOUT_TITLE); + WriteTextB(about_x,105,0x82,0x9D129D,ABOUT_TITLE); + DrawRectangle3D(0,154,about_form.cwidth/5*3,1,system.color.work_dark,system.color.work_light); + WriteTextLines(7,163,0x90,system.color.work_text,"KolibriOS File Manager\nAuthors: Leency, Veliant\nPunkJoker, Pavelyakov\n(c) 2008 - 2016",20); #ifdef LANG_RUS - DrawFlatButton(about_form.cwidth-310,about_form.cheight-38,180,26,11,"История разработки"); + DrawFlatButton(about_form.cwidth-180/2,about_form.cheight-38,180,26,11,"История разработки"); #endif - DrawFlatButton(about_form.cwidth-110,about_form.cheight-38, 90,26,10,CLOSE_BUTTON_TEXT); } } diff --git a/programs/cmm/ttf_viewer/compile_en.bat b/programs/cmm/ttf_viewer/compile_en.bat deleted file mode 100644 index c4c8936254..0000000000 --- a/programs/cmm/ttf_viewer/compile_en.bat +++ /dev/null @@ -1,11 +0,0 @@ -@del lang.h-- -@echo #define LANG_ENG 1 >lang.h-- - -@del ttf_viewer -cls -c-- ttf_viewer.c -@rename ttf_viewer.com ttf_viewer -@del warning.txt -@del lang.h-- -@pause -kpack ttf_viewer diff --git a/programs/cmm/ttf_viewer/compile_ru.bat b/programs/cmm/ttf_viewer/compile_ru.bat deleted file mode 100644 index 4ffe4315ff..0000000000 --- a/programs/cmm/ttf_viewer/compile_ru.bat +++ /dev/null @@ -1,11 +0,0 @@ -@del lang.h-- -@echo #define LANG_RUS 1 >lang.h-- - -@del ttf_viewer -cls -c-- ttf_viewer.c -@rename ttf_viewer.com ttf_viewer -@del warning.txt -@del lang.h-- -@pause -kpack ttf_viewer diff --git a/programs/cmm/ttf_viewer/ttf_viewer.c b/programs/cmm/ttf_viewer/ttf_viewer.c deleted file mode 100644 index 84a91bc6e4..0000000000 --- a/programs/cmm/ttf_viewer/ttf_viewer.c +++ /dev/null @@ -1,111 +0,0 @@ -#ifndef AUTOBUILD -#include "lang.h--" -#endif - -#define MEMSIZE 397113 -#include "..\lib\strings.h" -#include "..\lib\mem.h" -#include "..\lib\file_system.h" -#include "..\lib\gui.h" -#include "..\lib\obj\truetype.h" -#include "..\lib\obj\proc_lib.h" -#include "..\lib\patterns\simple_open_dialog.h" - -char default_dir[] = "/rd/1"; -od_filter filter2 = {"TTF",0}; - -dword font_data; -stbtt_fontinfo font_info; -dword font_mem; - -proc_info Form; -char test_text[] = "The quick brown fox jumps over the lazy dog"; -char win_title[4096] = "TTF Viewer v0.1 - "; - -#ifdef LANG_RUS - ?define T_INTRO "Это простая программа для просмотра шрифтов формата TTF" - ?define T_INTRO_BUTTON_TEXT "Открыть шрифт" -#else - ?define T_INTRO "This is simple program to view TTF fonts." - ?define T_INTRO_BUTTON_TEXT "Open font" -#endif - - -void main() -{ - int id, key; - - load_dll(libtruetype, #truetype, 1); - load_dll(Proc_lib, #OpenDialog_init,0); - OpenDialog_init stdcall (#o_dialog); - - if (param[0]) OpenFont(#param); - - loop() - { - switch(WaitEvent()) - { - case evButton: - id=GetButtonID(); - if (id==1) ExitProcess(); - if (id==10) - { - OpenDialog_start stdcall (#o_dialog); - OpenFont(#openfile_path); - } - break; - - case evKey: - key = GetKey(); - break; - - case evReDraw: - draw_window(); - } - } -} - - -void draw_window() -{ - system.color.get(); - DefineAndDrawWindow(30, 100, 800, 250+GetSkinHeight(), 0x34, 0xFFFfff, #win_title); - GetProcessInfo(#Form, SelfInfo); - DrawFonts(); -} - - -word DrawFonts() -{ - if (!font_data) - { - WriteTextCenter(0,85,Form.cwidth,0x555555, T_INTRO); - DrawCaptButton(Form.cwidth - 140 / 2, Form.cheight - 30 / 2, 140, 30, 10, system.color.work_button, system.color.work_button_text, T_INTRO_BUTTON_TEXT); - return; - } - text_out stdcall (#test_text, #font_info, 10, 0x000000, 0xFFFfff, 3, 4); - text_out stdcall (#test_text, #font_info, 12, 0x000000, 0xFFFfff, 3, 18); - text_out stdcall (#test_text, #font_info, 24, 0x000000, 0xFFFfff, 3, 35); - text_out stdcall (#test_text, #font_info, 36, 0x000000, 0xFFFfff, 3, 60); - text_out stdcall (#test_text, #font_info, 48, 0x000000, 0xFFFfff, 3, 110); - text_out stdcall (#test_text, #font_info, 58, 0x000000, 0xFFFfff, 3, 170); -} - - -void OpenFont(dword font_path) -{ - BDVK FontFile_atr; - GetFileInfo(font_path, #FontFile_atr); - font_data = malloc(FontFile_atr.sizelo); - ReadFile(0, FontFile_atr.sizelo, #font_data, font_path); - init_font stdcall (#font_info, #font_data); - if (EAX==0) - { - font_data = 0; - notify("'Can\096t open font: init_font failed' - E"); - } - strcpy(#win_title + 18, font_path); - draw_window(); -} - -stop: diff --git a/programs/games/almaz/ALMAZ.ASM b/programs/games/almaz/ALMAZ.ASM new file mode 100644 index 0000000000..62299848e7 --- /dev/null +++ b/programs/games/almaz/ALMAZ.ASM @@ -0,0 +1,2174 @@ + +WND_COLOR equ 0x02aa00FF + +use32 + org 0x0 + db 'MENUET01' + dd 0x01 + dd START + dd I_END + dd 0x300000 + dd 0x27fff0 + dd 0x0 + dd 0x0 + +include 'lang.inc' +include '..\..\macros.inc' ; макросы облегчают жизнь ассемблерщиков! + +include 'ASCL.INC' +include 'ASCGL.INC' + + + +gif_hash_offset = gif_hash_area +COLOR_ORDER equ MENUETOS + +DELAY equ 2 ; Задержка перед переходом к следующему кадру в мсек + +START: +;**************** +; Открываем фаил +;**************** +openfile: +; and [entered],0 +; mov ecx,499*3*4 ;at start + xor ecx,ecx + mov ecx,1 + + ; Convert gif to animation format + giftoani workarea,Image,ecx + bmptoimg bullet_bmp, img_bullet + bmptoimg level_bmp, img_level + bmptoimg kirpich, img_area + bmptoimg kirpich2, img_area2 + bmptoimg kirpich3, img_area3 + bmptoimg lest_bmp, img_lestniza + bmptoimg water1_bmp, img_water1 + bmptoimg water2_bmp, img_water2 + bmptoimg door1_bmp, img_door1 + bmptoimg door2_bmp, img_door2 + + +red: + call timer + call draw_window +; call load_level +; delay 200 + +still: + timeevent DELAY,no_event, red, key, button + +no_event: + call draw_subimage + jmp still + + key: + ; блока движения персонажа + mov eax,2 + int 0x40 + cmp ah, 179 ; право 4 + je go_mov + cmp ah, 176 ; лево 1 + je go_mov + cmp ah, 178 ; верх 3 + je go_mov + cmp ah, 177 ; низ 2 + je go_mov + cmp ah, 120 ; низ 2 + je go_fire + cmp ah, 122 ; низ 2 + je go_fire + cmp ah, 239 ; низ 2 + je go_fire_left + cmp ah, 231 ; низ 2 + je go_fire + + + jmp no_mov ; if not left, right, up, down, then go NO MOV + + go_mov: + ;mov ebx, [v_mov2] + mov [v_mov2], ah + sub word [v_mov2], 175 ; отнимаем от кода клавиши 175 и остается 1,2,3 или 4 соответственно направления движения персонажа + jmp no_mov ; if not left, right, up, down, then go NO MOV + + go_fire_left: + xor eax,eax + mov ah, 122 + call fire + jmp no_mov + go_fire: + call fire + no_mov: + ; конец блока движения персонажа + jmp still + + button: + mov eax, 17 + int 0x40 + + cmp ah,1 + jne noclose + _close: + or eax,-1 + int 0x40 + noclose: + jmp still + +; ********************************************* +; ******* ОПРЕДЕЛЕНИЕ И ОТРИСОВКА ОКНА ******* +; ********************************************* + +draw_window: + startwd + + mov eax,0 + mov ebx,50*65536+522 + mov ecx,50*65536+536 + mov edx,WND_COLOR + mov esi,0x8050FFd0 + mov edi,0x005080d0 + int 0x40 + + label 8,6,'ПОДЗЕМЕЛЬЕ для Колибри ОС <<>> z/x стрелять',cl_White+font_Big + + mov eax,8 + mov ebx,(500)*65536+12 + mov ecx,5*65536+12 + mov edx,1 + mov esi,0x000000 + int 0x40 + + xor ecx,ecx + call draw_subimage + cmp [imgcount],1 + je .enddraw + + mov ecx,[img_index] + + call draw_subimage + + .enddraw: + + endwd + + +ret + +;******************************************* +; LABIRINT +;******************************************* + + labirint: + + ; вывод блоков лабиринта + cycle: + + mov eax, [Lab] + shl eax, 5 ; сдвиг регистра в право на 5 позиции все равно что умножили на 32 + mov [perem1], eax + mov eax, [Lab] + shr eax, 4 ; сдвиг регистра в лево + shl eax, 5 ; сдвиг обратно (все равно что целочисленное делениена 256) + mov [perem2], eax + shl eax, 4 ; все равно что отнимаем от координат ненужный прирост -> У-256*X + sbb dword [perem1], eax; + + mov ebx, [Lab] + sbb ebx, 1 + mov eax,[Dangeon + ebx] ; берет байт из дангеон + смещение + + cmp ah, 1 ; + je go_block + + cmp ah, 0 ; + je back_block + + cmp ah, 12 ; закраска фона за алмазом + je back_block + + cmp ah, 3 ; + je boom_block + + cmp ah, 16 ; + je door_block + + cmp ah, 2 ; закраска фона за алмазом + je cool_block + + jmp end_block + go_block: + imgtoimg img_area,dword [perem1],dword [perem2],canvas + jmp end_block + + cool_block: + imgtoimg img_area3,dword [perem1],dword [perem2],canvas + jmp end_block + + + back_block: + imgtoimg img_area2,dword [perem1],dword [perem2],canvas + jmp end_block + + door_block: + imgtoimg img_door1,dword [perem1],dword [perem2],canvas + + mov eax, [gold] + cmp ax, 10 ; если собрано более 10 алмазов дверь открыта + jna end_block + imgtoimg img_door2,dword [perem1],dword [perem2],canvas + jmp end_block + + + boom_block: + imgtoimg img_area,dword [perem1],dword [perem2],canvas + mov ebp,18 ; кадр + mov eax, dword [perem1] + mov dword [X_anime], eax + mov eax, dword [perem2] + mov dword [Y_anime], eax + call animashka + + mov ecx, [timer1] ; + and ecx, 15 + cmp ecx, 0 + jne end_block + + mov ebx, [Lab] + mov byte [Dangeon + ebx], 0 ; берет байт из дангеон + смещение + + + end_block: + + add word [Lab],1 + mov eax, [Lab] + + cmp eax, 256 ; if eax == 0 + je cycle_end ; jump to cycle_end: + jmp cycle ; + + cycle_end: + + mov eax, 0 + mov [Lab],eax + + ret ; END labirint + + +;******************************************* +; ЛЕСТНИЦА +;******************************************* + lestniza: + ; вывод блоков лабиринта + cycle2: + + mov eax, [Lab] + shl eax, 5 ; сдвиг регистра в право на 5 позиции все равно что умножили на 32 + mov [perem1], eax + mov eax, [Lab] + shr eax, 4 ; сдвиг регистра в лево + shl eax, 5 ; сдвиг обратно (все равно что целочисленное делениена 256) + mov [perem2], eax + shl eax, 4 ; все равно что отнимаем от координат ненужный прирост -> У-256*X + sbb dword [perem1], eax; + + + mov ebx, [Lab] + sbb ebx, 1 + mov eax,[Dangeon + ebx] ; берет байт из дангеон + смещение + + cmp ah, 8 ; + je go_lestniza + + jmp end_lestniza + go_lestniza: + + imgtoimg img_lestniza,dword [perem1],dword [perem2],canvas + end_lestniza: + + add word [Lab],1 + mov eax, [Lab] + + cmp eax, 256 ; if eax == 0 + je cycle2_end ; jump to cycle_end: + jmp cycle2 ; + + cycle2_end: + + mov eax, 0 + mov [Lab],eax + + + ret ; END lestniza + + + +;******************************************* +; ВОДА и АЛМАЗЫ +;******************************************* + water: + + ; вывод воды лабиринта + cycle3: + + mov eax, [Lab] + shl eax, 5 ; сдвиг регистра в право на 5 позиции все равно что умножили на 32 + mov [perem1], eax + mov eax, [Lab] + shr eax, 4 ; сдвиг регистра в лево + shl eax, 5 ; сдвиг обратно (все равно что целочисленное делениена 256) + mov [perem2], eax + shl eax, 4 ; все равно что отнимаем от координат ненужный прирост -> У-256*X + sbb dword [perem1], eax; + + + mov ebx, [Lab] + sbb ebx, 1 + mov eax,[Dangeon + ebx] ; берет байт из дангеон + смещение + + cmp ah, 4 ; + je go_water + + cmp ah, 12 ; рисование алмазов + je go_almaz + + jmp end_water + go_water: + mov eax,0 ; + mov eax, [timer1]; + and eax, 15 + cmp eax, 7 ; + jb go_water2 + + imgtoimg img_water1,dword [perem1],dword [perem2],canvas + jmp end_water + + go_water2: + imgtoimg img_water2,dword [perem1],dword [perem2],canvas + + jmp end_water + go_almaz: + + mov eax,0 ; + mov eax, [timer1]; + and eax, 31 + + cmp eax, 10 + ja almaz2 + + mov ebp,14 ; кадр + mov eax, dword [perem1] + mov dword [X_anime], eax + mov eax, dword [perem2] + mov dword [Y_anime], eax + call animashka + jmp end_water + + almaz2: + cmp eax, 20 + ja almaz3 + + mov ebp,15 ; кадр + mov eax, dword [perem1] + mov dword [X_anime], eax + mov eax, dword [perem2] + mov dword [Y_anime], eax + call animashka + jmp end_water + + almaz3: + mov ebp,16 ; кадр + mov eax, dword [perem1] + mov dword [X_anime], eax + mov eax, dword [perem2] + mov dword [Y_anime], eax + call animashka + + + end_water: + + add word [Lab],1 + mov eax, [Lab] + + cmp eax, 256 ; if eax == 0 + je cycle3_end ; jump to cycle_end: + jmp cycle3 ; + + cycle3_end: + + mov eax, 0 + mov [Lab],eax + + + ret ; END water + + +;******************************************* +; Выводим следующий кадр из списка картинок +;******************************************* +draw_subimage: + ;aframetoimg Image,32, 32,canvas,0x00ffffff ; НЕВИДИМЫЙ, прозрачный ЦВЕТ ИЛИ НЕ РИСУЕМЫЙ + + call labirint + call lestniza + call enemy_mas + call enemy_mov +;------------------------------------------------------------------------------- + mov ebx, [gold] + cmp bx, 5 ;увеличение скорости врагов если украл более 9 + jna lov_velo + call enemy_mas + call enemy_mov + lov_velo: +;------------------------------------------------------------------------------- +;------------------------------------------------------------------------------- + mov ebx, [gold] + cmp bx, 9 ;увеличение скорости врагов если украл более 9 + jna lov_velo2 + call enemy_mas + call enemy_mov + lov_velo2: +;------------------------------------------------------------------------------- +; call enemy_mas +; call enemy_mov + call hiro + call hiro_mov + call water + + call bullet_mov + call bullet_mov + call bullet_mov + call bullet_mas + call bullet_mov + call bullet_mov + call bullet_mov + call bullet_mas + call proverka_gold + call potop + + setimg 6,20,canvas + + call timer + call tablo +ret + +;@@@@@@@@@@@@@@@@@@ +animashka: +;!!!ВАЖНО перед вызовом процедуры должен быть установлен ebx[номер кадра] и x,y + + mov edi,coords + mov esi, Image ; гиф анимашка в памяти +; +; mov ebp, dword [edi+8] ;ecx здесь конкретный номер выводимого кадра +; inc ebp ; увеличение кадра +; cmp ebp,3 ; максимальное количество кадров !!!!!!! +; jna ok_fr ; если выводимы кадр меньше максимального количества кадров +;!!!!!!!!! mov ebp,2 ;обнуление кадра + +ok_fr: + mov dword [edi+8], ebp ;номер выводимого кадра +loo: + cmp ebp,0 ; если кадр нулевой то сразу на вывод ? + je setpic + movzx eax,word [esi+4] ; если нет то увеличиваем х у ? + movzx ebx,word [esi+6] + mul ebx ;dword [esi+4] умножает ebx на eax и результат в eax edx + mov ebx,3 ; количество кадров ??? + mul ebx + add eax,8 + add esi,eax + dec ebp + jmp loo +setpic: + + pushad +; aframetoimg esi,dword [edi], dword [edi+4],canvas,0x00ffffff ; НЕВИДИМЫЙ, прозрачный ЦВЕТ ИЛИ НЕ РИСУЕМЫЙ +; aframetoimg esi,32, 32,canvas,0x00ffffff ; НЕВИДИМЫЙ, прозрачный ЦВЕТ ИЛИ НЕ РИСУЕМЫЙ + aframetoimg esi,dword [X_anime],dword [Y_anime],canvas,0x00ffffff ; НЕВИДИМЫЙ, прозрачный ЦВЕТ ИЛИ НЕ РИСУЕМЫЙ + ;call enemy_mas + popad +ret +;@@@@@@@@@@@@@@ + + + ;-------------- TIMER -------------- + timer: + mov eax,0 ; + mov eax,[timer1] ; + add eax, 1; + mov [timer1], eax + + cmp eax, 64 ; таймер от 0 до 64 + je nul_timer + jmp timer_dalee + nul_timer : + mov [timer1], 0 + timer_dalee: + ret + ;-------------- TIMER -------------- + + + + + +;******************************************* +; ENEMY +;******************************************* + + enemy_mas: ; вывод ENEmy ENEMYYYYYYYYYYYYYYY ENEMYYYYYYYYYYYYYY !!! + + mov word [Lab2], 0 ; все делать в WORD один элемент в массиве +2 следующий враг соотвтетственно 6*2= + 12 + + cycle4: + + mov ebx, 0 + mov ecx, 0 + mov edx, 0 + mov esi, 0 + + mov word bx, [Lab2] + mov word ax,[Enemy+bx] ; берет байт из Enemy + смещение + + cmp ax, 1 ; обычный враг номер 1 + je go_enemy + + jmp end_enemy + go_enemy: + + add word bx, 2 ; X кооридината данного врага + mov word ax, [Enemy + bx] + mov word [X_enemy], ax + + add word bx, 2 ; Y кооридината данного врага + mov word ax, [Enemy + ebx] + mov word [Y_enemy], ax + + add word bx, 2 ; положение в массиве данного врага + mov word ax, [Enemy + ebx] + mov word [lab_enemy], ax + + add word bx, 2 ; направление движения данного врага + mov word ax, [Enemy + ebx] + mov word [mov_enemy], ax + + add word bx, 2 ; enemy LIFE + mov word ax, [Enemy + ebx] + mov word [life_enemy], ax + + cmp ax, 499; ; замороженные враги + ja enemy_dalee + mov ebp,2 ; кадр + mov eax, dword [X_enemy] + mov dword [X_anime], eax + mov eax, dword [Y_enemy] + mov dword [Y_anime], eax + call animashka + jmp enemy_bmp_end + + + + enemy_dalee: + xor eax,eax ; + mov eax, [X_enemy] ; + and eax, 15 + cmp ax, 7; + ja enemy_1 + + jmp enemy_2 + + enemy_1: + + mov ebp,0 ; кадр + mov eax, dword [X_enemy] + mov dword [X_anime], eax + mov eax, dword [Y_enemy] + mov dword [Y_anime], eax + call animashka + + jmp enemy_bmp_end + + enemy_2: + mov ebp,1 ; кадр + mov eax, dword [X_enemy] + mov dword [X_anime], eax + mov eax, dword [Y_enemy] + mov dword [Y_anime], eax + call animashka + enemy_bmp_end: + + end_enemy: + + mov eax, 0 + mov word ax, [Lab2] + + cmp ax, 96 ; if eax == 0 + je cycle4_end ; jump to cycle_end: + + add word [Lab2],12 + + jmp cycle4 ; + + cycle4_end: + + ret ; END eNEMYYYYYYYYYYYYYYY ENEMYYYYYYYYYYYYYY !!! + +;$$$$$$$$$$$$$$$$$$$$$$$$$$ +; ENEMY MOV +;$$$$$$$$$$$$$$$$$$$$$$$$$$ +enemy_mov: + mov word [Lab2], 0 ; все делать в WORD один элемент в массиве +2 следующий враг соотвтетственно 6*2= + 12 + + cycle5: + + mov ebx, 0 + mov ecx, 0 + mov edx, 0 + mov esi, 0 + + mov word bx, [Lab2] + mov word ax,[Enemy+bx] ; берет байт из Enemy + смещение + + cmp ax, 1 ; обычный враг номер 1 + je go_mov_enemy + + jmp end_mov_enemy + go_mov_enemy: + + add word bx, 2 ; X кооридината данного врага + mov word ax, [Enemy + bx] + mov word [X_enemy], ax + + add word bx, 2 ; Y кооридината данного врага + mov word ax, [Enemy + ebx] + mov word [Y_enemy], ax + + add word bx, 2 ; положение в массиве данного врага + mov word ax, [Enemy + ebx] + mov word [lab_enemy], ax + + add word bx, 2 ; направление движения данного врага + mov word ax, [Enemy + ebx] + mov word [mov_enemy], ax + + add word bx, 2 ; enemy LIFE + mov word ax, [Enemy + ebx] + mov word [life_enemy], ax + + cmp ax, 499; ; замороженные враги + ja dalee_enemy_mov + add ax, 1 + + mov word [Enemy + ebx], ax + + jmp end_mov_enemy + + dalee_enemy_mov: + ; блок поедания героя + mov ax, [Xpl] + add ax, 23 + cmp ax, [X_enemy] + jna ne_em + sbb ax, 45 + cmp ax, [X_enemy] + ja ne_em + mov ax, [Ypl] + add ax, 23 + cmp ax, [Y_enemy] + jna ne_em + sbb ax, 45 + cmp ax, [Y_enemy] + ja ne_em + call load_level ; DEAD HIRO + delay 150 + + ne_em: + ;Блок попадания 1 пули + + mov word bx, 0 + mov word ax,[Bullet + ebx] + cmp ax, 0 + je no_bullet + + add word bx, 2 ; [Xpl] + mov word cx, [Bullet + ebx] + + add word bx, 2 ; [Ypl] + mov word dx, [Bullet + ebx] + + cmp dx, [Y_enemy] + jna no_bullet + sbb dx, 32 + cmp dx, [Y_enemy] + ja no_bullet + cmp cx, [X_enemy] + jna no_bullet + sbb cx, 32 + cmp cx, [X_enemy] + ja no_bullet + mov word bx, [Lab2] + add word bx, 10 ; enemy LIFE + mov word [Enemy + ebx],0 + + mov byte [Bullet], 0 ; + + no_bullet: + + + ;БЛОК ПРИРОСТА ДВИЖЕНИЯ ВРАГОВ + mov word ax, [mov_enemy] ; + cmp ax, 1 ; left ; + jne next_2 ; + sbb word [X_enemy], 1 ; + mov word ax, [X_enemy] ; + mov word bx, [Lab2] ; + add word bx, 2 ; X кооридината данного врага + mov word [Enemy + bx], ax ; + ; + next_2: ; + cmp ax, 2 ; down ; + jne next_3 ; + add word [Y_enemy], 1 ; + mov word ax, [Y_enemy] ; + mov word bx, [Lab2] ; + add word bx, 4 ; Y кооридината данного врага + mov word [Enemy + bx], ax ; + ; + next_3: ; + cmp ax, 3 ; up ; + jne next_4 ; + sbb word [Y_enemy], 1 ; + mov word ax, [Y_enemy] ; + mov word bx, [Lab2] ; + add word bx, 4 ; Y кооридината данного врага + mov word [Enemy + bx], ax ; + ; + next_4: ; + cmp ax, 4 ; right ; + jne next_end + + ;Гравитационная заплатка лечит трабл - когда враг двигается слева на право то пролетает один пустой блок + mov word bx, [X_enemy] ; Это условие позволяет добежать до позиции напротив блока + and ebx, 31 ; X в позиции напротив блока + cmp bx, 0 ; + jne n4_dalee ; + mov bx,[lab_enemy] + add bx,16 + mov ax, [Dangeon + bx] + and eax,15 + cmp word ax, 0 + je next_end + cmp word ax, 4 + je next_end + ;конец заплатки + + n4_dalee: + ; + add word [X_enemy], 1 ; + mov word ax, [X_enemy] ; + mov word bx, [Lab2] ; + add word bx, 2 ; X кооридината данного врага + mov word [Enemy + bx], ax ; + ; + next_end: + ;END БЛОК ПРИРОСТА ДВИЖЕНИЯ ВРАГ + + ; + + ; Рандомный выбор на леснице + mov word bx, [X_enemy] ; Это условие позволяет добежать до позиции напротив блока + and ebx, 31 ; X в позиции напротив блока + cmp bx, 0 ; + jne end_les ; + mov word bx, [Y_enemy] ; Это условие позволяет добежать до позиции напротив блока + and ebx, 31 ; X в позиции напротив блока + cmp bx, 0 ; + jne end_les ; + + random 300, eax + + cmp eax, 150 + ja les2 + jmp end_up_or_down + les2: + + mov eax, [Ypl] + cmp eax, [Y_enemy] + jna bolee + mov word [mov_enemy],2 ; вниз + mov word ax, [mov_enemy] ; + mov word bx, [Lab2] ; + add word bx, 8 ; направление движения данного врага + mov word [Enemy + bx], ax ; + jmp end_les + + bolee: + mov word [mov_enemy],3 ; up + mov word ax, [mov_enemy] ; + mov word bx, [Lab2] ; + add word bx, 8 ; направление движения данного врага + mov word [Enemy + bx], ax ; + jmp end_les + + end_up_or_down: + + random 300, eax + cmp eax, 150 + ja les22 + jmp end_les + les22: + + mov eax, [Xpl] + cmp eax, [X_enemy] + jna bolee2 + mov word [mov_enemy],4 ; вниз + mov word ax, [mov_enemy] ; + mov word bx, [Lab2] ; + add word bx, 8 ; направление движения данного врага + mov word [Enemy + bx], ax ; + jmp end_les + + bolee2: + mov word [mov_enemy],1 ; up + mov word ax, [mov_enemy] ; + mov word bx, [Lab2] ; + add word bx, 8 ; направление движения данного врага + mov word [Enemy + bx], ax ; + + end_les: + ; end Рандомный выбор на леснице + + ;Гравитация + mov word bx, [X_enemy] ; Это условие позволяет добежать до позиции напротив блока + and ebx, 31 ; X в позиции напротив блока + cmp bx, 0 ; + jne end_grava ; + + mov bx,[lab_enemy] + add bx,16 + mov ax, [Dangeon + bx] + + and eax,15 + cmp word ax, 0 + je grava + cmp word ax, 4 + je grava + jmp end_grava + grava: + mov word [mov_enemy], 2 ; padenie ВРАГА + mov word ax, [mov_enemy] ; + mov word bx, [Lab2] ; + add word bx, 8 ; направление движения данного врага + mov word [Enemy + bx], ax ; + + end_grava: + ;конец гравитации + + ;блок расчета положения врага в лабиринте + mov eax, 0 ; + mov eax, [Y_enemy] ; + shr eax, 5 ; + shl eax, 4 ; + mov ebx, 0 ; + mov ebx, [X_enemy] ; + shr ebx, 5 ; + add eax, ebx ; + mov [lab_enemy], eax ; + mov word bx, [Lab2] ; + add word bx, 6 ; направление движения данного врага + mov word [Enemy + bx], ax ; + ;блок расчета положения врага в лабиринте + + + + + + + ;БЛОК ЗПАПРЕТА ДВижения + mov word bx, [Y_enemy] ; Это условие позволяет добежать до позиции напротив блока + and bx, 31 ; Y в позиции напротив блока + cmp bx, 0 ; + jne end_zapret ; + mov word ax, [X_enemy] ; Это условие позволяет добежать до позиции напротив блока + and ax, 31 ; X в позиции напротив блока + cmp ax, 0 ; + jne end_zapret ; + + mov word ax, [mov_enemy] ; Это условие позволяет добежать до позиции напротив блока + + cmp ax, 0 + jne duma1 + ; Рандомный выбор движения + mov eax, [timer1] + and eax, 3 + cmp eax, 0 + jne dalee_duma1 + add eax, 4 + dalee_duma1: + + mov word [mov_enemy], ax ; + mov word ax, [mov_enemy] ; + mov word bx, [Lab2] ; + add word bx, 8 ; направление движения данного врага + mov word [Enemy + bx], ax ; + + + + duma1: + cmp ax, 4 + jne duma2 ; прверка справа + mov bx,[lab_enemy] + add bx,1 + mov ax, [Dangeon + bx] + and eax,3 + cmp ax, 0 + jne duma_stop + jmp duma_end + + duma2: + cmp ax, 1 + jne duma3 ; слева + mov bx,[lab_enemy] + sbb bx,1 + mov ax, [Dangeon + bx] + and eax,3 + cmp ax, 0 + jne duma_stop + jmp duma_end + + duma3: + cmp ax, 2 + jne duma4 ; снизу + mov bx,[lab_enemy] + add bx,16 + mov ax, [Dangeon + bx] + and eax,3 + cmp ax, 0 + jne duma_stop + jmp duma_end + + duma4: + cmp ax, 3 + jne duma_stop ; сверху + + mov bx,[lab_enemy] ; если кирпич над головой + sbb bx,16 + mov ax, [Dangeon + bx] + and eax,3 + cmp ax, 0 ; если кирпич над головой + jne duma_stop + + mov bx,[lab_enemy] ; если враг не на леснице + mov ax, [Dangeon + bx] + and eax,15 + cmp ax, 8 + jne duma_stop + + jmp duma_end + + duma_stop: + + mov word [mov_enemy], 0 ; ОСТАНОВКА ВРАГА + mov word ax, [mov_enemy] ; + mov word bx, [Lab2] ; + add word bx, 8 ; направление движения данного врага + mov word [Enemy + bx], ax ; + + duma_end: + + end_zapret: + ;конец запрета + + end_mov_enemy: + + mov eax, 0 + mov word ax, [Lab2] + + cmp ax, 96 ; if eax == 0 + je cycle5_end ; jump to cycle_end: + + add word [Lab2],12 + + jmp cycle5 ; + + cycle5_end: + + +ret + +;***************************** +; HIRO +;***************************** + + hiro: + + mov ecx, [v_fire] ;стрельба + cmp ecx, 0 + je next_anima + cmp ecx, 1 + je wprawo + mov ebp,12 ; кадр + mov eax, dword [Xpl] + mov dword [X_anime], eax + mov eax, dword [Ypl] + mov dword [Y_anime], eax + call animashka + mov ecx, [timer1] ;стрельба + and ecx, 15 + cmp ecx, 0 + jne end_hiro + mov dword [v_fire], 0 + jmp end_hiro + + wprawo: + mov ebp,11 ; кадр + mov eax, dword [Xpl] + mov dword [X_anime], eax + mov eax, dword [Ypl] + mov dword [Y_anime], eax + call animashka + mov ecx, [timer1] ;стрельба + and ecx, 15 + cmp ecx, 0 + jne end_hiro + mov dword [v_fire], 0 + jmp end_hiro + + ;стрельба + jmp end_hiro + + next_anima: + mov eax, [v_mov] + cmp eax, 1 + jne next_r + mov eax,0 ; + mov eax, [Xpl]; + and eax, 15 + cmp eax, 7 ; + ja next_l1 + + mov ebp,3 ; кадр + mov eax, dword [Xpl] + mov dword [X_anime], eax + mov eax, dword [Ypl] + mov dword [Y_anime], eax + call animashka + jmp end_hiro + + next_l1: + mov ebp,5 ; кадр + mov eax, dword [Xpl] + mov dword [X_anime], eax + mov eax, dword [Ypl] + mov dword [Y_anime], eax + call animashka + pusha + mcall 55, eax, , , Music_mov ; звук выстрела + popa + + jmp end_hiro + + next_r: + cmp eax, 4 + jne next_d + + mov eax,0 ; + mov eax, [Xpl]; + and eax, 15 + cmp eax, 7 ; + ja next_d1 + + mov ebp,4 ; кадр + mov eax, dword [Xpl] + mov dword [X_anime], eax + mov eax, dword [Ypl] + mov dword [Y_anime], eax + call animashka + + pusha + mcall 55, eax, , , Music_mov ; звук выстрела + popa + jmp end_hiro + + next_d1: + mov ebp,6 ; кадр + mov eax, dword [Xpl] + mov dword [X_anime], eax + mov eax, dword [Ypl] + mov dword [Y_anime], eax + call animashka + + jmp end_hiro + + next_d: + cmp eax, 2 + jne next_u + mov ebp,13 ; кадр + mov eax, [temp2] + cmp eax, 8 + jne padaem + mov ebp,10 ; кадр + padaem: + mov eax, [temp5] + cmp eax, 8 + jne padaem2 + mov ebp,10 ; кадр + padaem2: + mov eax, dword [Xpl] + mov dword [X_anime], eax + mov eax, dword [Ypl] + mov dword [Y_anime], eax + call animashka + jmp end_hiro + + next_u: + cmp eax, 3 + jne next_s + mov eax,0 ; + mov eax, [Ypl]; + and eax, 15 + cmp eax, 7 ; + ja next_u1 + + mov ebp,10 ; кадр + mov eax, dword [Xpl] + mov dword [X_anime], eax + mov eax, dword [Ypl] + mov dword [Y_anime], eax + call animashka + jmp end_hiro + + next_u1: + mov ebp,9 ; кадр + mov eax, dword [Xpl] + mov dword [X_anime], eax + mov eax, dword [Ypl] + mov dword [Y_anime], eax + call animashka + + jmp end_hiro + + next_s: + cmp eax, 0 + jne next_s + mov ebp,17; кадр + mov eax, dword [Xpl] + mov dword [X_anime], eax + mov eax, dword [Ypl] + mov dword [Y_anime], eax + call animashka + jmp end_hiro + + end_hiro: + + ret ; END Hiro +;************** +; end HIRO +;************** + + +;**************** +; Hiro MOV +;**************** +hiro_mov: + + ;ПРЕГРАД + + ; вычисление соседних блоков + mov ebx, [hiro_lab] + sbb ebx,2 + mov eax,[Dangeon + bx] ; up + mov [temp1], ah ; temp4 + ; + add ebx,1 ; left hiro right + mov eax,[Dangeon + bx] ; temp1 temp2 temp3 + mov [temp2], ah ; + +;------------------------------------------------------------------------------- +; Сбор алмазов +;------------------------------------------------------------------------------- + mov ecx, [Ypl] ; Это условие позволяет добежать до позиции напротив блока + and ecx, 31 ; Y в позиции напротив блока + + mov edx, [Xpl] ; Это условие позволяет добежать до позиции напротив блока + and edx, 31 ; Y в позиции напротив блока + or edx,ecx ; Мы четко спозиционированы по Х и У + cmp edx, 0 + jne no_almaz + + cmp ah, 12 + jne no_almaz + xor cx, cx + add ebx,1 ; ЗАПЛАТКА !!! без нее почемуто обнуляет не алмазы а соседние блоки + mov [Dangeon + bx], ch + sbb ebx, 1 ; ЗАПЛАТКА !!! + mov ecx, [gold] + add ecx, 1 + mov [gold], ecx + pusha + mcall 55, eax, , , Music_almaz ; звук Almaz + popa + no_almaz: +;------------------------------------------------------------------------------- +; Сбор алмазов +;------------------------------------------------------------------------------- + ; down + add ebx,1 ; temp5 + mov eax,[Dangeon + bx] ; + mov [temp3], ah + + sbb ebx,16 ; !!!!!!!!!!!! + mov eax,[Dangeon + bx] ; при отсутствии библиотеки MACROS.INC ebx=17 + mov [temp4], ah + + add ebx,32 ; + mov eax,[Dangeon + bx] ; + mov [temp5], ah + ; вычисление соседних блоков + + + + + + ;разрешение на движение + mov eax,0 ; + mov eax,[v_mov2] ; + and eax,7 + and eax,2 + cmp eax, 2 + je smena + + mov ebx, [Ypl] ; Это условие позволяет добежать до позиции напротив блока + and ebx, 31 ; Y в позиции напротив блока + cmp ebx, 0 ; + jne end_tamgna ; + smena: + + mov eax,0 ; + mov eax,[v_mov2] ; + and eax,7 + and eax,2 + cmp eax, 0 + je smena2 + + mov ebx, [Xpl] ; Это условие позволяет добежать до позиции напротив блока + and ebx, 31 ; X в позиции напротив блока + cmp ebx, 0 ; + jne end_tamgna ; + + smena2: + mov eax, [v_mov2] + and eax, 7 + mov [v_mov], eax + end_tamgna: + ;разрешение на движение + + + ;УПИРАНИЕ В ПРЕГРАДУ + mov ebx, [Ypl] ; + and ebx, 31 ; Y в позиции напротив блока + cmp ebx, 0 ; + jne end_stop ; + mov eax, [Xpl] ; без макроса этого блока не было он был внутри блока упираний + and eax, 31 ; X в позиции напротив блока + cmp eax, 0 ; + jne end_stop ; + mov eax, [v_mov] + + cmp eax, 2 + je stop_d + jmp stop_u + + stop_d: + mov ebx, [temp5] + ;заплатка 2 равно 1 если бетон то это как кирпич, иначе герой проходит сквозь бетон + + cmp ebx, 2 + jne no_zaplat1 + + sbb ebx,1 + + no_zaplat1: + + and ebx,3 + or eax, ebx + + cmp eax, 2 + je end_stop + mov ebx, 0 + mov [v_mov], ebx + + stop_u: + cmp eax, 3 + jne stop_l + + mov ebx, [temp4] + and ebx,3 + and eax, ebx + + ; mov ebx, [Ypl] ; Это условие позволяет добежать до позиции напротив блока + ; and ebx, 31 ; Y в позиции напротив блока + ; cmp ebx, 0 ; + ; jne end_stop ; + + + cmp eax, 0 + je end_stop + mov ebx, 0 + mov [v_mov], ebx + + stop_l: + cmp eax, 1 + jne stop_r + + mov ebx, [temp1] + and ebx,3 + + ; mov eax, [Xpl] ; Это условие позволяет добежать до позиции напротив блока + ; and eax, 31 ; Y в позиции напротив блока + ; cmp eax, 0 ; + ; jne end_stop ; + + cmp ebx, 0 + je end_stop + mov ebx, 0 + mov [v_mov], ebx + + stop_r: + cmp eax, 4 + jne end_stop + + mov ebx, [temp3] + and ebx,3 + + cmp ebx, 0 + je end_stop + mov ebx, 0 + mov [v_mov], ebx + + end_stop: + ;ПРЕГРАДЫ + + + ;GRAVITACION + mov ebx, [Ypl] ; Это условие позволяет добежать до позиции напротив блока + and ebx, 31 ; Y в позиции напротив блока + + mov eax, [Xpl] ; Это условие позволяет добежать до позиции напротив блока + and eax, 31 ; Y в позиции напротив блока + or eax,ebx ; Мы четко спозиционированы по Х и У + cmp eax, 0 + jne end_grav + + mov ebx, [temp2] ; + cmp ebx, 0 ; запрет на прыжки вверх + jne end_grav ; + mov ebx, [v_mov] ; + cmp ebx, 3 ; + jne dalee_gra ; + mov ebx, 0 ; + mov [v_mov],ebx ; + mov ebx, 0 ; + mov [v_mov2],ebx ; + + dalee_gra: + add eax, [temp5] ; + cmp eax, 0 ; падение в пустоту + jne dalee_g ; + mov eax, 2 ; + mov [v_mov],eax ; + mov eax, 0 ; + mov [v_mov2],eax ; + + dalee_g: + cmp eax, 4 ; + jne dalee_g2 ; падение в воду + mov eax, 2 ; + mov [v_mov],eax ; + mov eax, 0 ; + mov [v_mov2],eax ; + + dalee_g2: + cmp eax, 12 ; + jne end_grav ; падение на алмаз + mov eax, 2 ; + mov [v_mov],eax ; + mov eax, 0 ; + mov [v_mov2],eax ; + + end_grav: + ;end GRAVITACION + + + + + ; ПРИРОСТ КООРДИНАТ ГЕРОЯ + mov eax,0 ; + mov eax,[v_mov] ; + cmp eax, 2 ; + je h_down ; + jmp proverka2 ; + jmp hiro_mov_end ; + h_down: ; + mov ebx, [Ypl] ; + add ebx, 2 ; 3 + mov [Ypl], ebx ; 1 4 + jmp hiro_mov_end ; + ; + proverka2: ; + cmp eax, 3 ; ; + je h_up ; PRIROST X Y + jmp proverka3 ; + jmp hiro_mov_end ; + h_up: ; + mov ebx, [Ypl] ; + sbb ebx, 2 ; + mov [Ypl], ebx ; + jmp hiro_mov_end ; + ; + proverka3: ; + cmp eax, 1 ; ; + je h_left ; + jmp proverka4 ; + jmp hiro_mov_end ; + h_left: ; + mov ebx, [Xpl] ; + sbb ebx, 2 ; + mov [Xpl], ebx ; + jmp hiro_mov_end ; + ; + proverka4: ; + cmp eax, 4 ; + je h_right ; + jmp hiro_mov_end ; + jmp hiro_mov_end ; + h_right: ; + mov ebx, [Xpl] ; + add ebx, 2 ; + mov [Xpl], ebx ; + jmp hiro_mov_end ;прирост + ; ПРИРОСТ КООРДИНАТ ГЕРОЯ + + hiro_mov_end: + + ; вычисляем положение героя в лабиринте + mov eax, 0 ; + mov dword eax, [Ypl] ; + shr eax, 5 ; + shl eax, 4 ; + mov ebx, 0 ; + mov dword ebx, [Xpl] ; + shr ebx, 5 ; + add eax, ebx ; + mov [hiro_lab], eax ; + ; вычисляем положение героя в лабиринте +ret +;**************** +; end Hiro mov +;**************** + + +;******************************************* +; BULLET +;******************************************* + bullet_mas: + mov word [Lab3], 0 ; все делать в WORD один элемент в массиве +2 следующий враг соотвтетственно 6*2= + 12 + cycle7: + mov word bx, [Lab3] + mov word ax, [Bullet+bx] ; берет байт из Enemy + смещение + + cmp ax, 1 ; bullet ok + je go_bullet + + jmp end_bullet + go_bullet: + + add word bx, 2 ; X кооридината данного врага + mov word ax, [Bullet + bx] + mov word [X_bul], ax + + add word bx, 2 ; X кооридината данного врага + mov word ax, [Bullet + bx] + mov word [Y_bul], ax + + imgtoimg img_bullet, dword [X_bul], dword [Y_bul],canvas + end_bullet: + + mov eax, 0 + mov word ax, [Lab3] + + cmp ax, 36 ; if eax == 0 + je cycle7_end ; jump to cycle_end: + + add word [Lab3],12 + + jmp cycle7 ; + + cycle7_end: + ret ; end BULLET +;------------------------------------------------------------------------------- + + +;******************************************* +; BULLET MOV +;******************************************* + bullet_mov: + mov word [Lab3], 0 ; все делать в WORD один элемент в массиве +2 следующий враг соотвтетственно 6*2= + 12 + + cycle8: + mov word bx, [Lab3] + mov word ax, [Bullet+bx] ; берет байт из Enemy + смещение + + cmp ax, 1 ; bullet ok + je go_bullet_mov + + jmp end_bullet_mov + go_bullet_mov: + + add word bx, 2 ; X кооридината данного врага + mov word ax, [Bullet + bx] + mov word [X_bul], ax + + add word bx, 2 ; X кооридината данного врага + mov word ax, [Bullet + bx] + mov word [Y_bul], ax + + add word bx, 2 ; + mov word ax, [Bullet + bx] + mov word [mov_bullet], ax + + cmp ax, 1 + jne bul_muv_left + mov word ax, [X_bul] + sbb ax, 2 + mov word bx, [Lab3] + add word bx, 2 + mov word [Bullet + bx], ax + + jmp end_bullet_mov + bul_muv_left: + mov word ax, [X_bul] + add ax, 2 + mov word bx, [Lab3] + add word bx, 2 + mov word [Bullet + bx], ax + + end_bullet_mov: + + ; вычисляем положение BULLET в лабиринте + mov eax, 0 ; + mov eax, [Y_bul] ; + shr eax, 5 ; + shl eax, 4 ; + mov ebx, 0 ; + mov ebx, [X_bul] ; + shr ebx, 5 ; + add eax, ebx ; + mov [lab_bullet], ax ; + ; вычисляем положение BULLET в лабиринте + + mov word bx,[lab_bullet] + mov dx, [Dangeon + bx] + and edx,3 + cmp dx, 0 + je letit_dalee + + cmp dx, 2 + je beton + mov byte [Dangeon + bx], 3 ; РАЗРУШЕНИЕ КИРПИЧЕЙ + beton: + mov bx, [Lab3] + mov byte [Bullet + ebx], 0 ; берет байт из Enemy + смещение + + + + + + letit_dalee: + mov eax, 0 + mov word ax, [Lab3] + + cmp ax, 36 ; if eax == 0 + je cycle8_end ; jump to cycle_end: + + add word [Lab3],12 + + jmp cycle8 ; + + cycle8_end: + + +ret ; end BULLET +;------------------------------------------------------------------------------- + +;------------------------------------------------------------------------------- +; TABLO TABLO TABLO TABLO TABLO TABLO +;***************************************** + tablo: + ; WIWOD CIFR + ;; mov eax, 13 + ; mov ebx, 140*65536 + 18 + ; mov ecx, 10*65536 + 8 + ; mov edx, 0x00ffffff + ; int 0x40 + ; outcount [numer_level],140,10,0x224466,3*65536 + + ; WIWOD CIFR + ; mov eax, 13 + ; mov ebx, 160*65536 + 18 + ; mov ecx, 10*65536 + 8 + ; mov edx, 0x00ffffff + ; int 0x40 + ; outcount [delta_level],160,10,0x224466,3*65536 + + ; WIWOD CIFR + ; mov eax, 13 + ; mov ebx, 180*65536 + 18 + ; mov ecx, 10*65536 + 8 + ; mov edx, 0x00ffffff + ; int 0x40 + ; outcount [delta_level_end],180,10,0x224466,3*65536 + + ret +;------------------------------------------------------------------------------- +fire: + sbb ah, 121 + mov [v_fire], ah + + mov word bx, 0 + mov cx, [Bullet + ebx] + cmp cx, 0 + jne end_fire + pusha + mcall 55, eax, , , Music_bah ; звук выстрела + popa + + mov byte [Bullet + ebx], 1 + + add word bx, 2 ; X кооридината данного врага + mov ax, [Xpl] + add ax, 8 + mov word [Bullet + ebx],ax + + add word bx, 2 ; X кооридината данного врага + mov ax, [Ypl] + add ax, 16 + mov word [Bullet + ebx],ax + + add word bx, 2 ; + mov ax,[v_fire] + mov word [Bullet + ebx],ax + + end_fire: +ret +;------------------------------------------------------------------------------- + + +;------------------------Загрузка уровней--------------------------------------- +load_level: + imgtoimg img_level,32,32,canvas + setimg 6,20,canvas + + xor eax,eax + xor ebx,ebx + xor edx,edx + xor ecx,ecx + mov dword [Bullet], eax + mov dword [Bullet+2], eax + mov dword [Bullet+4], eax + mov dword [Bullet+6], eax + mov dword [Bullet+8], eax + mov dword [Bullet+10], eax + mov byte [Lab], 1 + mov [lab_bullet], eax + mov [mov_bullet], eax + mov [X_bul], eax + mov [Y_bul], eax + mov [gold], eax + mov dword [Xpl], 32 + mov dword [Ypl], 448 + mov dword [hiro_lab],0 ; проекция героя в лабиринт + mov dword [v_mov], 0 + mov dword [v_mov2], 0 + mov dword [v_fire], 0 + + xor eax,eax + mov eax, [numer_level] + shl eax, 8 + mov dword [delta_level], eax + add eax, 256 + mov dword [delta_level_end], eax + + cycleL: + + xor ebx, ebx + mov ebx, [Lab] + add ebx, [delta_level] + mov ax,[Dangeon2 + ebx] ; берет байт из дангеон + смещение + + sbb ebx, [delta_level] + mov [Dangeon + ebx], ax ; берет байт из дангеон + смещение + add word [Lab],1 + mov eax, [Lab] + + + cmp eax, [delta_level_end] ; if eax == 0 + je cycleL_end ; jump to cycle_end: + jmp cycleL ; + cycleL_end: + + mov eax, 0 + mov [Lab],eax + + call enemy_plaz + +ret +;------------------------------------------------------------------------------- + +;************************************ +;GOLD +proverka_gold: +mov eax, [gold] + cmp ax, 10 + jna net_deneg + mov eax, [temp2] ; добежать до двери + cmp ax, 16 + jne net_deneg + mov ax, [numer_level] ; увеличение левела + + add ax, 1 + mov [numer_level], ax + mov [demon_kolvo], ax ; + + call load_level + delay 100 + + net_deneg: +ret + +;------------------------------------------------------------------------------- +; УТОП +potop: + mov eax, [temp2] ; добежать до двери + cmp ax, 4 + jne jiwoy + mov dword [gold], 0 ; увеличение левела + + call load_level + delay 100 + jiwoy: +ret + +;************************************ +;положение врагов на новом уровне +enemy_plaz: + mov word [Lab2], 0 ; все делать в WORD один элемент в массиве +2 следующий враг соотвтетственно 6*2= + 12 + mov ax, [demon_kolvo] + mov [demon], ax + + cycle55: + mov ebx, 0 + mov ecx, 0 + mov edx, 0 + mov esi, 0 + + mov cx, [demon] + cmp cx, 0 + je end_demon + mov word bx, [Lab2] ; + mov word [Enemy + bx], 1 ; + sbb cx, 1 + mov [demon], cx + end_demon: + + random 14, eax + add eax, 1 + shl eax,5 + mov word bx, [Lab2] ; + add word bx, 2 ; X кооридината данного врага + mov word [Enemy + bx], ax ; + ; + random 12, eax + add eax, 1 + shl eax,5 + mov word bx, [Lab2] ; + add word bx, 4 ; Y кооридината данного врага + mov word [Enemy + bx], ax ; + + mov word bx, [Lab2] ; + add word bx, 8 ; направление движения + mov word [Enemy + bx], 0 ; + add word bx, 2 ; жизнь + mov word [Enemy + bx], 500 ; + + + mov eax, 0 + mov word ax, [Lab2] + + cmp ax, 96 ; if eax == 0 + je cycle55_end ; jump to cycle_end: + + add word [Lab2],12 + + jmp cycle55 ; + + cycle55_end: + +ret + + +I_END: ; конец программы + + + +;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + Xpl: dd 32 ; координаты героя + Ypl: dd 448 + hiro_lab: dd 0 ; проекция героя в лабиринт + numer_level: dd 0 + delta_level: dd 0 + delta_level_end: dd 256 + demon: dd 0 + demon_kolvo: dd 1 + + gold: dd 0 + + X_enemy: dd 0 + Y_enemy: dd 0 + + + X_bul: dd 0 + Y_bul: dd 0 + + X_anime: dd 0 + Y_anime: dd 0 + + mov_bullet: dw 0 + lab_bullet: dw 0 + mov_enemy: dw 0 + lab_enemy: dw 0 + life_enemy: dw 0 + + anime : dd 0 ; переменная для анимации героя и пр + anime2 : dd 0 ; переменная для анимации героя и пр + + temp1: dd 0 + temp2: dd 0 + temp3: dd 0 + temp4: dd 0 + temp5: dd 0 + + + v_mov: dd 0 ; направления движения персонажа + v_mov2: dd 0 ; направления движения персонажа + v_fire: dd 0 ; направления движения персонажа + Lab: dd 0 + Lab2: dw 0 + Lab3: dw 0 + perem1: dd 0 + perem2: dd 0 + + timer1 dd 0 ; таймер используемый для анимации воды, врагов --- бегает от 0 до 10 + +;------------------------------------------------------------------------------- +;1 обычная стена, 2 непробиваемая, 4 вода, 8 лесница, 12 алмаз, 0 пустота 16 - exit +;------------------------------------------------------------------------------- +Dangeon: + db 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2 + db 2,1,1,1,1,1,1,0,12,0,0,0,0,0,0,2 + db 2,0,12,12,0,0,0,8,1,8,1,1,1,0,0,2 + db 2,8,1,1,1,1,1,8,1,8,0,0,0,0,0,2 + db 2,8,0,0,0,0,0,8,1,8,2,4,4,2,0,2 + db 2,8,2,4,4,4,2,8,1,8,2,2,2,2,0,2 + db 2,0,2,2,2,2,2,8,1,8,0,0,0,0,0,2 + db 2,0,1,0,0,0,0,8,1,1,1,1,1,1,8,2 + db 2,0,1,1,8,1,1,1,0,0,0,0,0,0,8,2 + db 2,12,1,1,8,0,12,0,1,8,1,1,8,1,1,2 + db 2,0,0,0,8,8,1,8,0,8,0,0,0,0,0,2 + db 2,12,1,8,1,8,1,1,8,1,1,1,1,1,1,2 + db 2,0,1,8,12,12,0,0,0,0,0,0,0,0,0,2 + db 2,0,1,1,1,1,1,8,1,1,1,0,0,0,0,2 + db 2,0,0,0,12,0,0,8,0,0,0,16,0,12,12,2 + db 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2 + +Dangeon2: + db 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2 + db 2,1,1,0,1,1,1,0,12,0,0,0,0,0,0,2 + db 2,0,12,12,0,0,0,8,1,8,1,1,1,0,0,2 + db 2,8,1,1,1,1,1,8,1,8,0,0,0,0,0,2 + db 2,8,0,0,0,0,0,8,1,8,2,4,4,2,0,2 ;0 + db 2,8,2,4,4,4,2,8,1,8,2,2,2,2,0,2 + db 2,0,2,2,2,2,2,8,1,8,0,0,0,0,0,2 + db 2,0,1,0,0,0,0,8,1,1,1,1,1,1,8,2 + db 2,0,1,1,8,1,1,1,0,0,0,0,0,0,8,2 + db 2,12,1,1,8,0,12,0,1,8,1,1,8,1,1,2 + db 2,0,0,0,8,8,1,8,0,8,0,0,0,0,0,2 + db 2,12,1,8,1,8,1,1,8,1,1,1,1,1,1,2 + db 2,0,1,8,12,12,0,0,0,0,0,0,0,0,0,2 + db 2,0,1,1,1,1,1,8,1,1,1,0,0,0,0,2 + db 2,0,0,0,12,0,0,8,0,0,0,16,0,12,12,2 + db 2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2 + db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2;------------------------------------------------------------------------------- + db 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2 + db 2,0,0,0,0,0,0,0,0,0,0,16,0,0,0,2 + db 2,12,1,8,1,0,0,0,0,0,0,1,8,0,0,2 + db 2,0,1,8,1,0,0,0,0,0,0,1,0,8,0,2 ;1 + db 2,12,1,8,1,1,0,0,0,0,1,1,0,8,0,2 + db 2,0,1,8,1,0,12,12,12,12,0,1,8,8,0,2 + db 2,12,1,8,1,0,1,1,1,1,0,1,8,0,0,2 + db 2,0,1,8,0,0,0,0,0,0,0,0,8,0,0,2 + db 2,0,1,1,1,1,8,1,8,1,1,1,1,1,8,2 + db 2,0,0,0,12,0,8,0,8,0,0,0,12,0,8,2 + db 2,0,1,1,1,1,1,0,1,8,1,1,8,1,1,2 + db 2,0,0,0,0,0,0,0,0,8,1,0,8,0,0,2 + db 2,0,1,1,1,1,1,8,1,1,1,1,1,1,8,2 + db 2,0,0,12,0,0,0,8,0,0,12,0,0,0,8,2 + db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2;------------------------------------------------------------------------------- + db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 + db 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2 + db 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2 + db 2,0,0,0,0,0,0,0,0,12,0,12,0,0,0,2 + db 2,0,0,0,0,0,0,8,1,1,1,1,1,1,0,2 ;2 + db 2,0,8,0,12,12,0,8,0,0,0,0,0,2,4,2 + db 2,0,8,1,1,1,1,0,0,0,0,0,0,2,2,2 + db 2,0,8,0,0,0,0,12,1,1,1,1,0,0,0,2 + db 2,0,8,1,0,1,0,12,0,0,0,0,0,0,0,2 + db 2,0,8,0,1,1,12,12,0,0,0,8,1,1,1,2 + db 2,0,8,0,12,0,0,12,0,0,0,8,0,12,0,2 + db 2,0,8,0,0,0,8,1,8,0,0,1,8,1,8,2 + db 2,0,8,0,0,8,1,1,1,8,0,0,8,0,8,2 + db 2,0,1,1,1,1,1,1,1,1,1,1,1,1,8,2 + db 2,0,0,0,0,0,0,0,16,0,0,0,0,0,8,2 + db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2;------------------------------------------------------------------------------- + db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 + db 2,0,0,0,0,12,0,0,0,0,0,0,16,0,0,2 + db 2,0,8,1,1,1,1,1,1,1,1,1,1,1,0,2 + db 2,0,8,0,0,0,0,0,12,0,0,0,0,0,0,2 + db 2,0,8,0,0,0,0,1,8,1,0,0,0,0,0,2 + db 2,0,8,0,0,0,1,1,8,1,1,0,0,0,0,2 + db 2,0,8,0,12,1,1,1,8,1,1,1,12,0,0,2 + db 2,0,8,0,1,1,12,1,8,1,12,1,1,0,0,2 + db 2,0,0,1,1,1,1,1,8,1,1,1,1,0,0,2 ;3 + db 2,0,1,0,0,0,0,0,8,1,0,0,0,1,0,2 + db 2,0,1,0,1,1,1,1,8,1,1,1,0,1,0,2 + db 2,0,1,1,12,1,12,1,8,1,1,1,0,1,0,2 + db 2,0,1,1,1,1,1,1,8,1,1,1,0,1,0,2 + db 2,0,1,1,12,1,12,1,8,1,1,1,12,1,0,2 + db 2,0,0,0,0,0,0,0,8,0,0,0,0,0,0,2 + db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2;------------------------------------------------------------------------------- + db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 + db 2,0,12,0,0,0,0,0,0,0,0,0,16,0,0,2 + db 2,0,1,8,1,1,1,1,1,1,8,1,1,1,8,2 + db 2,0,0,8,0,0,0,0,0,0,8,0,0,0,8,2 + db 2,0,1,1,1,1,1,8,1,1,1,1,1,1,0,2 + db 2,0,0,12,0,0,12,8,0,0,12,0,0,0,0,2 + db 2,12,1,1,1,8,1,1,1,1,8,1,1,1,8,2 + db 2,0,0,0,0,8,0,0,0,0,8,0,0,0,8,2 + db 2,8,1,1,1,1,1,1,8,1,1,1,1,1,0,2 ;4 + db 2,8,0,0,0,12,0,0,8,0,0,12,0,0,0,2 + db 2,0,1,8,1,1,1,1,1,1,1,1,8,1,0,2 + db 2,0,0,8,12,0,0,0,0,12,0,0,8,0,0,2 + db 2,8,1,1,1,1,1,1,8,1,1,1,1,1,8,2 + db 2,8,12,0,0,0,0,0,0,0,0,0,0,12,8,2 + db 2,8,2,4,4,4,4,4,4,4,4,4,4,2,8,2 + db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2;------------------------------------------------------------------------------- + db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 + db 2,8,1,8,12,8,1,8,1,8,1,8,1,8,1,2 + db 2,8,2,8,1,8,1,8,1,8,1,8,12,8,12,2 + db 2,8,1,8,1,8,2,8,12,8,1,8,1,8,1,2 + db 2,8,12,8,0,8,0,8,0,8,0,8,0,8,0,2 + db 2,1,8,1,1,1,1,1,8,1,1,1,1,1,8,2 + db 2,0,8,0,0,0,0,0,8,0,0,12,0,0,8,2 + db 2,0,8,12,0,2,12,0,8,1,1,1,1,1,8,2 + db 2,0,1,1,8,1,1,1,8,0,0,0,0,0,8,2 ;5 + db 2,0,1,0,8,0,0,0,8,0,0,12,0,0,8,2 + db 2,0,1,0,8,0,0,0,8,1,1,1,1,1,8,2 + db 2,0,1,12,8,0,0,2,8,0,0,0,0,0,8,2 + db 2,8,1,1,1,1,8,1,1,1,1,8,1,1,1,2 + db 2,8,0,0,0,0,8,2,0,0,2,8,0,0,0,2 + db 2,0,8,0,12,8,8,2,4,4,2,8,0,0,16,2 + db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2;------------------------------------------------------------------------------- + db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 + db 2,0,8,0,8,0,8,0,8,0,0,8,0,8,16,2 + db 2,1,8,1,8,1,8,1,8,1,1,8,1,8,1,2 + db 2,0,8,0,8,0,8,0,8,8,0,8,0,8,0,2 + db 2,1,1,8,1,1,1,1,1,8,1,1,8,1,1,2 + db 2,0,0,8,8,0,12,8,0,8,8,12,8,8,0,2 + db 2,1,1,1,8,1,1,8,1,1,8,1,1,8,1,2 + db 2,0,8,0,8,0,12,8,0,0,8,0,12,8,0,2 ;6 + db 2,1,8,1,1,1,1,1,8,1,1,1,1,1,1,2 + db 2,0,8,0,12,8,0,0,8,12,0,8,0,0,0,2 + db 2,1,8,1,1,8,1,1,8,1,1,8,1,1,1,2 + db 2,0,0,8,0,8,8,0,8,8,0,8,8,0,0,2 + db 2,1,1,8,1,1,8,1,1,8,1,1,8,1,1,2 + db 2,0,0,8,12,0,8,0,12,8,0,12,8,12,12,2 + db 2,8,8,1,1,1,1,1,1,1,1,1,1,1,1,2 + db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2;------------------------------------------------------------------------------- + db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 + db 2,0,12,0,12,0,12,0,0,12,0,12,0,0,0,2 + db 2,1,1,1,8,1,1,1,1,1,1,8,1,1,1,2 + db 2,0,0,0,8,0,0,12,0,0,0,8,0,0,0,2 + db 2,1,1,1,1,1,1,1,8,1,1,1,1,1,1,2 + db 2,0,0,0,12,0,0,0,8,12,0,0,0,0,0,2 + db 2,1,1,1,8,1,1,1,1,1,1,8,1,1,1,2 + db 2,0,0,0,8,0,0,0,0,0,0,8,0,0,0,2 ; 7 + db 2,1,1,1,1,1,1,1,1,1,1,1,1,8,1,2 + db 2,0,0,0,0,0,0,0,0,0,0,0,0,8,0,2 + db 2,1,1,1,1,1,1,8,1,1,1,1,1,8,1,2 + db 2,0,0,0,0,0,0,8,0,0,0,0,0,8,0,2 + db 2,1,1,8,1,8,1,1,8,1,8,1,1,1,1,2 + db 2,0,0,8,0,8,12,0,8,0,8,12,0,0,16,2 + db 2,8,1,1,1,1,1,1,1,1,1,1,1,1,1,2 + db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2;------------------------------------------------------------------------------- + db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 + db 2,0,0,0,0,0,0,0,0,0,0,0,0,16,0,2 + db 2,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2 + db 2,0,8,0,8,0,12,0,0,8,0,8,0,0,0,2 + db 2,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2 + db 2,0,0,8,12,0,0,8,0,0,8,0,0,0,0,2 + db 2,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2 + db 2,0,0,0,0,0,0,0,0,8,0,0,0,12,0,2 + db 2,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2 + db 2,0,8,0,0,0,8,12,0,0,8,0,8,12,0,2 + db 2,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2 + db 2,0,0,8,0,0,0,0,12,8,0,12,8,0,0,2 + db 2,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2 + db 2,0,0,8,0,8,12,0,0,8,12,0,8,12,0,2 + db 2,8,8,8,8,8,8,8,8,8,8,8,8,8,8,2 + db 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2;------------------------------------------------------------------------------- + + +;------------------------------------------------------------------------------- +Bullet: dw 0,0,0,0,0,0 + dw 0,0,0,0,0,0 + dw 0,0,0,0,0,0 + dw 0,0,0,0,0,0 +;------------------------------------------------------------------------------- + + +Enemy: dw 1,448,128,0,0,500 ;враги класс,Х,У,положение в лабиринте,направление движения,жизнь + dw 0,32,32,0,0,0 + dw 0,64,32,0,0,0 + dw 0,416,32,0,0,0 + dw 0,256,256,0,0,0 + dw 0,256,224,0,0,0 + dw 0,320,192,0,0,0 + dw 0,32,256,0,0,0 + dw 0,448,448,0,0,0 + +;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +bullet_bmp: +file 'bullet.bmp' +rb 1 + +level_bmp: +file 'level2.bmp' +rb 1 + +kirpich: +file 'kirpich.bmp' +rb 1 + +kirpich3: +file 'kirpich2.bmp' +rb 1 + +kirpich2: +file 'oldkirpich.bmp' +rb 1 + +lest_bmp: +file 'lestnica.bmp' +rb 1 + +water1_bmp: +file 'water1.bmp' +rb 1 + +water2_bmp: +file 'water2.bmp' +rb 1 + +door1_bmp: +file 'door1.bmp' +rb 1 + +door2_bmp: +file 'door2.bmp' +rb 1 + + +img_level: +rb 448*448*3+8 + +;img_ded1: +;rb 448*448*3+8 + +img_area: +rb 32*32*3+8 + +img_area2: +rb 32*32*3+8 + +img_area3: +rb 32*32*3+8 + +img_bullet: +rb 4*8*3+8 + +img_lestniza: +rb 32*32*3+8 + +img_water1: +rb 32*32*3+8 + +img_water2: +rb 32*32*3+8 + +img_door1: +rb 32*32*3+8 + +img_door2: +rb 32*32*3+8 + +img_enemy1: +rb 32*32*3+8 + +img_enemy2: +rb 32*32*3+8 + + +Music_bah: + db 0x0f, 0x09, 0 + +Music_mov: + db 0x00, 0x00, 0 + +Music_almaz: + db 0x09, 0x03, 0 + +entered rd 1 + +imgcount rd 1 ; кол-во всего кадров в анимации +img_index rd 1 ; номер текущего кадра + +;hashtable rd 4096 ; рабочая область для РеадГИФ процедуры +workarea: +file 'aniall.gif' + + +;temp rb 0x100000 ; место для ГИФ фаила +rb 10 + +canvas: +xs dd 512 +ys dd 512 + rb 512*512*3 + +gif_hash_area: +rd 4096+1 + +coords: +rd 2 + +Image: diff --git a/programs/games/almaz/ASCGL.INC b/programs/games/almaz/ASCGL.INC new file mode 100644 index 0000000000..d637dc2f56 --- /dev/null +++ b/programs/games/almaz/ASCGL.INC @@ -0,0 +1,1385 @@ +lang equ ru + +; +; Assembler +; SMALL +; CODE +; Graphics +; Libary +; +; Ver 0.18 By Pavlushin Evgeni (RUSSIA) +; www.waptap@mail.ru + +;InfoList +;0.01 LoadImage +;0.02 SetBmp +;0.03 Bmptoimg, Setimg ~01.03.2004 +;0.04 Bug deleted, copyimg ~03.05.2004 +;0.05 fullimg, collimg ~05.05.2004 +;0.06 getimg ~09.05.2004 +;0.07 convbmp ~13.05.2004 +;0.08 fps ~14.05.2004 +;0.09 drawfbox ~03.06.2004 +;0.10 all macros optimized by halyavin, add at ~07.06.2004 +;0.11 many macros optimized by halyavin, add at ~30.08.2004 +;0.12 bmptoimg ~07.09.2004 +;0.13 imgtoimg ~08.09.2004 +;0.14 imgtoimg modify not brake bmp pict! ~09.09.2004 +;0.15 giftoimg, giftoani ~10.09.2004 +;0.16 setframe, rgbtobgr, setbmp deleted ~20.09.2004 +;0.17 modification giftoimg, giftoani, getframeoff ~01.10.2004 +;0.18 aframetoimg,aimgtoimg,frametoimg ~03.10.2004 + +aframetoimg_use_count=0 +macro aframetoimg img, x, y, canvas,acol +{ +local loo,loo2,acolor +aframetoimg_use_count=aframetoimg_use_count+1 +if aframetoimg_use_count = 1 + + jmp end_aframetoimg_proc + +acolor dd 0 +aframetoimg_proc: +;getout coord + mov [acolor],ebp + + mov edx,ebx ;img ;xsize + movzx eax,word [edx] + add eax,esi ;y cor + +; mov eax,esi ;y cor + mul dword [ecx] ;canvas xsize + add eax,edi ;x cor + + mov ebp,ebx ;img ;xsize + movzx edx,word [ebp] + add eax,edx + + mov ebp,eax + shl eax,1 + add ebp,eax + add ebp,ecx ;canvas+8;start + add ebp,8 +;get img size + add ebx,4 + mov eax,ebx ;img ;xsize + movzx esi,word [eax] + movzx edi,word [eax+2] + add ebx,4 + mov edx,ebx ;img+8 +loo2: +push esi +loo: +;test on alpha color + mov eax,[edx] + shl eax,8 + shr eax,8 + cmp eax,[acolor] + jne yx + add edx,3 + add ebp,3 + jmp nx +yx: + + mov al,byte [edx] + mov byte [ebp],al + inc ebp + inc edx + mov al,byte [edx] + mov byte [ebp],al + inc ebp + inc edx + mov al,byte [edx] + mov byte [ebp],al + inc ebp + inc edx +nx: + dec esi + jnz loo +pop esi + sub ebp,3 + mov eax,[ecx] ;offset = offset+((canxsize-imgxsize)*3) + sub eax,esi + add ebp,eax + shl eax,1 + add ebp,eax + + add ebp,3 + + dec edi + jnz loo2 + ret +end_aframetoimg_proc: +end if + push img + push canvas + push x + push y + push acol + pop ebp + pop esi + pop edi + pop ecx + pop ebx + call aframetoimg_proc +} + +frametoimg_use_count=0 +macro frametoimg img, x, y, canvas +{ +local loo,loo2 +frametoimg_use_count=frametoimg_use_count+1 +if frametoimg_use_count = 1 + + jmp end_frametoimg_proc + +frametoimg_proc: +;getout coord + mov edx,ebx ;img ;xsize + movzx eax,word [edx] + add eax,esi ;y cor + +; mov eax,esi ;y cor + mul dword [ecx] ;canvas xsize + add eax,edi ;x cor + + mov ebp,ebx ;img ;xsize + movzx edx,word [ebp] + add eax,edx + + mov ebp,eax + shl eax,1 + add ebp,eax + add ebp,ecx ;canvas+8;start + add ebp,8 +;get img size + add ebx,4 + mov eax,ebx ;img ;xsize + movzx esi,word [eax] + movzx edi,word [eax+2] + add ebx,4 + mov edx,ebx ;img+8 +loo2: +push esi +loo: + mov al,byte [edx] + mov byte [ebp],al + inc ebp + inc edx + mov al,byte [edx] + mov byte [ebp],al + inc ebp + inc edx + mov al,byte [edx] + mov byte [ebp],al + inc ebp + inc edx + + dec esi + jnz loo +pop esi + sub ebp,3 + mov eax,[ecx] ;offset = offset+((canxsize-imgxsize)*3) + sub eax,esi + add ebp,eax + shl eax,1 + add ebp,eax + + add ebp,3 + + dec edi + jnz loo2 + ret +end_frametoimg_proc: +end if + push img + push canvas + push x + push y + pop esi + pop edi + pop ecx + pop ebx + call frametoimg_proc +} + + +aimgtoimg_use_count=0 +macro aimgtoimg img, x, y, canvas,acol +{ +local loo,loo2,acolor +aimgtoimg_use_count=aimgtoimg_use_count+1 +if aimgtoimg_use_count = 1 + + jmp end_aimgtoimg_proc + +acolor dd 0 +aimgtoimg_proc: +;getout coord + mov [acolor],ebp + + mov eax,esi ;y cor + mul dword [ecx] ;canvas xsize + add eax,edi ;x cor + mov ebp,eax + shl eax,1 + add ebp,eax + add ebp,ecx ;canvas+8;start + add ebp,8 +;get img size + mov eax,ebx ;img ;xsize + mov esi,[eax] + add ebx,4 + mov eax,ebx ; img+4 ;ysize + mov edi,[eax] + add ebx,4 + mov edx,ebx ;img+8 +loo2: +push esi +loo: + +;test on alpha color + mov eax,[edx] + shl eax,8 + shr eax,8 + cmp eax,[acolor] + jne yx + add edx,3 + add ebp,3 + jmp nx +yx: + + mov al,byte [edx] + mov byte [ebp],al + inc ebp + inc edx + mov al,byte [edx] + mov byte [ebp],al + inc ebp + inc edx + mov al,byte [edx] + mov byte [ebp],al + inc ebp + inc edx +nx: + dec esi + jnz loo +pop esi + sub ebp,3 + mov eax,[ecx] ;offset = offset+((canxsize-imgxsize)*3) + sub eax,esi + add ebp,eax + shl eax,1 + add ebp,eax + + add ebp,3 + + dec edi + jnz loo2 + ret +end_aimgtoimg_proc: +end if + push img + push canvas + push x + push y + push acol + pop ebp + pop esi + pop edi + pop ecx + pop ebx + call aimgtoimg_proc +} + + + + +imgtoimg_use_count=0 +macro imgtoimg img, x, y, canvas +{ +local loo,loo2 +imgtoimg_use_count=imgtoimg_use_count+1 +if imgtoimg_use_count = 1 + + jmp end_imgtoimg_proc +imgtoimg_proc: +;getout coord + mov eax,esi ;y cor + mul dword [ecx] ;canvas xsize + add eax,edi ;x cor + mov ebp,eax + shl eax,1 + add ebp,eax + add ebp,ecx ;canvas+8;start + add ebp,8 +;get img size + mov eax,ebx ;img ;xsize + mov esi,[eax] + add ebx,4 + mov eax,ebx ; img+4 ;ysize + mov edi,[eax] + add ebx,4 + mov edx,ebx ;img+8 +loo2: +push esi +loo: + mov al,byte [edx] + mov byte [ebp],al + inc ebp + inc edx + mov al,byte [edx] + mov byte [ebp],al + inc ebp + inc edx + mov al,byte [edx] + mov byte [ebp],al + inc ebp + inc edx + dec esi + jnz loo +pop esi + sub ebp,3 + mov eax,[ecx] ;offset = offset+((canxsize-imgxsize)*3) + sub eax,esi + add ebp,eax + shl eax,1 + add ebp,eax + + add ebp,3 + + dec edi + jnz loo2 + ret +end_imgtoimg_proc: +end if + push img + push canvas + push x + push y + pop esi + pop edi + pop ecx + pop ebx + call imgtoimg_proc +} + + +;DrawBox +macro drawfbox x,y,xs,ys,color +{ + wordstoreg ebx,x,xs ;x*65536+xs + wordstoreg ecx,y,ys ;y*65536+ys + mov edx,color + mov eax,13 + int 0x40 +} + +; FPS - Set Frame Per Second Display +fps_show_frequency=40 +macro fps x,y,color,delcolor +{ +local spdat,savetime,new_time,fps,fps_cntr,out_fps,new_time,ttt +local no_out_fps + jmp spdat +savetime dd 0 +fps_cntr dd 0 +fps dd 0 +ttt dd 0 +spdat: +get_time: + mov eax,3 + int 0x40 + cmp eax,[savetime] + jne new_time + inc [fps_cntr] + cmp dword [ttt],0 + je out_fps + dec dword [ttt] + jmp no_out_fps +new_time: + mov [savetime],eax + mov ebx,[fps_cntr] + mov [fps],ebx + mov [fps_cntr],0 +out_fps: +if ~(delcolor eq ) + mov ebx,x*65536+30 + mov ecx,y*65536+7 + mov edx,delcolor + mov eax,13 + int 0x40 +end if + mov dword [ttt],fps_show_frequency + mov eax,47 + mov ebx,5*65536 +; mov bl,0 + mov edx,x*65536+y + mov esi,color + mov ecx,[fps] + int 0x40 +no_out_fps: +} + +; COLLIMG - Collusion image's +_1dbounce_count=0; +macro collimg img1_off,x1,y1,img2_off,x2,y2,otv +{ +local bounce,exit,anot,bc,nbc + mov esi,[img1_off] ;xs1 + mov edi,[img2_off] ;ys2 + mov eax,x1 ; + mov ebx,x2 ; + call _1dbounce + mov edx,ecx + mov esi,[img1_off+4] ;ys1 + mov edi,[img2_off+4] ;ys2 + mov eax,y1 ; + mov ebx,y2 ; + call _1dbounce + add edx,ecx + cmp edx,2 + je bounce + mov otv,0 + jmp exit +_1dbounce_count=_1dbounce_count+1 +if _1dbounce_count = 1 +_1dbounce: + cmp ebx,eax + jb anot + add eax,esi + cmp eax,ebx + jbe nbc +bc: + mov ecx,1 + ret +anot: + add ebx,edi + cmp ebx,eax + ja bc +nbc: + xor ecx,ecx + ret +end if +bounce: + mov otv,1 +exit: +} + +macro rgbtobgr image +{ +local loo + mov eax,[image] + mul dword [image+4] + mov ecx,eax + mov esi,image+8 +; add esi,8 +loo: + mov al,[esi] + mov bl,[esi+2] + mov [esi],bl + mov [esi+2],al + add esi,3 + dec ecx + jnz loo +} + + +macro setimg x , y ,arg3 +{ + mov eax,7 + mov ebx,arg3 + add ebx,8 + mov cx,[arg3] + shl ecx,16 + add cx,[arg3+4] +; wordstoreg ecx,[arg3],[arg3+4] + wordstoreg edx, x , y ;arg1*65536+arg2 + int 0x40 +} + +macro setframe x , y ,arg3 +{ + mov eax,7 + mov ebx,arg3 + add ebx,8 + wordstoreg edx, x , y ;arg1*65536+arg2 + add edx,dword [arg3] + mov ecx,dword [arg3+4] + int 0x40 +} + + +macro getimg imgsrc,x,y,xs,ys,imgdest +{ +local cyc +if xs eqtype 0 + mov dword [imgdest],xs +else + mov eax,xs + mov dword [imgdest],eax +end if +if ys eqtype 0 + mov dword [imgdest+4],ys +else + mov eax,ys + mov dword [imgdest+4],eax +end if + + mov eax,dword [imgsrc] ;getx size +; lea ecx,[eax+2*eax] + mov ecx,eax + shl ecx,1 + add ecx,eax + + mov ebx,y + mul ebx + add eax,x + mov edx,ecx + lea eax,[eax+2*eax] ;eax=offset on imsrc +; mov ebp,eax +; shl eax,1 +; add eax,ebp + + mov ecx,xs + mov ebx,ys + + mov edi,8+imgdest + lea esi,[eax+8+imgsrc] +; mov esi,eax +; add esi,8 +; add esi,imgsrc + + cld +cyc: + movsw + movsb + dec ecx + jne cyc + add esi,edx + mov ecx,xs + sub esi,ecx + sub esi,ecx + sub esi,ecx + dec ebx + jne cyc +} + +macro copyimg img2_off,img1_off +{ + mov eax,dword [img1_off] + mov ebx,dword [img1_off+4] + mul ebx + lea ecx,[eax+2*eax] + lea esi,[img1_off+8] + lea edi,[img2_off+8] + cld + rep movsb +} + +macro fullimg img_off,xs,ys,color +{ +local cop + mov eax,xs + mov ebx,ys + mov dword [img_off],eax + mov dword [img_off+4],ebx + mul ebx + lea ebp,[eax+2*eax] + mov esi,color +if color eqtype 0 + mov ecx,color/65536 +else + mov ecx,esi + shr ecx,16 +end if + xor edi,edi +cop: + mov word [img_off+8+edi],si + add edi,2 + mov byte [img_off+8+edi],cl + inc edi + cmp edi,ebp + jne cop +} + + + + ; number of frame in ecx + ; callculatin offset of raw data + +macro getframeoff num_of_frame,offset_of_animation,offset_of_frame +{ +local loo,setpic + mov ebp,num_of_frame ;ecx + mov esi,offset_of_animation;Image +loo: + cmp ebp,0 + je setpic + movzx eax,word [esi+4] + movzx ebx,word [esi+6] + mul ebx ;dword [esi+4] + mov ebx,3 + mul ebx + add eax,8 + add esi,eax + dec ebp + jmp loo +setpic: + mov dword offset_of_frame,esi +} + + +; BMPTOIMG -Convert BMP format TO IMG format +; (SYNTAX) BMPTOIMG BMP_source_offset,IMG_dest_ofset +; (SAMPLE) View BMPLS.ASM sample. +; ( NOTE ) This is macros is not brake bmp structure! Tested in 32,8,4 bits + + +bmptoimg_data_area_count=0 +macro bmptoimg bmp_load_area,img_dest_area +{ +local fileinfo,string,end_bmp,nodix +local converttable,noaddelem,nextbit,convert1bpp,convert4bpp,convert2 +local nextelem,convertno32,nomorestring,convert1,nextstring,yespicsize +;local qwe,bmpfn + +; convert: + movzx eax,word [bmp_load_area+28] + mul dword [bmp_load_area+18] + add eax,31 + shr eax,5 + mov dword [bmptoimg_data_area_dwps],eax ;dwps-doublewords per string + shl eax,2 + mov dword [bmptoimg_data_area_bps],eax ;bps-bytes per string + + cmp dword [bmp_load_area+34],0 + jne yespicsize ;if picture size is defined + mul dword [bmp_load_area+22] + mov dword [bmp_load_area+34],eax + + yespicsize: + mov ebp,img_dest_area+8 + + mov eax,bmp_load_area + mov ebx,eax + add ebx, [bmp_load_area+2];file size + inc ebx + mov dword [bmptoimg_soi],ebx ;soi-start of image area for drawing + + add eax, [bmp_load_area+10] + mov dword [bmptoimg_data_area_sop],eax ;sop-start of picture in file + add eax, [bmp_load_area+34] + mov dword [bmptoimg_data_area_eop],eax ;eop-end of picture in file + mov eax, [bmp_load_area+18] + lea eax,[eax+2*eax] ;3x pixels in eax + + mov edi,dword [bmptoimg_soi] ;initializing + mov esi,dword [bmptoimg_data_area_eop] + sub esi,dword [bmptoimg_data_area_bps] + + + nextstring: + push edi + push ebp + cmp word [bmp_load_area+28],24 + jne convertno32 + + mov edi,ebp + mov ecx,[bmptoimg_data_area_dwps] + cld + rep movsd + + convert1: + pop ebp + pop edi + sub esi,dword [bmptoimg_data_area_bps] + sub esi,dword [bmptoimg_data_area_bps] + cmp esi,dword [bmptoimg_data_area_sop] + jb end_bmp + add edi,eax + add ebp,eax + jmp nextstring + + convertno32: + mov ebx,bmp_load_area + add ebx, [bmp_load_area+14] + add ebx,14 ;start of color table + push esi + add esi,dword [bmptoimg_data_area_bps] + mov dword [bmptoimg_data_area_eos],esi + pop esi + nextelem: + push eax + movzx eax,byte [esi] + cmp word [bmp_load_area+28],4 + je convert4bpp + cmp word [bmp_load_area+28],1 + je convert1bpp + call converttable + + convert2: + pop eax + inc esi + cmp esi,dword [bmptoimg_data_area_eos] + jae convert1 + add edi,3 + + add ebp,3 + + jmp nextelem + + convert4bpp: + shl ax,4 + shr al,4 + push ax + movzx eax,ah + call converttable + add edi,3 + + add ebp,3 + + pop ax + movzx eax,al + call converttable + jmp convert2 + + convert1bpp: + mov ecx,eax + mov edx,7 + nextbit: + xor eax,eax + bt ecx,edx + jnc noaddelem + inc eax + noaddelem: + push edx + call converttable + pop edx + dec edx + js convert2 + add edi,3 + + add ebp,3 + + jmp nextbit + + converttable: + shl eax,2 + add eax,ebx + mov edx, dword [eax] +; mov dword [edi],edx + mov [ebp],edx + ret + +bmptoimg_data_area_count=bmptoimg_data_area_count+1 +if bmptoimg_data_area_count = 1 +; DATA AREA +bmptoimg_soi dd 0 +bmptoimg_data_area_bps dd 0 +bmptoimg_data_area_dwps dd 0 +bmptoimg_data_area_sop dd 0 +bmptoimg_data_area_eop dd 0 +bmptoimg_data_area_eos dd 0 +end if + +end_bmp: + mov eax,dword [bmp_load_area+18] + mov ebx,dword [bmp_load_area+22] + mov dword [img_dest_area],eax + mov dword [img_dest_area+4],ebx +} + +; For convert RGB to BGR +COLOR_ORDER equ MENUETOS + +macro giftoani gifsrc,imgsrc,num_of_frames +{ +local hasharea, ReadGIF, nextblock,_null +local globalColor, img_count, cur_info, img_start +local codesize, compsize, bit_count, CC, EOI, Palette +local block_ofs, table_ptr, gifmacend +local no_gc, block_skip, no_comm, noextblock, uselocal +local setPal, filltable, reinit, cycle, zadd, noinc +local notintable, er, zend, nxt, continue, ex, Gif_skipmap +local Gif_get_sym, shift, nextbl, noblock, loop1, exx +local Gif_output, next, loop2 + +_null = 0x1000 ; 0x1000 + +; jmp sss +; if defined gif_hash_offset +; else +; hasharea: +; times 4096 dd 0 ;4096 +; end if +;sss: + + mov esi,gifsrc ;Указатель на ГИФ фаил в памяти + mov edi,imgsrc ;Указатель на список картинок + + if defined gif_hash_offset + mov eax,gif_hash_offset ;Рабочая область минимум 4096*4 байт + else + mov eax,hasharea ;Рабочая область минимум 4096*4 байт + end if + + call ReadGIF + push ecx + pop dword num_of_frames + jmp gifmacend + + if defined gif_hash_offset + else + hasharea: + times 4096 dd 0 ;4096 + end if + +ReadGIF: + push esi edi + mov [table_ptr],eax + mov [cur_info],edi + xor eax,eax + mov [globalColor],eax + mov [img_count],eax + inc eax + cmp dword[esi],'GIF8' + jne er ; signature + mov ecx,[esi+0xa] + inc eax + add esi,0xd + mov edi,esi + bt ecx,7 + jnc nextblock + mov [globalColor],esi + call Gif_skipmap +nextblock: + cmp byte[edi],0x21 + jne noextblock + inc edi + cmp byte[edi],0xf9 ; Graphic Control Ext + jne no_gc + add edi,7 + jmp nextblock +no_gc: + cmp byte[edi],0xfe ; Comment Ext + jne no_comm + inc edi +block_skip: + movzx eax,byte[edi] + lea edi,[edi+eax+1] + cmp byte[edi],0 + jnz block_skip + inc edi + jmp nextblock +no_comm: + cmp byte[edi],0xff ; Application Ext + jne nextblock + add edi,13 + jmp block_skip +noextblock: + cmp byte[edi],0x2c ; image beginning + jne er + inc [img_count] + inc edi + mov esi,[cur_info] + xchg esi,edi + movsd + movsd + + push edi + movzx ecx,word[esi] + inc esi + bt ecx,7 + jc uselocal + push [globalColor] + mov edi,esi + jmp setPal +uselocal: + call Gif_skipmap + push esi +setPal: + movzx ecx,byte[edi] + inc ecx + mov [codesize],ecx + dec ecx + pop [Palette] + lea esi,[edi+1] + mov edi,[table_ptr] + xor eax,eax + cld + lodsb ; eax - block_count + add eax,esi + mov [block_ofs],eax + mov [bit_count],8 + mov eax,1 + shl eax,cl + mov [CC],eax + inc eax + mov [EOI],eax + lea ecx,[eax-1] + mov eax, _null shl 16 +filltable: + stosd + inc eax + loop filltable + pop edi + mov [img_start],edi +reinit: + mov edx,[EOI] + inc edx + push [codesize] + pop [compsize] + call Gif_get_sym + cmp eax,[CC] + je reinit + call Gif_output +cycle: + movzx ebx,ax + call Gif_get_sym + cmp eax,edx + jae notintable + cmp eax,[CC] + je reinit + cmp eax,[EOI] + je zend + call Gif_output +zadd: + push eax + mov eax,[table_ptr] + mov [eax+edx*4],ebx + pop eax + cmp edx,0xFFF + jae cycle + inc edx + bsr ebx,edx + cmp ebx,[compsize] + jne noinc + inc [compsize] +noinc: + jmp cycle +notintable: + push eax + mov eax,ebx + call Gif_output + push ebx + movzx eax,bx + call Gif_output + pop ebx eax + jmp zadd +er: + pop edi + jmp ex +zend: +; mov eax,[.cur_info] ; skip offset to next frame +; mov [eax],edi + mov [cur_info],edi + add esi,2 + xchg esi,edi +nxt: + cmp byte[edi],0 + jnz continue + inc edi + jmp nxt +continue: + cmp byte[edi],0x3b ;read next frame + jne nextblock + xor eax,eax + stosd + mov ecx,[img_count] +ex: + pop edi esi + ret + +Gif_skipmap: +; in: ecx - image descriptor, esi - pointer to colormap +; out: edi - pointer to area after colormap + + and ecx,111b + inc ecx ; color map size + mov ebx,1 + shl ebx,cl + lea ebx,[ebx*2+ebx] + lea edi,[esi+ebx] + ret + +Gif_get_sym: + mov ecx,[compsize] + push ecx + xor eax,eax +shift: + ror byte[esi],1 + rcr eax,1 + dec [bit_count] + jnz loop1 + inc esi + cmp esi,[block_ofs] + jb noblock + push eax + xor eax,eax + lodsb + test eax,eax + jnz nextbl + mov eax,[EOI] + sub esi,2 + add esp,8 + jmp exx +nextbl: + add eax,esi + mov [block_ofs],eax + pop eax +noblock: + mov [bit_count],8 +loop1: + loop shift + pop ecx + rol eax,cl +exx: + xor ecx,ecx + ret + +Gif_output: + push esi eax edx + mov edx,[table_ptr] +next: + push word[edx+eax*4] + mov ax,word[edx+eax*4+2] + inc ecx + cmp ax,_null + jnz next + shl ebx,16 + mov bx,[esp] +loop2: + pop ax + + lea esi,[eax+eax*2] + add esi,[Palette] + + if COLOR_ORDER eq MENUETOS + mov esi,[esi] + bswap esi + shr esi,8 + mov [edi],esi + add edi,3 + else + movsw + movsb + end if + + loop loop2 + pop edx eax esi + ret + + globalColor dd 1 + img_count dd 1 + cur_info dd 1 ; image table pointer + img_start dd 1 + codesize dd 1 + compsize dd 1 + bit_count dd 1 + CC dd 1 + EOI dd 1 + Palette dd 1 + block_ofs dd 1 + table_ptr dd 1 + +gifmacend: +} + + + +macro giftoimg gifsrc,imgsrc +{ +local hasharea, ReadGIF, nextblock,_null +local globalColor, img_count, cur_info, img_start +local codesize, compsize, bit_count, CC, EOI, Palette +local block_ofs, table_ptr, gifmacend +local no_gc, block_skip, no_comm, noextblock, uselocal +local setPal, filltable, reinit, cycle, zadd, noinc +local notintable, er, zend, nxt, continue, ex, Gif_skipmap +local Gif_get_sym, shift, nextbl, noblock, loop1, exx +local Gif_output, next, loop2 + +_null fix 0x1000 ; 0x1000 + + mov esi,gifsrc ;Указатель на ГИФ фаил в памяти + mov edi,imgsrc ;Указатель на список картинок + + if defined gif_hash_offset + mov eax,gif_hash_offset ;Рабочая область минимум 4096*4 байт + else + mov eax,hasharea ;Рабочая область минимум 4096*4 байт + end if + + call ReadGIF + jmp gifmacend + + if defined gif_hash_offset + else + hasharea: + times 4096 dd 0 ;4096 + end if + +ReadGIF: + push esi edi + mov [table_ptr],eax + mov [cur_info],edi + xor eax,eax + mov [globalColor],eax + mov [img_count],eax + inc eax + cmp dword[esi],'GIF8' + jne er ; signature + mov ecx,[esi+0xa] + inc eax + add esi,0xd + mov edi,esi + bt ecx,7 + jnc nextblock + mov [globalColor],esi + call Gif_skipmap +nextblock: + cmp byte[edi],0x21 + jne noextblock + inc edi + cmp byte[edi],0xf9 ; Graphic Control Ext + jne no_gc + add edi,7 + jmp nextblock +no_gc: + cmp byte[edi],0xfe ; Comment Ext + jne no_comm + inc edi +block_skip: + movzx eax,byte[edi] + lea edi,[edi+eax+1] + cmp byte[edi],0 + jnz block_skip + inc edi + jmp nextblock +no_comm: + cmp byte[edi],0xff ; Application Ext + jne nextblock + add edi,13 + jmp block_skip +noextblock: + cmp byte[edi],0x2c ; image beginning + jne er + inc [img_count] + inc edi + mov esi,[cur_info] + xchg esi,edi +; movsd +; movsd + + mov bp,word[esi+4] + movzx ebx,bp + mov [edi],ebx + + mov bp,word[esi+6] + movzx ebx,bp + mov [edi+4],ebx + + add edi,8 + add esi,8 + + push edi + movzx ecx,word[esi] + inc esi + bt ecx,7 + jc uselocal + push [globalColor] + mov edi,esi + jmp setPal +uselocal: + call Gif_skipmap + push esi +setPal: + movzx ecx,byte[edi] + inc ecx + mov [codesize],ecx + dec ecx + pop [Palette] + lea esi,[edi+1] + mov edi,[table_ptr] + xor eax,eax + cld + lodsb ; eax - block_count + add eax,esi + mov [block_ofs],eax + mov [bit_count],8 + mov eax,1 + shl eax,cl + mov [CC],eax + inc eax + mov [EOI],eax + lea ecx,[eax-1] + mov eax, _null shl 16 +filltable: + stosd + inc eax + loop filltable + pop edi + mov [img_start],edi +reinit: + mov edx,[EOI] + inc edx + push [codesize] + pop [compsize] + call Gif_get_sym + cmp eax,[CC] + je reinit + call Gif_output +cycle: + movzx ebx,ax + call Gif_get_sym + cmp eax,edx + jae notintable + cmp eax,[CC] + je reinit + cmp eax,[EOI] + je zend + call Gif_output +zadd: + push eax + mov eax,[table_ptr] + mov [eax+edx*4],ebx + pop eax + cmp edx,0xFFF + jae cycle + inc edx + bsr ebx,edx + cmp ebx,[compsize] + jne noinc + inc [compsize] +noinc: + jmp cycle +notintable: + push eax + mov eax,ebx + call Gif_output + push ebx + movzx eax,bx + call Gif_output + pop ebx eax + jmp zadd +er: + pop edi + jmp ex +zend: +; mov eax,[.cur_info] ; skip offset to next frame +; mov [eax],edi + mov [cur_info],edi + add esi,2 + xchg esi,edi +nxt: + cmp byte[edi],0 + jnz continue + inc edi + jmp nxt +continue: +; cmp byte[edi],0x3b ;read next frame +; jne nextblock + xor eax,eax + stosd + mov ecx,[img_count] +ex: + pop edi esi + ret + +Gif_skipmap: +; in: ecx - image descriptor, esi - pointer to colormap +; out: edi - pointer to area after colormap + + and ecx,111b + inc ecx ; color map size + mov ebx,1 + shl ebx,cl + lea ebx,[ebx*2+ebx] + lea edi,[esi+ebx] + ret + +Gif_get_sym: + mov ecx,[compsize] + push ecx + xor eax,eax +shift: + ror byte[esi],1 + rcr eax,1 + dec [bit_count] + jnz loop1 + inc esi + cmp esi,[block_ofs] + jb noblock + push eax + xor eax,eax + lodsb + test eax,eax + jnz nextbl + mov eax,[EOI] + sub esi,2 + add esp,8 + jmp exx +nextbl: + add eax,esi + mov [block_ofs],eax + pop eax +noblock: + mov [bit_count],8 +loop1: + loop shift + pop ecx + rol eax,cl +exx: + xor ecx,ecx + ret + +Gif_output: + push esi eax edx + mov edx,[table_ptr] +next: + push word[edx+eax*4] + mov ax,word[edx+eax*4+2] + inc ecx + cmp ax,_null + jnz next + shl ebx,16 + mov bx,[esp] +loop2: + pop ax + + lea esi,[eax+eax*2] + add esi,[Palette] + + if COLOR_ORDER eq MENUETOS + mov esi,[esi] + bswap esi + shr esi,8 + mov [edi],esi + add edi,3 + else + movsw + movsb + end if + + loop loop2 + pop edx eax esi + ret + + globalColor dd 1 + img_count dd 1 + cur_info dd 1 ; image table pointer + img_start dd 1 + codesize dd 1 + compsize dd 1 + bit_count dd 1 + CC dd 1 + EOI dd 1 + Palette dd 1 + block_ofs dd 1 + table_ptr dd 1 + +gifmacend: +} + diff --git a/programs/games/almaz/ASCL.INC b/programs/games/almaz/ASCL.INC new file mode 100644 index 0000000000..f5a3cf2db3 --- /dev/null +++ b/programs/games/almaz/ASCL.INC @@ -0,0 +1,835 @@ +lang equ ru ; ru en fr ge fi + +; +; Assembler +; SMALL +; CODE +; Libary +; +; Ver 0.14 By Pavlushin Evgeni (RUSSIA) +; www.waptap@mail.ru + +;Please compile aplications on FASM ver1.54 or higer!!! + +;InfoList +;0.01 scank,putpix,puttxt +;0.02 label,random,colors +;0.03 window,startwd,endwd,attributes +;0.04 close,delay,scevent ~30.04.2004 +;0.05 small random, ~04.05.2004 +;0.06 wtevent ~09.05.2004 +;0.07 timeevent ~23.05.2004 +;0.08 txtput ~14.06.2004 +;0.09 opendialog,savedialog ~20.06.2004 +;0.10 wordstoreg by halyavin, add at ~30.08.2004 +; random bug deleted eax is use. +;0.11 loadfile from me +puttxt bug del ~07.09.2004 +;0.12 open/save dialog ~13.09.2004 +;0.13 dialogs bugs deleted +;0.14 drawlbut ~03.10.2004 + +; LOADFILE +; (SYNTAX) LOADFILE 'full_path_to_file',file_load_area,file_temp_area +; (SAMPLE) LOADFILE '/rd/1/clock.bmp',load_area,temp_area + +macro loadfile file_name,file_load_area,file_temp_area +{ +local open,fileinfo,string + jmp open +fileinfo: + dd 0 + dd 0 + dd 1 + dd file_load_area + dd file_temp_area +string: + db file_name,0 +open: + mov dword [fileinfo+8],1 ; how many blocks to read (1) + mov eax,58 + mov ebx,fileinfo + int 0x40 + mov eax,[file_load_area+2] + shr eax,9 ; поделим на 512 и прибавим 1 - получим число блоков + inc eax + mov dword [fileinfo+8],eax + mov eax,58 + mov ebx,fileinfo + int 0x40 +} + + +macro wordstoreg reg,hiword,loword +{ +if hiword eqtype 0 & loword eqtype 0 + mov reg,hiword*65536+loword +else if hiword eqtype 12 & loword eqtype eax + mov reg,hiword*65536 + add reg,loword +else if hiword eqtype 12 & loword eqtype [123] + mov reg,hiword*65536 + add reg,loword +else + mov reg,hiword + shl reg,16 + add reg,loword +end if +} + + +; DRAW BUTTON with label + +macro drawlbut x,y,xs,ys,text,id,bcolor,tcolor +{ +local asd,lab + jmp asd +lab db text ;arg label +asd: + wordstoreg ebx,x,xs + wordstoreg ecx,y,ys + mov edx,id + mov esi,bcolor + mov eax,8 + int 0x40 + + mov eax,asd-lab ;calc size + mov ebx,6 + mul ebx + mov esi,eax + + mov eax,xs + sub eax,esi + shr eax,1 + add eax,x + + mov edx,ys + sub edx,7 + shr edx,1 + add edx,y + + mov ebx,eax + shl ebx,16 + add ebx,edx + + mov ecx,tcolor ;arg4 color + mov edx,lab + mov esi,asd-lab ;calc size + mov eax,4 + int 0x40 +} + + +macro opendialog redproc,openoff,erroff,path +{ +local new_d, get_loops, dlg_pid_get, DLGPID, num_of_proc +local run_fileinfo, param +local getmesloop, loox, mred, mkey, mbutton, mgetmes +local dlg_is_work, ready, procinfo +; +; STEP 1 Run SYSXTREE with parametrs MYPID 4 bytes in dec, +; 1 byte space, 1 byte type of dialog (O - Open ,S - Save) +; + + cld +;; mov esi,path + mov edi,path + mov eax,0 + mov ecx,200 + rep stosb + +;mov [get_loops],0 +mov [dlg_pid_get],0 + +; Get my PID in dec format 4 bytes + mov eax,9 + mov ebx,procinfo + mov ecx,-1 + int 0x40 + +; convert eax bin to param dec + mov eax,dword [procinfo+30] ;offset of myPID + mov edi,param+4-1 ;offset to 4 bytes + mov ecx,4 + mov ebx,10 + cld +new_d: + xor edx,edx + div ebx + add dl,'0' + mov [edi],dl + dec edi + loop new_d + +; wirite 1 byte space to param + mov [param+4],byte 32 ;Space for next parametr +; and 1 byte type of dialog to param + mov [param+5],byte 'O' ;Get Open dialog (Use 'S' for Save dialog) + +; +; STEP2 prepare IPC area for get messages +; + +; prepare IPC area + mov [path],dword 0 + mov [path+4],dword 8 + +; define IPC memory + mov eax,60 + mov ebx,1 ; define IPC + mov ecx,path ; offset of area + mov edx,150 ; size 150 bytes + int 0x40 + +; change wanted events list 7-bit IPC event + mov eax,40 + mov ebx,01000111b + int 0x40 + +; +; STEP 3 run SYSTEM XTREE with parameters +; + + mov eax,58 + mov ebx,run_fileinfo + int 0x40 + + call redproc + + mov [get_loops],0 +getmesloop: + mov eax,23 + mov ebx,50 ;0.5 sec + int 0x40 + + cmp eax,1 + je mred + cmp eax,2 + je mkey + cmp eax,3 + je mbutton + cmp eax,7 + je mgetmes + +; Get number of procces + mov ebx,procinfo + mov ecx,-1 + mov eax,9 + int 0x40 + mov ebp,eax + +loox: + mov eax,9 + mov ebx,procinfo + mov ecx,ebp + int 0x40 + mov eax,[DLGPID] + cmp [procinfo+30],eax ;IF Dialog find + je dlg_is_work ;jmp to dlg_is_work + dec ebp + jnz loox + + jmp erroff + +dlg_is_work: + cmp [procinfo+50],word 9 ;If slot state 9 - dialog is terminated + je erroff ;TESTODP2 terminated too + + cmp [dlg_pid_get],dword 1 + je getmesloop + inc [get_loops] + cmp [get_loops],4 ;2 sec if DLG_PID not get, TESTOP2 terminated + jae erroff + jmp getmesloop + +mred: + call redproc + jmp getmesloop +mkey: + mov eax,2 + int 0x40 ; read (eax=2) + jmp getmesloop +mbutton: + mov eax,17 ; get id + int 0x40 + cmp ah,1 ; button id=1 ? + jne getmesloop + mov eax,-1 ; close this program + int 0x40 +mgetmes: + +; If dlg_pid_get then second message get jmp to still + cmp [dlg_pid_get],dword 1 + je ready + +; First message is number of PID SYSXTREE dialog + +; convert PID dec to PID bin + movzx eax,byte [path+16] + sub eax,48 + imul eax,10 + movzx ebx,byte [path+16+1] + add eax,ebx + sub eax,48 + imul eax,10 + movzx ebx,byte [path+16+2] + add eax,ebx + sub eax,48 + imul eax,10 + movzx ebx,byte [path+16+3] + add eax,ebx + sub eax,48 + mov [DLGPID],eax + +; Claear and prepare IPC area for next message + mov [path],dword 0 + mov [path+4],dword 8 + mov [path+8],dword 0 + mov [path+12],dword 0 + mov [path+16],dword 0 + +; Set dlg_pid_get for get next message + mov [dlg_pid_get],dword 1 + call redproc ;show DLG_PID + jmp getmesloop + +ready: +; +; The second message get +; Second message is 100 bytes path to SAVE/OPEN file +; shl path string on 16 bytes +; + cld + mov esi,path+16 + mov edi,path + mov ecx,200 + rep movsb + mov [edi],byte 0 + + jmp openoff + + +; DATA AREA +get_loops dd 0 +dlg_pid_get dd 0 +DLGPID dd 0 + +param: + dd 0 ; My dec PID + dd 0,0 ; Type of dialog + +run_fileinfo: + dd 16 + dd 0 + dd param + dd 0 + dd procinfo ; 0x10000 +;run_filepath + db '/RD/1/SYSXTREE',0 + +procinfo: +times 256 db 0 +} + + +macro savedialog redproc,openoff,erroff,path +{ +local new_d, get_loops, dlg_pid_get, DLGPID, num_of_proc +local run_fileinfo, run_filepath, param +local getmesloop, loox, mred, mkey, mbutton, mgetmes +local dlg_is_work, ready, procinfo +; +; STEP 1 Run SYSXTREE with parametrs MYPID 4 bytes in dec, +; 1 byte space, 1 byte type of dialog (O - Open ,S - Save) +; + + cld +;; mov esi,path + mov edi,path + mov eax,0 + mov ecx,200 + rep stosb + +;mov [get_loops],0 +mov [dlg_pid_get],0 + +; Get my PID in dec format 4 bytes + mov eax,9 + mov ebx,procinfo + mov ecx,-1 + int 0x40 + +; convert eax bin to param dec + mov eax,dword [procinfo+30] ;offset of myPID + mov edi,param+4-1 ;offset to 4 bytes + mov ecx,4 + mov ebx,10 + cld +new_d: + xor edx,edx + div ebx + add dl,'0' + mov [edi],dl + dec edi + loop new_d + +; wirite 1 byte space to param + mov [param+4],byte 32 ;Space for next parametr +; and 1 byte type of dialog to param + mov [param+5],byte 'S' ;Get Open dialog (Use 'S' for Save dialog) + +; +; STEP2 prepare IPC area for get messages +; + +; prepare IPC area + mov [path],dword 0 + mov [path+4],dword 8 + +; define IPC memory + mov eax,60 + mov ebx,1 ; define IPC + mov ecx,path ; offset of area + mov edx,120 ; size 150 bytes + int 0x40 + +; change wanted events list 7-bit IPC event + mov eax,40 + mov ebx,01000111b + int 0x40 + +; +; STEP 3 run SYSTEM XTREE with parameters +; + + mov eax,58 + mov ebx,run_fileinfo + int 0x40 + + call redproc + + mov [get_loops],0 +getmesloop: + mov eax,23 + mov ebx,50 ;0.5 sec + int 0x40 + + cmp eax,1 + je mred + cmp eax,2 + je mkey + cmp eax,3 + je mbutton + cmp eax,7 + je mgetmes + +; Get number of procces + mov ebx,procinfo + mov ecx,-1 + mov eax,9 + int 0x40 + mov ebp,eax + +loox: + mov eax,9 + mov ebx,procinfo + mov ecx,ebp + int 0x40 + mov eax,[DLGPID] + cmp [procinfo+30],eax ;IF Dialog find + je dlg_is_work ;jmp to dlg_is_work + dec ebp + jnz loox + + jmp erroff + +dlg_is_work: + cmp [procinfo+50],word 9 ;If slot state 9 - dialog is terminated + je erroff ;TESTODP2 terminated too + + cmp [dlg_pid_get],dword 1 + je getmesloop + inc [get_loops] + cmp [get_loops],4 ;2 sec if DLG_PID not get, TESTOP2 terminated + jae erroff + jmp getmesloop + +mred: + call redproc + jmp getmesloop +mkey: + int 0x40 ; read (eax=2) + jmp getmesloop +mbutton: + mov eax,17 ; get id + int 0x40 + cmp ah,1 ; button id=1 ? + jne getmesloop + mov eax,-1 ; close this program + int 0x40 +mgetmes: + +; If dlg_pid_get then second message get jmp to still + cmp [dlg_pid_get],dword 1 + je ready + +; First message is number of PID SYSXTREE dialog + +; convert PID dec to PID bin + movzx eax,byte [path+16] + sub eax,48 + imul eax,10 + movzx ebx,byte [path+16+1] + add eax,ebx + sub eax,48 + imul eax,10 + movzx ebx,byte [path+16+2] + add eax,ebx + sub eax,48 + imul eax,10 + movzx ebx,byte [path+16+3] + add eax,ebx + sub eax,48 + mov [DLGPID],eax + +; Claear and prepare IPC area for next message + mov [path],dword 0 + mov [path+4],dword 8 + mov [path+8],dword 0 + mov [path+12],dword 0 + mov [path+16],dword 0 + +; Set dlg_pid_get for get next message + mov [dlg_pid_get],dword 1 + call redproc ;show DLG_PID + jmp getmesloop + +ready: +; +; The second message get +; Second message is 100 bytes path to SAVE/OPEN file +; shl path string on 16 bytes +; + cld + mov esi,path+16 + mov edi,path + mov ecx,200 + rep movsb + mov [edi],byte 0 + + jmp openoff + + +; DATA AREA +get_loops dd 0 +dlg_pid_get dd 0 +DLGPID dd 0 + +param: + rb 4 ; My dec PID + rb 6 ; Type of dialog + +run_fileinfo: + dd 16 + dd 0 + dd param + dd 0 + dd procinfo +run_filepath: + db '/RD/1/SYSXTREE',0 + +procinfo: +times 256 db 0 +} + + + + +; RANDOM - generate random count (small) +; (SYNTAX) RANDOM MaxCount,OutArgument +; (SAMPLE) RANDOM 10000,eax +; ( NOTE ) Maxint<65536 ; use random 65536,eax for more combinations + +randomuse = 0 + +macro random arg1,arg2 +{ +local rxproc +randomuse = randomuse + 1 + + jmp rxproc + +if defined randomuse & randomuse = 1 +randomproc: + jmp rnj +rsx1 dw 0x4321 +rsx2 dw 0x1234 +rnj: +; mov eax,arg1 + push bx + push cx + push dx + push si + push di + mov cx,ax + mov ax,word ptr rsx1 + mov bx,word ptr rsx2 + mov si,ax + mov di,bx + mov dl,ah + mov ah,al + mov al,bh + mov bh,bl + xor bl,bl + rcr dl,1 + rcr ax,1 + rcr bx,1 + add bx,di + adc ax,si + add bx,0x62e9 + adc ax,0x3619 + mov word ptr rsx1,bx + mov word ptr rsx2,ax + xor dx,dx + cmp ax,0 + je nodiv + cmp cx,0 + je nodiv + div cx +nodiv: + mov ax,dx + pop di + pop si + pop dx + pop cx + pop bx + and eax,0000ffffh +; mov arg2,0 +; mov arg2,eax + ret +end if + +rxproc: + mov eax,arg1 + call randomproc + mov arg2,eax +} + +macro scank +{ + mov eax,10 + int 0x40 +} + +macro putpix x,y,color +{ + mov ebx,x + mov ecx,y + mov edx,color + mov eax,1 + int 0x40 +} + +macro puttxt x,y,offs,size,color +{ +; mov ebx,x +; shl ebx,16 +; add ebx,y + wordstoreg ebx,x,y + mov ecx,color + mov edx,offs + mov esi,size + mov eax,4 + int 0x40 +} + +macro outcount data, x, y, color, numtype +{ + mov ecx,data + mov ebx,numtype + mov bl,0 +; mov edx,x*65536+y + wordstoreg edx,x,y + mov esi,color + mov eax,47 + int 0x40 +} + +; SCEVENT - Scan event + +macro scevent red,key,but +{ + mov eax,11 + int 0x40 + dec eax + jz red + dec eax + jz key + dec eax + jz but +} + +; WTEVENT - Wait event + +macro wtevent red,key,but +{ + mov eax,10 + int 0x40 + dec eax + jz red + dec eax + jz key + dec eax + jz but +} + +; TIMEEVENT - Wite for event with timeout + +macro timeevent xfps,noevent,red,key,but +{ + mov eax,23 + mov ebx,xfps + int 0x40 + cmp eax,0 + je noevent + dec eax + jz red + dec eax + jz key + dec eax + jz but +} + + +; CLOSE - Close program + +macro close +{ + mov eax,-1 + int 0x40 +} + +; DELAY - Create delay 1/100 sec +; (SYNTAX) Delay time +; (SAMPLE) Delay 100 ;delay 2 sec 1/100*200=2 sec + +macro delay arg1 +{ + mov eax,5 + mov ebx,arg1 + int 0x40 +} + +; WINDOW - Draw window +; (SYNTAX) WINDOW Xstart,Ystart,'Text',Color +; (SAMPLE) WINDOW 10,10,640+8,480+24,window_Skinned + +macro window arg1,arg2,arg3,arg4,arg5 +{ +; mov ebx,arg1*65536+arg3 +; mov ecx,arg2*65536+arg4 + wordstoreg ebx,arg1,arg3 + wordstoreg ecx,arg2,arg4 + mov edx,arg5 + mov eax,0 + int 0x40 +} + +macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7 +{ + mov ebx,arg1*65536+arg3 + mov ecx,arg2*65536+arg4 + mov edx,arg5 + mov esi,arg6 + mov edi,arg7 + mov eax,0 + int 0x40 +} + + +; STARTWD - Start of window draw + +macro startwd +{ + mov eax,12 + mov ebx,1 + int 0x40 +} + +; ENDWD - End window draw + +macro endwd +{ + mov eax,12 + mov ebx,2 + int 0x40 +} + +; LABEL - Put text to frame +; (SYNTAX) LABEL Xstart,Ystart,'Text',Color +; (SAMPLE) LABEL 10,12,'Hello World!',cl_Green+font_Big + +macro label arg1,arg2,arg3,arg4 +{ +local asd,lab + jmp asd +lab db arg3 ;arg label +asd: +; mov ebx,arg1 ;arg1=y arg2=x +; shl ebx,16 +; add ebx,arg2 + wordstoreg ebx,arg1,arg2 + mov ecx,arg4 ;arg4 color + mov edx,lab + mov esi,asd-lab ;calc size + mov eax,4 + int 0x40 +} + +;Key's +key_Up equ 178 +key_Down equ 177 +key_Right equ 179 +key_Left equ 176 +key_Esc equ 27 +key_Space equ 32 +key_Enter equ 13 +key_Bspace equ 8 +key_F1 equ 50 +key_F2 equ 51 +key_F3 equ 52 +key_F4 equ 53 +key_F5 equ 54 +key_F6 equ 55 +key_F7 equ 56 +key_F8 equ 57 +key_F9 equ 48 +key_F10 equ 49 +key_F11 equ 68 +key_F12 equ 255 +key_Home equ 180 +key_End equ 181 +key_PgUp equ 184 +key_PgDown equ 183 + +;Attributes + +;Window Attributes +window_Skinned equ 0x03000000 +window_Type2 equ 0x02000000 +window_Type1 equ 0x00000000 +window_Reserve equ 0x01000000 + +;Font Attributes +font_Big equ 0x10000000 + +;Colors +cl_White equ 0x00ffffff +cl_Black equ 0x00000000 +cl_Grey equ 0x00888888 +cl_Red equ 0x00ff0000 +cl_Lime equ 0x0000ff00 +cl_Green equ 0x0000af00 +cl_Blue equ 0x000000ff +cl_Purple equ 0x008080ff +cl_Violet equ 0x008040ff +cl_Cyan equ 0x0040e0ff diff --git a/programs/games/almaz/BULLET.BMP b/programs/games/almaz/BULLET.BMP new file mode 100644 index 0000000000..cc52acd53b Binary files /dev/null and b/programs/games/almaz/BULLET.BMP differ diff --git a/programs/games/almaz/BULLET.GIF b/programs/games/almaz/BULLET.GIF new file mode 100644 index 0000000000..68e96580b4 Binary files /dev/null and b/programs/games/almaz/BULLET.GIF differ diff --git a/programs/games/almaz/ENEMY.GIF b/programs/games/almaz/ENEMY.GIF new file mode 100644 index 0000000000..f4776fd5cc Binary files /dev/null and b/programs/games/almaz/ENEMY.GIF differ diff --git a/programs/games/almaz/ENEMY1.GIF b/programs/games/almaz/ENEMY1.GIF new file mode 100644 index 0000000000..634bdf2d36 Binary files /dev/null and b/programs/games/almaz/ENEMY1.GIF differ diff --git a/programs/games/almaz/ENEMY2.GIF b/programs/games/almaz/ENEMY2.GIF new file mode 100644 index 0000000000..03896a6ef0 Binary files /dev/null and b/programs/games/almaz/ENEMY2.GIF differ diff --git a/programs/games/almaz/EXPLODE1.GIF b/programs/games/almaz/EXPLODE1.GIF new file mode 100644 index 0000000000..d4a74a9f3b Binary files /dev/null and b/programs/games/almaz/EXPLODE1.GIF differ diff --git a/programs/games/almaz/KIRPICH.BMP b/programs/games/almaz/KIRPICH.BMP new file mode 100644 index 0000000000..8c46eb1bd0 Binary files /dev/null and b/programs/games/almaz/KIRPICH.BMP differ diff --git a/programs/games/almaz/KIRPICH2.BMP b/programs/games/almaz/KIRPICH2.BMP new file mode 100644 index 0000000000..00200d964d Binary files /dev/null and b/programs/games/almaz/KIRPICH2.BMP differ diff --git a/programs/games/almaz/KIRPICH22.BMP b/programs/games/almaz/KIRPICH22.BMP new file mode 100644 index 0000000000..ab33b06030 Binary files /dev/null and b/programs/games/almaz/KIRPICH22.BMP differ diff --git a/programs/games/almaz/LESTNICA.BMP b/programs/games/almaz/LESTNICA.BMP new file mode 100644 index 0000000000..eaea62f38e Binary files /dev/null and b/programs/games/almaz/LESTNICA.BMP differ diff --git a/programs/games/almaz/OLD1234.BMP b/programs/games/almaz/OLD1234.BMP new file mode 100644 index 0000000000..0088304ed7 Binary files /dev/null and b/programs/games/almaz/OLD1234.BMP differ diff --git a/programs/games/almaz/OLDKIRPICH.BMP b/programs/games/almaz/OLDKIRPICH.BMP new file mode 100644 index 0000000000..0088304ed7 Binary files /dev/null and b/programs/games/almaz/OLDKIRPICH.BMP differ diff --git a/programs/games/almaz/WATER1.BMP b/programs/games/almaz/WATER1.BMP new file mode 100644 index 0000000000..87f0887c45 Binary files /dev/null and b/programs/games/almaz/WATER1.BMP differ diff --git a/programs/games/almaz/WATER2.BMP b/programs/games/almaz/WATER2.BMP new file mode 100644 index 0000000000..1425db8c73 Binary files /dev/null and b/programs/games/almaz/WATER2.BMP differ diff --git a/programs/games/almaz/almaz1.bmp b/programs/games/almaz/almaz1.bmp new file mode 100644 index 0000000000..8dda9a0c14 Binary files /dev/null and b/programs/games/almaz/almaz1.bmp differ diff --git a/programs/games/almaz/almaz2.bmp b/programs/games/almaz/almaz2.bmp new file mode 100644 index 0000000000..5720d41a03 Binary files /dev/null and b/programs/games/almaz/almaz2.bmp differ diff --git a/programs/games/almaz/almaz3.bmp b/programs/games/almaz/almaz3.bmp new file mode 100644 index 0000000000..c3dbe329a9 Binary files /dev/null and b/programs/games/almaz/almaz3.bmp differ diff --git a/programs/games/almaz/aniall.gif b/programs/games/almaz/aniall.gif new file mode 100644 index 0000000000..367424b374 Binary files /dev/null and b/programs/games/almaz/aniall.gif differ diff --git a/programs/games/almaz/build_ru.bat b/programs/games/almaz/build_ru.bat new file mode 100644 index 0000000000..3c4efd2e5f --- /dev/null +++ b/programs/games/almaz/build_ru.bat @@ -0,0 +1,6 @@ +@erase lang.inc +@echo lang fix ru >lang.inc +@fasm ALMAZ.asm ALMAZ +@erase lang.inc +@kpack ALMAZ +@pause \ No newline at end of file diff --git a/programs/games/almaz/ded1.bmp b/programs/games/almaz/ded1.bmp new file mode 100644 index 0000000000..019686a66f Binary files /dev/null and b/programs/games/almaz/ded1.bmp differ diff --git a/programs/games/almaz/ded2.bmp b/programs/games/almaz/ded2.bmp new file mode 100644 index 0000000000..a3d94d5323 Binary files /dev/null and b/programs/games/almaz/ded2.bmp differ diff --git a/programs/games/almaz/door1.BMP b/programs/games/almaz/door1.BMP new file mode 100644 index 0000000000..14211c47cf Binary files /dev/null and b/programs/games/almaz/door1.BMP differ diff --git a/programs/games/almaz/door2.bmp b/programs/games/almaz/door2.bmp new file mode 100644 index 0000000000..b0bf6c97dd Binary files /dev/null and b/programs/games/almaz/door2.bmp differ diff --git a/programs/games/almaz/gold.bmp b/programs/games/almaz/gold.bmp new file mode 100644 index 0000000000..c9b319aef7 Binary files /dev/null and b/programs/games/almaz/gold.bmp differ diff --git a/programs/games/almaz/gold2.bmp b/programs/games/almaz/gold2.bmp new file mode 100644 index 0000000000..8dda9a0c14 Binary files /dev/null and b/programs/games/almaz/gold2.bmp differ diff --git a/programs/games/almaz/level.bmp b/programs/games/almaz/level.bmp new file mode 100644 index 0000000000..5324e0ce08 Binary files /dev/null and b/programs/games/almaz/level.bmp differ diff --git a/programs/games/almaz/level2.bmp b/programs/games/almaz/level2.bmp new file mode 100644 index 0000000000..c8c2750f3a Binary files /dev/null and b/programs/games/almaz/level2.bmp differ diff --git a/programs/macros.inc b/programs/macros.inc index a4ea029a58..7f95fc804a 100644 --- a/programs/macros.inc +++ b/programs/macros.inc @@ -467,11 +467,11 @@ struct process_information ends struct system_colors - frame dd ? ;nonset1 - grab dd ? ;nonset2 + taskbar dd ? ;frame + taskbar_text dd ? ;grab work_3d_dark dd ? work_3d_light dd ? - grab_text dd ? ;nonset3 + window_title dd ? ;grab_text work dd ? work_button dd ? work_button_text dd ? diff --git a/programs/system/taskbar/trunk/drawappl.inc b/programs/system/taskbar/trunk/drawappl.inc index 2ee0f8886b..33abea4cf4 100644 --- a/programs/system/taskbar/trunk/drawappl.inc +++ b/programs/system/taskbar/trunk/drawappl.inc @@ -145,7 +145,7 @@ align 4 add ebx,TAB_SIZE-2 ;54 push edi - mov edx,[system_colours.work_button] + mov edx,[system_colours.taskbar] xor edi,edi cmp ebp,[active_slot_number] ;ecx ; ecx=active slot number @@ -181,7 +181,7 @@ align 4 add bx,cx mov edx, procinfo_window_tabs+10 - mcall 4,,[system_colours.work_button_text],,11 + mcall 4,,[system_colours.taskbar_text],,11 ;-------------------------------------- align 4 .nodraw: diff --git a/programs/system/taskbar/trunk/drawtray.inc b/programs/system/taskbar/trunk/drawtray.inc index 7dcf8af8b0..8e58a9ba01 100644 --- a/programs/system/taskbar/trunk/drawtray.inc +++ b/programs/system/taskbar/trunk/drawtray.inc @@ -192,7 +192,7 @@ draw_list_button: ; draw page list number mov edx,ebx add edx,9 shl 16 - mcall 47,0x20000,[page_list],,[system_colours.work_button_text] + mcall 47,0x20000,[page_list],,[system_colours.taskbar_text] @@: ret ;--------------------------------------------------------------- diff --git a/programs/system/taskbar/trunk/drawwind.inc b/programs/system/taskbar/trunk/drawwind.inc index 97915ce0ab..fbcd1a60ec 100644 --- a/programs/system/taskbar/trunk/drawwind.inc +++ b/programs/system/taskbar/trunk/drawwind.inc @@ -10,8 +10,8 @@ draw_window: mcall 48,3,system_colours,10*4 - mov eax, [system_colours+4*6] - mov edx,[system_colours+4*6] + mov eax, [system_colours.taskbar] + mov edx,[system_colours.taskbar] mov eax,COLOR_CHANGE_MAGNITUDE call subtract_color_change_magnitude mov [wcolor], edx