From ad7f978e81f733e8f51b5708459be02686164f70 Mon Sep 17 00:00:00 2001 From: gluk Date: Mon, 24 Mar 2008 17:55:08 +0000 Subject: [PATCH] new version of Clicks game from Leency and Veliant git-svn-id: svn://kolibrios.org@776 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/games/just_clicks/trunk/4.gif | Bin 0 -> 2414 bytes programs/games/just_clicks/trunk/History.txt | 31 + programs/games/just_clicks/trunk/clicks.c-- | 157 +-- programs/games/just_clicks/trunk/compile.bat | 4 +- .../games/just_clicks/trunk/files/History.txt | 22 - .../games/just_clicks/trunk/files/RANDOM.H-- | 52 - .../games/just_clicks/trunk/files/kolibri.h-- | 621 ---------- .../games/just_clicks/trunk/files/memory.h-- | 36 - .../games/just_clicks/trunk/files/startup.h-- | 1046 ----------------- programs/games/just_clicks/trunk/img.txt | 416 +++++++ 10 files changed, 507 insertions(+), 1878 deletions(-) create mode 100644 programs/games/just_clicks/trunk/4.gif create mode 100644 programs/games/just_clicks/trunk/History.txt delete mode 100644 programs/games/just_clicks/trunk/files/History.txt delete mode 100644 programs/games/just_clicks/trunk/files/RANDOM.H-- delete mode 100644 programs/games/just_clicks/trunk/files/kolibri.h-- delete mode 100644 programs/games/just_clicks/trunk/files/memory.h-- delete mode 100644 programs/games/just_clicks/trunk/files/startup.h-- create mode 100644 programs/games/just_clicks/trunk/img.txt diff --git a/programs/games/just_clicks/trunk/4.gif b/programs/games/just_clicks/trunk/4.gif new file mode 100644 index 0000000000000000000000000000000000000000..0919b01a8cdd767c8f8f65653be896f446ebe61b GIT binary patch literal 2414 zcmWmDdsxzk8VB&7kcBB_C-s)LwbZIJ&GcVBI89Ek_eL^iXw}! z}f3MEddid86Ml`4WlNl>WbRBEC^6|Yj0lq!-+O;)PN#;(?o zRT_#)O;xEWY7N!cH8WJr3{9;`QP0pcGbu(hTDnG?rqwbuT84I(Iith4+;A6!HVE=fR@CWe$z(B(;CXQ<)Tw1^s7WNiwjE*1L|9b2Ck zb&i2M&%|9|L|;h9{hWbsV8t}DV;c?=8rg&^9Kx+rTn!ehiHg!ZDc=@ZF%N}`TR(I-<4)Fgv3Q>c0xZ9bJ| zNJ}v=QVq;heR{efonc_o4a{^slWE9c&apD)SgbkrVSOgsz-Ak=IEKtj12=P?!+xI0 znKzc4oafox=SR5nyqxE}?0FtBVDI?x61Q6%kz6mxVKAl?v&^Bl<~SN z^4rzdY7B|6?lAkj5El>+m+@lEA(^Dld!P59nh`whkx4Jf5h_j5?DxZ zi2Mm%&AL!&$qzd58fF!?NN~hnIFK|@I!g~}GYws%3{+;cy*HFa+6Ij2z@Cw0(`8_T6gpi;*$a!F8cFrLjvis}{(#EIbgeyL` zk8Qs;>wu}R+fw!8;=;Yz6Nd2I@oyHOmHSS9xLZL7tjKJAneB%befgg670vJsc#9a} zbdk+C<4^@LxDVY?Fc9toi-PJw3oyeSx!F-%8?fGxUhBI7pRYrGn5%XR+je}u9`@Q0 z?IsE{!_^W&Q%~w2zLK=MJ#xA<=SF9lIk+AAUxWBk;AXJct#=jV;2!Wzi`XMyas%fP z7;(JCeaK}B=Q$DJDD*6KjThG)|PLP z8eS;W8^)N!BcHdn)E-=8zMMGt5}vi}qbO=P>pRzaep|reb@SMJ3#H%~UuES>sNd3^ zmLm_|w5HcSTzwo}>$lRI=N9n35j^p5?Sp3*5-=~!>DLuZ-GW;sa@U4!-?Xfa>^Y`c z3;sx<_nSKXhnqX@P;HTG>e61A``9HBWnv18hV_dPFU0F&pXf-M z%+d>NQPd#lLo6H>3BKrm-M0N#Od?^khSVIi9=T=*yu zq^K7FTiSO1vhfV+1^fkq9pvSi+R*DlHt**0O*Y$%xfFw;UcYbG@8V7NZ-JHa{UERc zQSs(ouPk~N_Eoy0&Ax8p`!73IPQHJ!tBC7w<}B<+o4fYv23{X%rK4Z&D*!xJ4s=_d zw(ywb_pT#)C(&D-YTQ9%`-Q9MbzkPK&rtD0e#tT{`C1{=SH~ZGkJQmap`qL*1;S&)IAxu-=ZH+jK8O6SwIB7U() z0Uzp6@Cf`IR*dM@1xH{8{?)iz`hVe;!1aD~;r-PzH>SP$Qpk1_@t_q_+`R3WFm(4t zL&XNlLST6s4jiguRAN5a@4pBKj$848=o*1l+q)rWpL$>uTm)~uKMb!G0F)tv^=;ws ze%G~X%AO*-YGjd%>y9(gg$^ciVYPFuz{)S6Y+oK_E7%sO*~Au@oMdke6o9O6VCMIo zT8sq0>#jS4D?9KFc05dAu)6-P8F*EU!FH8ccd*OgA>&mELI>-LfHL4UVw})tu0{XyEYdj=j6 z8YMYbZqX|*nz76>lP8ohs_8m{( znLSft(?gg4!tgSu^1l6duV}h&{b%#+D_J(~%jCY3dUHCagYif-?FxKvZo4v&)^Az< zxJuviGc=U3OI_wl&+kdQ-(fp~QX%N%UuymuIK2Oa5>eM|(fxHCco!}?$$iiFcboTu zxlefI+Ka^&4B<-l$2HR@eZN|;P++@>RW(8?|JAmQ%TCQIUnc*3uV3bp|Iz*sf-wDn XC3>Crh*z}U_;>Fj{*4I;1RVSagXVYY) YY=matrix[ID].y; - } - IF (matrix[ID].y>YY){ - YY=matrix[ID].y; - IF (matrix[ID].xYY) YY=matrix[ID].y;} + IF (matrix[ID].y>YY){YY=matrix[ID].y; IF (matrix[ID].x0) + for (j=AA;j<8;j++) for (i=BB; i>0; i--) { id_curr=i*8+j; bz=i-1; _HH: id_next=bz*8+j; - IF (matrix[id_curr].mark == 1){ - IF (bz>0)&&(matrix[id_next].mark == 1){ - bz--; - GOTO _HH; - }ELSE IF (matrix[id_next].mark == 0){ + IF (matrix[id_curr].mark == 1) + IF (bz>0)&&(matrix[id_next].mark == 1) {bz--; GOTO _HH;} + ELSE IF (matrix[id_next].mark == 0) + { matrix[id_curr].color=matrix[id_next].color; matrix[id_curr].mark=matrix[id_next].mark; matrix[id_next].mark=1; } - }; - i--; } - } } byte count_blocks() -byte kol_vo; { - kol_vo=0; + byte kol_vo=0; FOR (i=0;i<8;i++) FOR (j=0;j<8;j++) IF (matrix[j*8+i].mark==0) kol_vo++; return kol_vo; } byte check_for_end () -byte end, id_next_two, id_next_one, crr; +byte id_next_two, id_next_one, crr; { - end=1; - j=0; - while (end==1)&&(j<8){ - i=0; - while (end==1)&&(i<8) + for (j=0; j<8; j++) for (i=0; i<8; i++) { crr=j*8+i; id_next_one=crr+1; - id_next_two=j+1; - id_next_two=id_next_two*8+i; - IF(matrix[crr].color==matrix[id_next_one].color)&&(matrix[crr].mark==0)&&(matrix[id_next_one].mark==0)&&(i<7) end=0; - IF (matrix[crr].color==matrix[id_next_two].color)&&(matrix[crr].mark==0)&&(matrix[id_next_two].mark==0) end=0; - i++; + id_next_two=j+1*8+i; + IF (matrix[crr].color==matrix[id_next_one].color)&&(matrix[crr].mark==0)&&(matrix[id_next_one].mark==0) return 0; + IF (matrix[crr].color==matrix[id_next_two].color)&&(matrix[crr].mark==0)&&(matrix[id_next_two].mark==0) return 0; } - j++; - } - return end; + return 1; } void move_it () -byte but_id, but_id_curr,but_id_next, x, y, xx, yy; +byte but_id_curr,but_id_next, count, x; { - for (x=0;x<8;x++){ + for (x=0;x<8;x++) + { count = 0; - FOR (y=0;y<8;y++) - { - but_id=y*8+x; - IF (matrix[but_id].mark==1) count++; - } - if (count == 8) for (yy=0;yy<8;yy++) + FOR (i=0;i<8;i++) IF (matrix[i*8+x].mark==1) count++; + if (count == 8) for (i=0;i<8;i++) { - xx=x; - WHILE (xx<7) + XX=x; + WHILE (XX<7) { - but_id_curr=yy*8+xx; - but_id_next=yy*8+xx+1; + but_id_curr=i*8+XX; + but_id_next=i*8+XX+1; matrix[but_id_curr].mark=matrix[but_id_next].mark; matrix[but_id_curr].color=matrix[but_id_next].color; matrix[but_id_next].mark=1; - IF (xx+1 == 7) matrix[but_id_next].mark=1; - xx++; + IF (XX+1 == 7) matrix[but_id_next].mark=1; + XX++; } } } @@ -155,8 +121,9 @@ byte but_id, but_id_curr,but_id_next, x, y, xx, yy; void main() -{ +{ dword id; randomize(); + skin_width = GetSkinWidth(); ReDraw_Blocks(1); loop() { @@ -187,56 +154,48 @@ void main() void ReDraw_Blocks(dword newgame) { - num=0; - for (i=0;i<8;i++) FOR (j=0;j<8;j++) DefineButton(1,1,1,1,i*8+j+BT_DEL,1); + dword num=0, y; y=skin_width; for (i=0;i<8;i++) { for (j=0;j<8;j++) { - if (newgame == 1) + IF (newgame == 1) { matrix[num].mark=0; - XX=9; - YY=0; - SWITCH (random(5)) - { - CASE 0: matrix[num].color=0x083366CC;BREAK; //Brown - CASE 1: matrix[num].color=0x08FF3333;BREAK; //Red - CASE 2: matrix[num].color=0x0866CC00;BREAK; //Green - CASE 3: matrix[num].color=0x0833CCFF;BREAK; //light Blue - CASE 4: matrix[num].color=0x08FF9900; //Orange - }; + XX=9; YY=0; + matrix[num].color = random(5)+1; } - mark=matrix[num].mark; + DefineButton(1,1,1,1,i*8+j+BT_DEL,1); matrix[num].x=j; matrix[num].y=i; - IF (mark==0) sys_draw_button(j*21+5 << 16 + 20, y << 16 + 20, num, matrix[num].color); - ELSE kos_DrawBar(j*21+5 << 16 + 21, y << 16 + 21, 0xB2B4BF); + IF (matrix[num].mark==0) + { + DefineButton(j*21+5,y-22, 20, 20, num+BT_HIDE, matrix[num].color); + PutImage(matrix[num].color-1*21*21*3+#img,21,21,j*21+5,y-22); + } ELSE DrawBar(j*21+5,y-22,21,21, 0xB2B4BF); num++; } y=y+21; } EDI = 0x00E4DFE1; //цвет панели - IF (check_for_end()==1) WriteText(95,184,0xC0,0x000000,"Результат:",10); - ELSE { - WriteText(95,184,0xC0,0x000000," Осталось:",10); - WriteText(155,184,0xC0,0x000000,IntToStr(count_blocks()),0); //Блоков осталось - } - need_redraw=0; newgame=0; + IF (check_for_end()==1) WriteText(95,178,0xC0,0x000000,"Результат:",10); //184 + ELSE WriteText(95,178,0xC0,0x000000," Осталось:",10); + WriteText(155,178,0xC0,0x000000,IntToStr(count_blocks()),0); //Блоков осталось + IF (count_blocks()<10) DrawBar(161,178,6,8,0xE4DFE1); + need_redraw=0; } void draw_window() { WindowRedrawStatus(1); - skin_width = GetSkinWidth(); DefineAndDrawWindow(300,176,177,201+skin_width,0x04,0x00B2B4BF,0,0,0); DefineButton(155,2-skin_width,18,18,600+BT_HIDE+BT_NOFRAME,0x0866CC00); //кнопка закрытия - DrawTitle(#header); + DrawTitle("Just Clicks v0.6 L&V"); DrawBar(5,168,168,29,0xE4DFE1); //поле снизу - DrawFlatButton(9,172,84,19,500,0xE4DFE1); //New - WriteText(14,178,0x80,0x5F86B6,"New game (F2) ",14); - WriteText(95,172,0x80,0," Уровень:01",10); //Уровень + DrawFlatButton(9,172,84,19,500,0xE4DFE1); //New E4DFE1 + WriteText(14,178,0x80,0,"New game (F2) ",14); + //WriteText(95,172,0x80,0," Уровень:01",10); //Уровень ReDraw_Blocks(0); WindowRedrawStatus(2); } diff --git a/programs/games/just_clicks/trunk/compile.bat b/programs/games/just_clicks/trunk/compile.bat index 01e6d0d2d6..3eef0d1b02 100644 --- a/programs/games/just_clicks/trunk/compile.bat +++ b/programs/games/just_clicks/trunk/compile.bat @@ -1,5 +1,5 @@ -files\c-- clicks.c-- +c--\c-- clicks.c-- del clicks.kex -rem rename clicks.com clicks.kex +rename clicks.com clicks.kex rename clicks clicks.kex pause \ No newline at end of file diff --git a/programs/games/just_clicks/trunk/files/History.txt b/programs/games/just_clicks/trunk/files/History.txt deleted file mode 100644 index cb45588ae1..0000000000 --- a/programs/games/just_clicks/trunk/files/History.txt +++ /dev/null @@ -1,22 +0,0 @@ -Just Clicks v0.4 -Copyright (C) 2008 Leency & Veliant -История версий: - -Just Clicks v0.4 (13.03.2005) -- окно теперь со скином -- при нажатии на кнопку больше не перерисовывается всё окно, только поле с блоками -- при нажатии на любую клавишу программа уже не уходит в бесконечный цикл -- клавиша F2 - новая игра -- устранена перерисовка окна в случае, если блоки не сдвигаются. - - - -ClickoMania -Copyright (C) 2005 Александр Мушиков aka Olaf - -История версий: - -ClickoMania v0.2 (05.12.2005) -- Исправлена ошибка - выдача сообщения о конечном результате в то время как игру можно еще продолжать. -ClickoMania v0.1 (23.11.2005) -- Начальная. \ No newline at end of file diff --git a/programs/games/just_clicks/trunk/files/RANDOM.H-- b/programs/games/just_clicks/trunk/files/RANDOM.H-- deleted file mode 100644 index 11b60c117f..0000000000 --- a/programs/games/just_clicks/trunk/files/RANDOM.H-- +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - - MenuetOS MineSweeper - Copyright (C) 2003 Ivan Poddubny - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*******************************************************************************/ - -dword generator; // random number generator - фы  ухэхЁрЎшш ёыєўрщэ√ї ўшёхы - -:int random(int max) -// get pseudo-random number - яюыєўшЄ№ яёхтфюёыєўрщэюх ўшёыю -{ - $rdtsc // eax & edx - $xor eax,edx - $not eax - - EBX = generator; - $ror ebx,3 - $xor ebx,0xdeadbeef - EBX += EAX; - generator = EBX; - - EAX += EBX; - EAX = EAX % max; - return EAX; -} - -:randomize() -// initialize random number generator - шэшЎшрышчшЁютрЄ№ ухэхЁрЄюЁ ёыєўрщэ√ї ўшёхы -{ - asm - { - mov eax,3 - int 0x40 - ror eax,16 - } - generator = EAX; -} \ No newline at end of file diff --git a/programs/games/just_clicks/trunk/files/kolibri.h-- b/programs/games/just_clicks/trunk/files/kolibri.h-- deleted file mode 100644 index 95e911c040..0000000000 --- a/programs/games/just_clicks/trunk/files/kolibri.h-- +++ /dev/null @@ -1,621 +0,0 @@ -//#startaddress 0 -#code32 TRUE - -char os_name[8] = {'M','E','N','U','E','T','0','1'}; -dword os_version = 0x00000001; -dword start_addr = #main; -dword final_addr = #stop+32; -dword alloc_mem = 0x00100000; -dword x86esp_reg = 0x0007fff0; -dword I_Param = 0x0; -dword I_Icon = 0x0; -dword skin_width; - -// KeyCode constant -#define UP_KEY 130+48 -#define DOWN_KEY 129+48 -#define LEFT_KEY 128+48 -#define RIGHT_KEY 131+48 -#define RETURN_KEY 13 - -// Color constant -#define clWhite 0x00ffffff -#define clBlack 0x00000000 -#define clRed 0x00ff0000 -#define clGreen 0x0000ff00 -#define clBlue 0x000000ff - -#define evButton 3 -#define evKey 2 -#define evReDraw 1 -#define evNet 8 - -#define BT_DEL 0x80000000 -#define BT_HIDE 0x40000000 -#define BT_NOFRAME 0x20000000 - -#define OLD -1 - -struct FileInfo{ - dword read, firstBlock, qnBlockRead, retPtr, Work; - byte filedir; -}; -//------------------------------------------------------------------------- -struct system_colors{ - dword frame,grab,grab_button,grab_button_text,grab_text,work,work_button,work_button_text,work_text,work_graph; - void get(); -}; -void system_colors::get() -{ - EAX = 48; - EBX = 3; - ECX = #frame; - EDX = 40; - $int 0x40 -} - -struct mouse -{ - dword x,y,lkm,pkm; - void get(); -}; - -void mouse::get() -{ - EAX = 37; - EBX = 1; - $int 0x40 - $mov ebx, eax - $shr eax, 16 - $and ebx,0x0000FFFF - x = EAX; - y = EBX; - EAX = 37; - EBX = 2; - $int 0x40 - $mov ebx, eax - $and eax, 0x00000001 - $shr ebx, 1 - $and ebx, 0x00000001 - lkm = EAX; - pkm = EBX; - -} -//--------------------------------------------------------------------------- -struct f70{ - dword func; - dword param1; - dword param2; - dword param3; - dword param4; - char rezerv; - dword name; -}; -//--------------------------------------------------------------------------- -struct BDVK{ - dword attr; - byte type_name; - byte rez1, rez2, rez3; - dword timecreate; - dword datecreate; - dword timelastaccess; - dword datelastaccess; - dword timelastedit; - dword datelastedit; - dword sizelo; - dword sizehi; - char name[518]; -}; -//--------------------------------------------------------------------------- -struct proc_info{ - dword use_cpu; - word pos_in_stack,num_slot,rezerv1; - char name[11]; - char rezerv2; - dword adress,use_memory,ID,left,top,width,height; - word status_slot,rezerv3; - dword work_left,work_top,work_width,work_height; - char status_window; - void getme(); -}; - -void proc_info::getme() -{ - EAX = 9; - EBX = #use_cpu; - ECX = -1; - $int 0x40 -} -//------------------------------------------------------------------------------- - -inline fastcall void begin_paint(){ -#speed - EAX = 12; // function 12:tell os about windowdraw - EBX = 1; // 1, start of draw - $int 0x40 -#codesize -} - -inline fastcall void end_paint(){ -#speed - EAX = 12; // function 12:tell os about windowdraw - EBX = 2; // 1, start of draw - $int 0x40 -#codesize -} - -/* - Отрисовка окна - {x_start|y_start}, {x_size|y_size}, color_back, color_title, color_frames - - DrawWindow( - EBX = [x_start][x_size] - ECX = [y_start][y_size] - EDX, ESI, EDI = [00RRGGBB] - ) -*/ - -inline fastcall void DrawWindow(dword EBX, ECX, EDX, ESI, EDI){ -#speed - EAX = 0; // function 0 : define and draw window - $int 0x40 -#codesize -} - -inline fastcall void DrawButton(dword EBX, ECX, EDX, ESI){ -#speed - EAX = 8; - $int 0x40 -#codesize -} - -inline fastcall dword WaitEvent(){ -#speed - EAX = 10; // wait here for event - $int 0x40 -#codesize -} - -inline fastcall void ExitProcess(){ -#speed - EAX = -1; // close this program - $int 0x40 -#codesize -} - -/* -02 = GET KEY - - ret: al 0 successful -> ah = key - al 1 no key in buffer -*/ -inline fastcall word GetKey(){ -#speed - EAX = 2; // just read it key from buffer - $int 0x40 - EAX = EAX >> 8; -#codesize -} - -/* -17 = GET PRESSED BUTTON ID - - ret: al 0 successful -> ah = id number - al 1 no key in buffer -*/ -inline fastcall word GetButtonID(){ -#speed - EAX = 17; // Get ID - $int 0x40 - EAX = EAX >> 8; -#codesize -} - -/* -58 = SYSTEM TREE ACCESS - - ebx pointer to fileinfo block - - fileinfo: - - dd 0x0 ; 0=read (/write/delete/append) - dd 0x0 ; 512 block to read 0+ - dd 0x1 ; blocks to read (/bytes to write/append) - dd 0x20000 ; return data pointer - dd 0x10000 ; work area for os - 16384 bytes - db '/RAMDISK/FIRST/KERNEL.ASM',0 ; ASCIIZ dir & filename -*/ -inline fastcall void AccessSystemTree(dword EBX){ -#speed - EAX = 58; - $int 0x40 -#codesize -} - -/* -04 = WRITE TEXT TO WINDOW - - ebx [x start]*65536 + [y start] - ecx text color 0x00RRGGBB - edx pointer to text beginning - esi text length - ret: nothing changed -*/ -inline fastcall void WriteTextXY(dword EBX, ECX, EDX, ESI){ -#speed - EAX = 4; - $int 0x40; -#codesize -} - -/* -13 = DRAW BAR - - ebx [x start]*65536 + [x size] - ecx [y start]*65536 + [y size] - edx color 0x00RRGGBB - ret: nothing changed -*/ -inline fastcall void kos_DrawBar(dword EBX, ECX, EDX){ -#speed - EAX = 13; - $int 0x40 -#codesize -} - -//CODED by Veliant -/*eax = 38 - эюьхЁ ЇєэъЎшш -ebx = [ъююЁфшэрЄр эрўрыр яю юёш x]*65536 + [ъююЁфшэрЄр ъюэЎр яю юёш x] -ecx = [ъююЁфшэрЄр эрўрыр яю юёш y]*65536 + [ъююЁфшэрЄр ъюэЎр яю юёш y] -edx = 0x00RRGGBB - ЎтхЄ -edx = 0x01xxxxxx - ЁшёютрЄ№ шэтхЁёэ√щ юЄЁхчюъ (ьырф°шх 24 сшЄр шуэюЁшЁє■Єё ) */ -inline fastcall void DrawLine(dword EBX, ECX, EDX){ -#speed - EAX = 38; - $int 0x40 -#codesize -} - -inline fastcall void DrawTitle(dword ECX) -{ -#speed - EAX = 71; - EBX = 1; - $int 0x40; -#codesize -} - -inline fastcall dword GetSkinWidth() -{ -#speed - EAX = 48; - EBX = 4; - $int 0x40 -#codesize -} - -inline fastcall dword GetScreenWidth() -{ -#speed - EAX = 14; - EBX = 4; - $int 0x40 - $shr eax, 16 - $and eax,0x0000FFFF -#codesize -} - -inline fastcall void DeleteButton(dword EDX) -{ -#speed - EAX = 8; - EDX = EDX + BT_DEL; - $int 0x40; -#codesize -} - -inline fastcall dword LoadLibrary(dword ECX) -{ -#speed - $mov eax, 68 - $mov ebx, 19 - $int 0x40 -#codesize -} - -//function GetProcAdress(hLib:integer; name:string):integer; -inline fastcall dword GetProcAdress(dword ECX, EAX) -{ -#speed -#codesize -} - -inline fastcall dword strlen(dword ESI) -{ -#speed - int len=0; - while (AL=ESBYTE[ESI]) - { - len++; - ESI++; - } - EAX=len; -#codesize -} - -//-1 - эх Ёртэ√ -// 0 - Ёртэ√ -inline fastcall dword strcmp(dword ESI,EDI) -{ -#speed - dword strcmp_i,ret,len1,len2,sovpadenij,str1,str2; - str1=ESI; - str2=EDI; - ret=-1; - sovpadenij=0; - len1=strlen(str1); - len2=strlen(str2); - if (len1==len2) - { - for (strcmp_i=0;strcmp_i=97) && (EDX<=122) ESBYTE[str+i] = DL - 32; //a-z - if (EDX>=160) && (EDX<=175) ESBYTE[str+i] = DL - 32; //р-я - if (EDX>=224) && (EDX<=239) ESBYTE[str+i] = DL - 80; //Ё-  - if (EDX == 241) ESBYTE[EAX] = 240; //╕ - } - EAX = str; - //EAX = ESDWORD[EAX]; - //if (EAX != 0x5249443C) $int 3; -#codesize -} - -inline fastcall dword lowcase(dword ESI) -{ -#speed - dword str, i; - str = ESI; - for (i=0;i=65) && (EDX<=90) ESBYTE[str+i] = DL + 32; //a-z - if (EDX>=128) && (EDX<=143) ESBYTE[str+i] = DL + 32; //р-я - if (EDX>=144) && (EDX<=159) ESBYTE[str+i] = DL + 80; //Ё-  - if (EDX == 240) ESBYTE[EAX] = 241; //╕ - } - EAX = str; - //EAX = ESDWORD[EAX]; - //if (EAX != 0x5249443C) $int 3; -#codesize -} - -inline fastcall void dostowin (dword ESI) -{ -#speed - dword stroka,dlina; - stroka = ESI; - while (BL=ESBYTE[ESI]) - { - if (BL>128) - if (BL>=240) - ESBYTE[ESI] = BL - 16; - else - ESBYTE[ESI] = BL - 64; - ESI++; - } -#codesize -} - -void WindowRedrawStatus(dword i) -{ - EAX = 12; // function 12:tell os about windowdraw - EBX = i; // 1, start of draw - $int 0x40 -} - -void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword mainAreaColour,byte headerType,dword headerColour,borderColour) -{ - dword arg1, arg2, arg3, arg4; - - // - arg1 = x << 16 + sizeX; - arg2 = y << 16 + sizeY; - arg3 = mainAreaType << 24 | mainAreaColour; - arg4 = headerType << 24 | headerColour; - // - $mov eax, 0 - $mov ebx, arg1 - $mov ecx, arg2 - $mov edx, arg3 - $mov esi, arg4 - $mov edi, borderColour - $int 0x40 -} -void DefineButton(dword x,y,w,h,id,color) -{ - DrawButton(x<<16+w, skin_width+y<<16+h, id, color); -} -void WriteText(dword x,y,byte fontType, dword color, text, len) -{ - EBX = x<<16+skin_width+y; - ECX = fontType<<24+color; - EDX = text; - ESI = len; - EAX = 4; - $int 0x40; -} -void DrawBar(dword x,y,w,h,color) -{ - kos_DrawBar(x<<16+w,skin_width+y<<16+h,color); -} - -void DrawRegion(dword x,y,width,height,color1) -{ - DrawBar(x,y,width,1,color1); //яюыюёр уюЁ ётхЁїє - DrawBar(x,y+height,width,1,color1); //яюыюёр уюЁ ёэшчє - DrawBar(x,y,1,height,color1); //яюыюёр тхЁЄ ёыхтр - DrawBar(x+width,y,1,height+1,color1); //яюыюёр тхЁЄ ёяЁртр -} - -void DrawFlatButton(dword x,y,width,height,id,color) -{ - DrawRegion(x,y,width,height,0x94AECE); - DrawBar(x+1,y+1,width-1,1,0xFFFFFF); //яюыюёр уюЁ схыр  - DrawBar(x+1,y+height-1,width-2,1,0xC0C0C0); //Єхэ№ тхЁЄ - DrawBar(x+1,y+1,1,height-1,0xFFFFFF); //яюыюёр тхЁЄ схыр  - DrawBar(x+width-1,y+2,1,height-2,0xC0C0C0); //Єхэ№ тхЁЄ - DrawBar(x+2,y+2,width-3,height-3,color); //чрыштър - if (id<>0) - { - DefineButton(x,y,width,height,id+BT_DEL,0xEFEBEF); //єфры хь ъэюяъє - DefineButton(x,y,width,height,id+BT_HIDE,0xEFEBEF); //юяЁхфхы хь ъэюяъє - } -} - -void PutImage(dword buf,w,h,x,y) -{ - int i,r,g,b; - EDI=buf; - EAX = 7; - EBX = buf; - ECX = w<<16+h; - EDX = x<<16+y+skin_width; - $int 0x40 -} - -void copystr(dword s,d) -{ - ECX=strlen(d);//юўш∙рхь ёЄрЁюх - $mov edi,d - $xor al,al - $cld - $rep $stosb - - ECX=strlen(s);//ъюяшЁєхь - $mov esi,s - $mov edi,d - $cld - $rep $movsb -} -int pos,razr,backup,j=0; -char buffer[11]=""; -int chislo; -inline fastcall dword IntToStr(dword ESI) -{ -#speed - chislo=ESI; - ECX=12; - $push edi - $mov edi,#buffer - $xor al,al - $cld - $rep $stosb - pos=razr=backup=j=0; - if (chislo<0) - { - buffer[pos]='-'; - chislo=-1*chislo; - pos++; - } - backup=chislo; - do - { - backup=backup/10; - razr++; - } - while (backup!=0); - razr--; - for (j=razr+pos;j>pos-1;j--) - { - backup=chislo/10; - backup=backup*10; - buffer[j]=chislo-backup+48; - chislo=chislo/10; - } - //return #buffer; - $pop edi; - EAX = #buffer; -#codesize -} - -inline fastcall dword MoveSize(dword EBX,ECX,EDX,ESI) -{ -#speed - EAX = 67; - $int 0x40 -#codesize -} - -f70 CopyFile_f; -BDVK CopyFile_atr; -inline fastcall dword CopyFile(dword EBX,ECX) -{ -#speed - dword s, d, buf; - s = EBX; - d = ECX; - - CopyFile_f.func = 5; - CopyFile_f.param1 = 0; - CopyFile_f.param2 = 0; - CopyFile_f.param3 = 0; - CopyFile_f.param4 = #CopyFile_atr; - CopyFile_f.rezerv = 0; - CopyFile_f.name = s; - $mov eax, 70 - $mov ebx, #CopyFile_f - $int 0x40 - - if (EAX == 0) - { - buf = malloc(CopyFile_atr.sizelo); - CopyFile_f.func = 0; - CopyFile_f.param1 = 0; - CopyFile_f.param2 = 0; - CopyFile_f.param3 = CopyFile_atr.sizelo; - CopyFile_f.param4 = buf; - CopyFile_f.rezerv = 0; - CopyFile_f.name = s; - $mov eax, 70 - $mov ebx, #CopyFile_f - $int 0x40 - - if (EAX == 0) - { - CopyFile_f.func = 2; - CopyFile_f.param1 = 0; - CopyFile_f.param2 = 0; - CopyFile_f.param3 = CopyFile_atr.sizelo; - CopyFile_f.param4 = buf; - CopyFile_f.rezerv = 0; - CopyFile_f.name = d; - $mov eax, 70 - $mov ebx, #CopyFile_f - $int 0x40 - } - } -#codesize -} diff --git a/programs/games/just_clicks/trunk/files/memory.h-- b/programs/games/just_clicks/trunk/files/memory.h-- deleted file mode 100644 index 7cdf8761a1..0000000000 --- a/programs/games/just_clicks/trunk/files/memory.h-- +++ /dev/null @@ -1,36 +0,0 @@ -#code32 TRUE -dword heap; -inline fastcall dword malloc(dword ECX){ - dword size; - #speed - size = ECX; - EAX = 68; - EBX = 11; - $int 0x40; - heap = EAX; - if (size<=heap) - { - EAX = 68; - EBX = 12; - ECX = size; - $int 0x40; - } - else EAX=-1; - #codesize -} - -inline fastcall dword free(dword ECX){ - #speed - EAX = 68; - EBX = 13; - $int 0x40; - #codesize -} - -inline fastcall dword realloc(dword ECX, EDX){ - #speed - EAX = 68; - EBX = 20; - $int 0x40; - #codesize -} \ No newline at end of file diff --git a/programs/games/just_clicks/trunk/files/startup.h-- b/programs/games/just_clicks/trunk/files/startup.h-- deleted file mode 100644 index 3ed63a619d..0000000000 --- a/programs/games/just_clicks/trunk/files/startup.h-- +++ /dev/null @@ -1,1046 +0,0 @@ -/*-----------------18.02.02 23:55------------------- - Этот файл использует компилятор для генерации начального кода программы. - Файл должен находиться в директории вместе с остальными заголовочными файлами. - Включать этот файл в свою программу директивой ?include нельзя. - --------------------------------------------------*/ - -:void CLEARPOSTAREA( (E)AX ) -{ - (E)DI = # __startpostvar; - (E)CX = # __sizepostarea; - $rep $stosb -} - -?ifdef __OBJ__ -#ifndef __FLAT__ - ?ifdef __argc - ?define __SIZEBUFCOMSTR 128+80 - ?else - ?ifdef __parsecommandline - ?define __SIZEBUFCOMSTR 128 - ?endif - ?endif - ?ifdef __parsecommandline - word __numparam; - byte __bufcomstr[__SIZEBUFCOMSTR]; - ?endif - ?ifdef __atexit - word __numatexit; - word __atexitproc[16]; - ?endif - #ifdef __environ - int environ; - #endif - -__startupproc() -inline -{ - ?ifdef __resizemem - AX=SS; - BX=ES; - AX-=BX; - BX=SP-1>>4+AX+1; - AH=0x4a; - $int 0x21 - ?endif - #ifdef __environ - environ=ESWORD[0x2C]; - #endif - $CLD - ?ifdef __parsecommandline - DI=#__bufcomstr; - DX=0; - ?ifdef __argc - AH=0x30; - $int 0x21 - IF(AL<3){ - AX=0x20; - $stosw - } - ELSE{ - $push DS - DS=ESWORD[0x2C]; - SI=0; - do{ - $lodsw - SI--; - }while(AX!=0); - $lodsw - $lodsb - ES=SS; - do{ - $lodsb - $stosb - }while(AL!=0); - $pop DS - } - DX++; - ?else - ES=SS; - ?endif - SI=0x81; -NEXTPAR: - BL=1; - do{ - $lodsb - }while(AL==0x20); -NEXTCHAR: - IF(AL!=13){ - IF(AL!=0x20){ - $stosb - $lodsb - DL+=BL; - BX=0; - GOTO NEXTCHAR; - } - AL=0; - $stosb - GOTO NEXTPAR; - } - ESWORD[#__numparam]=DX; - AX=0; - $stosw - ?else - $push SS - $pop ES - ?endif - $push SS - $pop DS - ?ifdef __atexit - ?ifndef __parsecommandline - AX=0; - ?endif - __numatexit=AX; - ?endif - main(); - ?ifdef __atexit -__startexit: - $push AX - for(;;){ - BX=__numatexit; - BX--; - IF(MINUSFLAG)BREAK; - __numatexit=BX; - BX+=BX; - $call NEAR __atexitproc[BX] - } - $pop AX - ?endif - AH=0x4C; - $int 0x21 -} -#endif //__FLAT__ -?else //__OBJ__ - -#ifdef __COM__ -//файл типа *.com - #ifdef __argc - #define __SIZEBUFCOMSTR 128+80 - #else - #ifdef __parsecommandline - #define __SIZEBUFCOMSTR 128 - #endif //__parsecommandline - #endif //__argc - #ifdef __parsecommandline - word __numparam; - byte __bufcomstr[__SIZEBUFCOMSTR]; - #endif //__parsecommandline - #ifdef __atexit - word __numatexit; - word __atexitproc[16]; - #endif //__atexit - #ifdef __environ - int environ; - #endif - -__startupproc() -inline -{ - //инициализация com-symbios - #ifdef __comsymbios - #ifdef cpu==0 - $push AX,BX,CX,DX,DI,SI,BP,ES; - #else - $pusha - $push ES - #endif - main(); - BX=__STARTPTR; - DSWORD[BX]=__STARTVALW; - DSBYTE[BX+2]=__STARTVALB; - $pop ES - #ifdef cpu==0 - $pop BP,SI,DI,DX,CX,BX,AX; - #else - $popa - #endif - goto __STARTPTR; - #undef __STARTPTR - #undef __STARTVALW - #undef __STARTVALB - #undef __comsymbios - #else - //остальные com-файлы - #ifdef __clearpost - @CLEARPOSTAREA(0); - #endif //__clearpost - #ifdef __resizemem - $pop AX - $db 0xbc -__stackval: - $dw 0 - $push AX - AH=0x4a; - $db 0xbb -__stackseg: - $dw 0 - $int 0x21 - $DB 0x73 - #ifndef __resizemessage - #ifdef __ctrl_c - $DB 2 - #else - $DB 1 - #endif //__ctrl_c - #else - #ifdef __ctrl_c - $DB 9 - #else - $DB 8 - #endif //__ctrl_c - AH=9; - DX=__RESIZEMESSAGE; - $int 0x21 - #endif //__resizemessage - $ret - #endif //__resizemem - #ifdef __ctrl_c - #ifndef __resizemem - GOTO SKIPIRET; - #endif //__resizemem - $iret -SKIPIRET: - $push DS - DS=0; - DSWORD[0x8c]=SKIPIRET-1; - DSWORD[0x8e]=CS; - $pop DS - #endif //__ctrl_c - #ifdef __environ - environ=DSWORD[0x2C]; - #endif - #ifdef __parsecommandline -// ES=SS; - DI=#__bufcomstr; - DX=0; - #ifdef __argc - AH=0x30; - $int 0x21 - IF(AL<3){ - AX=0x20; - $stosw - } - ELSE{ - $push DS - DS=DSWORD[0x2C]; - SI=0; - do{ - $lodsw - SI--; - }while(AX!=0); - $lodsw - $lodsb - do{ - $lodsb - $stosb - }while(AL!=0); - $pop DS - } - DX++; - #endif - SI=0x81; -NEXTPAR: - BL=1; - do{ - $lodsb - }while(AL==0x20); -NEXTCHAR: - IF(AL!=13){ - IF(AL!=0x20){ - $stosb - $lodsb - DL+=BL; - BX=0; - GOTO NEXTCHAR; - } - AL=0; - $stosb - GOTO NEXTPAR; - } - __numparam=DX; - AX=0; - $stosw - #endif - #ifdef __atexit - #ifndef __parsecommandline - AX=0; - #endif - __numatexit=AX; - main(); -__startexit: - for(;;){ - BX=__numatexit; - BX--; - IF(MINUSFLAG)BREAK; - __numatexit=BX; - BX+=BX; - $call NEAR __atexitproc[BX] - } - $ret - #else - #ifndef __nonejmptomain - #ifdef __shortjmp - GOTO main; - #else - goto main; - #endif - #endif - #endif - #endif //__comsymbios -} -#endif //__COM__ - -//файл типа *.exe модель small -?ifdef __EXE__ - ?ifdef __argc - ?define __SIZEBUFCOMSTR 128+80 - ?else - ?ifdef __parsecommandline - ?define __SIZEBUFCOMSTR 128 - ?endif - ?endif - ?ifdef __parsecommandline - word __numparam; - byte __bufcomstr[__SIZEBUFCOMSTR]; - ?endif - ?ifdef __atexit - word __numatexit; - word __atexitproc[16]; - ?endif - #ifdef __environ - int environ; - #endif - -__startupproc() -inline -{ - $CLD - #ifdef __environ - environ=ESWORD[0x2C]; - #endif - ?ifdef __parsecommandline - DI=#__bufcomstr; - DX=0; - ?ifdef __argc - AH=0x30; - $int 0x21 - IF(AL<3){ - AX=0x20; - $stosw - } - ELSE{ - $push DS - DS=ESWORD[0x2C]; - SI=0; - do{ - $lodsw - SI--; - }while(AX!=0); - $lodsw - $lodsb - ES=SS; - do{ - $lodsb - $stosb - }while(AL!=0); - $pop DS - } - DX++; - ?else - ES=SS; - ?endif - SI=0x81; -NEXTPAR: - BL=1; - do{ - $lodsb - }while(AL==0x20); -NEXTCHAR: - IF(AL!=13){ - IF(AL!=0x20){ - $stosb - $lodsb - DL+=BL; - BX=0; - GOTO NEXTCHAR; - } - AL=0; - $stosb - GOTO NEXTPAR; - } - ESWORD[#__numparam]=DX; - AX=0; - $stosw - ?else - $push SS - $pop ES - ?endif - $push SS - $pop DS - #ifdef __clearpost - @CLEARPOSTAREA(0); - #endif //__clearpost - ?ifdef __atexit - ?ifndef __parsecommandline - #ifndef __clearpost - AX=0; - #endif //__clearpost - ?endif - __numatexit=AX; - ?endif - main(); - ?ifdef __atexit -__startexit: - $push AX - for(;;){ - BX=__numatexit; - BX--; - IF(MINUSFLAG)BREAK; - __numatexit=BX; - BX+=BX; - $call NEAR __atexitproc[BX] - } - $pop AX - ?endif - AH=0x4C; - $int 0x21 -} -?endif //__EXE__ - -//файл типа *.exe модель tiny -?ifdef __TEXE__ - ?ifdef __argc - ?define __SIZEBUFCOMSTR 128+80 - ?else - ?ifdef __parsecommandline - ?define __SIZEBUFCOMSTR 128 - ?endif - ?endif - ?ifdef __parsecommandline - word __numparam; - byte __bufcomstr[__SIZEBUFCOMSTR]; - ?endif - ?ifdef __atexit - word __numatexit; - word __atexitproc[16]; - ?endif - #ifdef __environ - int environ; - #endif - -__startupproc() -inline -{ - $cld - #ifdef __clearpost - @CLEARPOSTAREA(0); - #endif //__clearpost - ?ifdef __resizemem - #ifdef __clearpost - $push AX - #else - ?ifdef cpu > 1 - $push 0 - ?else - AX=0; - $push AX - ?endif - #endif //__clearpost - ?endif - ?ifdef __ctrl_c - GOTO SKIPIRET; - $iret -SKIPIRET: - ES=0; - ESWORD[0x8c]=SKIPIRET-1; - ESWORD[0x8e]=CS; - ?endif //__ctrl_c - #ifdef __environ - environ=DSWORD[0x2C]; - #endif - ?ifdef __parsecommandline - ES=SS; - DI=#__bufcomstr; - DX=0; - ?ifdef __argc - AH=0x30; - $int 0x21 - IF(AL<3){ - AX=0x20; - $stosw - } - ELSE{ - $push DS - DS=DSWORD[0x2C]; - SI=0; - do{ - $lodsw - SI--; - }while(AX!=0); - $lodsw - $lodsb - do{ - $lodsb - $stosb - }while(AL!=0); - $pop DS - } - DX++; - ?endif - SI=0x81; -NEXTPAR: - BL=1; - do{ - $lodsb - }while(AL==0x20); -NEXTCHAR: - IF(AL!=13){ - IF(AL!=0x20){ - $stosb - $lodsb - DL+=BL; - BX=0; - GOTO NEXTCHAR; - } - AL=0; - $stosb - GOTO NEXTPAR; - } - __numparam=DX; - AX=0; - $stosw - ?endif - ?ifdef __atexit - ?ifndef __parsecommandline - AX=0; - ?endif - __numatexit=AX; - main(); -__startexit: - $push AX - for(;;){ - BX=__numatexit; - BX--; - IF(MINUSFLAG)BREAK; - __numatexit=BX; - BX+=BX; - $call NEAR __atexitproc[BX] - } - $pop AX - AH=0x4C; - $int 0x21 - ?else - ?ifdef __shortjmp - GOTO main; - ?else - goto main; - ?endif - ?endif -} -?endif //__TEXE__ -#endif //__OBJ__ - -//файл типа *.exe модель DOS 32 -?ifdef __DOS32__ - ?ifdef __argc - ?define __SIZEBUFCOMSTR 128+80 - ?else - ?ifdef __parsecommandline - ?define __SIZEBUFCOMSTR 128 - ?endif - ?endif - ?ifdef __parsecommandline - dword __numparam; - byte __bufcomstr[__SIZEBUFCOMSTR]; - ?endif - ?ifdef __atexit - dword __numatexit; - dword __atexitproc[16]; - ?endif - #ifdef __environ - int environ; - #endif - -__startupproc() -inline -{ - #ifdef __DPMIonly -#code32 FALSE - #ifdef __OBJ__ - #ifdef __resizemem - AX=SS; - BX=ES; - AX-=BX; - BX=SP-1>>4+AX+1; - AH=0x4a; - $int 0x21 - #endif - #endif - $CLD - $push CS - $pop DS - AX=0x1687; - $INT 0x2F; - BL>>=1; - IF(!CARRYFLAG)||(AX)GOTO DPMI_ERROR; - $push ES,DI - EAX=CS; - BX=SS; - BX-=AX; - DSWORD[#__startupproc]=BX; - EAX=EAX*16; - DSDWORD[#GDT_CODE32+2]|=EAX; - BX=SI; - AH=0x48; - $INT 0x21; - ES=AX; - AX=1; - $call SSDWORD[ESP] - IF(CARRYFLAG){ -DPMI_ERROR: - ?ifdef __resizemessage - AH=9; - DX=__RESIZEMESSAGE; - $int 0x21 - ?endif //__resizemessage - AL=-1; - GOTO EXI; - } - ES=DS; - EDI=#GDT_CODE32; - SI=SP; - DX=2; - loop(DX){ - AX=0; - CX=1; - $INT 0x31 //ALLOCATE LDT DESCRIPTOR - DSWORD[SI]=AX; // SAVE SELECTOR - BX>