Added games: donkey, invaders, piton, lines
git-svn-id: svn://kolibrios.org@950 a494cfbc-eb01-0410-851d-a64ba20cac60
33
programs/games/donkey/asm_code.asm
Normal file
@ -0,0 +1,33 @@
|
||||
|
||||
format MS COFF
|
||||
|
||||
public Start
|
||||
|
||||
extrn Memory
|
||||
extrn hEnd
|
||||
|
||||
extrn _kol_main
|
||||
|
||||
section ".text" code
|
||||
db "MENUET01"
|
||||
dd 1, Start, hEnd, Memory, hStack, 0, 0
|
||||
|
||||
Start:
|
||||
|
||||
; èíèöèàëèçàöèÿ êó÷è
|
||||
mov eax, 68
|
||||
mov ebx, 11
|
||||
int 0x40
|
||||
|
||||
; âûçîâ ãëàâíîé ïðîöåäóðû
|
||||
mov eax, _kol_main
|
||||
call eax
|
||||
|
||||
; çàâåðøåíèå ðàáîòû ïðîãðàììû
|
||||
mov eax, -1
|
||||
int 0x40
|
||||
|
||||
section ".bss"
|
||||
|
||||
rb 4096
|
||||
hStack:
|
3040
programs/games/donkey/az.h
Normal file
349
programs/games/donkey/c_code.c
Normal file
@ -0,0 +1,349 @@
|
||||
|
||||
#include "kolibri.h"
|
||||
#include "stdio.h"
|
||||
#include "stdlib.h"
|
||||
#include "string.h"
|
||||
|
||||
#include "gblib.h"
|
||||
|
||||
#include "car_01.h"
|
||||
#include "car_02.h"
|
||||
#include "donkey_01.h"
|
||||
#include "donkey_02.h"
|
||||
#include "az.h"
|
||||
|
||||
char STR_DONKEY[] = {"D O N K E Y 0.7"};
|
||||
|
||||
int start, paintbg, pause;
|
||||
int dox, doy;
|
||||
int drx, dry;
|
||||
|
||||
int drn, don;
|
||||
|
||||
int speed;
|
||||
|
||||
|
||||
GB_BMP screen, font, car01, car02, donkey01, donkey02, az;
|
||||
|
||||
|
||||
void az_putc(unsigned char c, int x, int y)
|
||||
{
|
||||
gb_image_set_t(&screen, x, y, &az, (c-'!')*11, 0, 11, 16, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void az_puts(unsigned char *s, int x, int y)
|
||||
{
|
||||
unsigned i;
|
||||
i = 0;
|
||||
while (*(s+i))
|
||||
{
|
||||
az_putc(*(s+i), x+i*11, y);
|
||||
i++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void game_start()
|
||||
{
|
||||
drx = -1;
|
||||
dry = 0;
|
||||
doy = random(40)+130;
|
||||
|
||||
dox = random(1);
|
||||
if (0 == dox)
|
||||
dox--;
|
||||
|
||||
drn = don = 0;
|
||||
paintbg = 1;
|
||||
|
||||
speed = 0;
|
||||
|
||||
kol_sleep(30);
|
||||
}
|
||||
|
||||
|
||||
void screen_back()
|
||||
{
|
||||
|
||||
gb_bar(&screen, 0, 0, 320, 200, 0x888888);
|
||||
|
||||
gb_bar(&screen, 6, 6, 97-6, 195-6, 0x488888);
|
||||
gb_bar(&screen, 183, 6, 305-183, 195-6, 0x488888);
|
||||
|
||||
az_puts("Donkey", 6, 30);
|
||||
az_puts("Driver", 189, 30);
|
||||
|
||||
az_putc (don+'0', 5, 48);
|
||||
az_putc (drn/10+'0', 189, 48);
|
||||
|
||||
az_puts("Keys:", 189, 95);
|
||||
az_puts("Space Bar", 189, 116);
|
||||
az_puts("Enter", 189, 132);
|
||||
az_puts("Esc", 189, 148);
|
||||
|
||||
|
||||
gb_line(&screen, 100, 0, 100, 199, 0xffffff);
|
||||
gb_line(&screen, 180, 0, 180, 199, 0xffffff);
|
||||
|
||||
paintbg = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void screen_draw()
|
||||
{
|
||||
|
||||
int y;
|
||||
|
||||
if (-1 == pause)
|
||||
{
|
||||
screen_back();
|
||||
|
||||
gb_bar(&screen, 4, 20, 255, 60, 0xee0000);
|
||||
az_puts ("P A U S E", 5, 30);
|
||||
az_puts ("Press Enter to continue", 5, 60);
|
||||
|
||||
kol_screen_wait_rr();
|
||||
kol_paint_image( 0, 0, 320, 200, screen.bmp);
|
||||
|
||||
paintbg = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (don > 9)
|
||||
{
|
||||
gb_bar(&screen, 0, 0, 320, 200, 0x880000);
|
||||
az_puts ("G A M E O V E R", 5, 30);
|
||||
|
||||
kol_screen_wait_rr();
|
||||
kol_paint_image( 0, 0, 320, 200, screen.bmp);
|
||||
|
||||
kol_sleep(150);
|
||||
game_start();
|
||||
start = 1;
|
||||
}
|
||||
|
||||
if (drn > 99)
|
||||
{
|
||||
gb_bar(&screen, 0, 0, 320, 200, 0x88);
|
||||
az_puts ("CONGRATULATIONS !!!", 5, 30);
|
||||
|
||||
kol_screen_wait_rr();
|
||||
kol_paint_image( 0, 0, 320, 200, screen.bmp);
|
||||
|
||||
kol_sleep(150);
|
||||
game_start();
|
||||
start = 1;
|
||||
}
|
||||
|
||||
if (drn > 9)
|
||||
speed = 1;
|
||||
|
||||
if (drn > 84)
|
||||
speed = 2;
|
||||
|
||||
|
||||
if (start)
|
||||
{
|
||||
if (!paintbg)
|
||||
return;
|
||||
|
||||
gb_bar(&screen, 0, 0, 320, 200, 0x55);
|
||||
|
||||
az_puts ( STR_DONKEY, 5, 30);
|
||||
az_puts ("remake for KolibriOS", 5, 78);
|
||||
az_puts ("by Albom", 5, 78+16);
|
||||
|
||||
az_puts ("Press Space Bar", 5, 140);
|
||||
az_puts ("to continue", 5, 156);
|
||||
|
||||
|
||||
kol_screen_wait_rr();
|
||||
kol_paint_image( 0, 0, 320, 200, screen.bmp);
|
||||
paintbg = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (paintbg)
|
||||
screen_back();
|
||||
else
|
||||
gb_bar(&screen, 102, 0, 180-102, 200, 0x888888);
|
||||
|
||||
for (y=10; y<180; y+=20)
|
||||
gb_line(&screen, 140, y-10*(doy%2), 140, y+10-10*(doy%2), 0xffffff);
|
||||
|
||||
doy-=5;
|
||||
if (doy < -50)
|
||||
{
|
||||
|
||||
dox = random(1);
|
||||
if (0 == dox)
|
||||
dox--;
|
||||
|
||||
doy = random(40)+130;
|
||||
dry += 10;
|
||||
drn++;
|
||||
if (0 == drn%10)
|
||||
dry = 0;
|
||||
paintbg = 1;
|
||||
}
|
||||
|
||||
if ((drx == dox)&&(dry > doy-15)&&(dry < doy+15))
|
||||
{
|
||||
don++;
|
||||
dry = 0;
|
||||
drn /= 10;
|
||||
drn *= 10;
|
||||
for (y = 0; y<2; y++)
|
||||
{
|
||||
kol_sleep(8);
|
||||
screen_back();
|
||||
az_puts("BOOM!", 6, 120);
|
||||
|
||||
gb_image_set_t(&screen, 140-13-(y+1)*20, 120-dry+(y+1)*20, &car01, 0, 0, 13, 34, 0x888888);
|
||||
gb_image_set_t(&screen, 120+(y+3)*20, 120-dry+(y+1)*20, &car02, 0, 0, 13, 34, 0x888888);
|
||||
|
||||
gb_image_set_t(&screen, 140-17-(y+1)*20, 120-(y+1)*20, &donkey01, 0, 0, 17, 17, 0x888888);
|
||||
gb_image_set_t(&screen, 140+(y+3)*20, 120-(y+1)*20, &donkey02, 0, 0, 13, 17, 0x888888);
|
||||
|
||||
kol_screen_wait_rr();
|
||||
kol_paint_image(0, 0, 320, 200, screen.bmp);
|
||||
}
|
||||
|
||||
dox = random(1);
|
||||
if (0 == dox)
|
||||
dox--;
|
||||
|
||||
doy = random(40)+130;
|
||||
paintbg = 1;
|
||||
}
|
||||
|
||||
gb_image_set_t(&screen, 140-13-drx*20, 130-dry, &car01, 0, 0, 13, 34, 0x888888);
|
||||
gb_image_set_t(&screen, 140-drx*20, 130-dry, &car02, 0, 0, 13, 34, 0x888888);
|
||||
|
||||
gb_image_set_t(&screen, 140-17-dox*20, 130-doy, &donkey01, 0, 0, 17, 17, 0x888888);
|
||||
gb_image_set_t(&screen, 140-dox*20, 130-doy, &donkey02, 0, 0, 13, 17, 0x888888);
|
||||
|
||||
kol_screen_wait_rr();
|
||||
kol_paint_image(0, 0, 320, 200, screen.bmp);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void wnd_draw()
|
||||
{
|
||||
kol_paint_start();
|
||||
kol_wnd_define(280, 200, 328, 204+kol_skin_height(), 0x34888888);
|
||||
kol_wnd_caption(STR_DONKEY);
|
||||
screen_draw();
|
||||
kol_paint_end();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void kol_main()
|
||||
{
|
||||
|
||||
unsigned event;
|
||||
unsigned key;
|
||||
|
||||
srand(kol_system_time_get()<<8);
|
||||
start = 1;
|
||||
paintbg = 1;
|
||||
|
||||
pause = 1;
|
||||
|
||||
speed = 0;
|
||||
|
||||
screen.bmp = malloc(320*200*3);
|
||||
screen.w = 320;
|
||||
screen.h = 200;
|
||||
|
||||
car01.bmp = CAR_01;
|
||||
car01.w = 13;
|
||||
car01.h = 34;
|
||||
|
||||
car02.bmp = CAR_02;
|
||||
car02.w = 13;
|
||||
car02.h = 34;
|
||||
|
||||
donkey01.bmp = DONKEY_01;
|
||||
donkey01.w = 17;
|
||||
donkey01.h = 17;
|
||||
|
||||
donkey02.bmp = DONKEY_02;
|
||||
donkey02.w = 13;
|
||||
donkey02.h = 17;
|
||||
|
||||
az.bmp = AZ;
|
||||
az.w = 1012;
|
||||
az.h = 16;
|
||||
|
||||
|
||||
wnd_draw();
|
||||
|
||||
for (;;)
|
||||
{
|
||||
|
||||
kol_sleep(6-speed);
|
||||
screen_draw();
|
||||
event = kol_event_check();
|
||||
|
||||
switch (event)
|
||||
{
|
||||
case 1:
|
||||
paintbg = 1;
|
||||
wnd_draw();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
key = (kol_key_get() & 0xff00)>>8;
|
||||
if (start && (32==key))
|
||||
{
|
||||
start = 0;
|
||||
game_start();
|
||||
screen_draw();
|
||||
break;
|
||||
}
|
||||
|
||||
if (27 == key)
|
||||
{
|
||||
if (-1 == pause)
|
||||
break;
|
||||
start = 1;
|
||||
paintbg = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (32 == key)
|
||||
{
|
||||
if (-1 == pause)
|
||||
break;
|
||||
drx *= -1;
|
||||
screen_draw();
|
||||
}
|
||||
|
||||
if ((!start) && (13 == key))
|
||||
{
|
||||
pause *= -1;
|
||||
screen_draw();
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if ( 1 == (kol_btn_get() & 0xff00)>>8 )
|
||||
kol_exit();
|
||||
break;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
}
|
85
programs/games/donkey/car_01.h
Normal file
@ -0,0 +1,85 @@
|
||||
char CAR_01[]= {
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,
|
||||
0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,
|
||||
0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,
|
||||
0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,
|
||||
0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,
|
||||
0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,
|
||||
0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,
|
||||
0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,
|
||||
0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,
|
||||
0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,
|
||||
0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,
|
||||
0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,
|
||||
0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,
|
||||
0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,
|
||||
0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0xff,0x80,0x00,0xff,
|
||||
0x80,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,
|
||||
0xff,0x80,0x00,0x80,0x00,0x00,0x80,0x00,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x00,0xf0,0xf0,0xff,0x80,0x00,0x80,0x00,0x00,0x80,0x00,0x00,0x80,0x00,0x00,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0xff,0x80,0x00,0x80,0x00,
|
||||
0x00,0x80,0x00,0x00,0x80,0x00,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,
|
||||
0xf0,0xf0,0xff,0x80,0x00,0x80,0x00,0x00,0x80,0x00,0x00,0x80,0x00,0x00,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0xff,0x80,0x00,0x80,0x00,0x00,0x80,
|
||||
0x00,0x00,0x80,0x00,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,
|
||||
0xff,0x80,0x00,0xff,0x80,0x00,0xff,0x80,0x00,0xff,0x80,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,
|
||||
0x00,0xf0,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0xff,0x80,
|
||||
0x00,0xff,0x80,0x00,0xff,0x80,0x00,0x00,0xf0,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x00,0xf0,0xf0,0xff,0x80,0x00,0x00,0x00,0x00,0xff,0x80,0x00,0x00,0xf0,
|
||||
0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0xff,0x80,0x00,0xff,
|
||||
0x80,0x00,0xff,0x80,0x00,0x00,0xf0,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,
|
||||
0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x88,
|
||||
0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0xff,0x80,0x00,0xff,0x80,0x00,
|
||||
0xff,0x80,0x00,0x00,0xf0,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,
|
||||
0xf0,0xff,0x80,0x00,0x00,0x00,0x00,0xff,0x80,0x00,0x00,0xf0,0xf0,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0xff,0x80,0x00,0xff,0x80,0x00,0xff,0x80,
|
||||
0x00,0x00,0xf0,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,
|
||||
0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x00,0xf0,0xf0,0xff,0x80,0x00,0xff,0x80,0x00,0xff,0x80,0x00,0x00,
|
||||
0xf0,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0xff,0x80,0x00,
|
||||
0x00,0x00,0x00,0xff,0x80,0x00,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x00,0xf0,0xf0,0xff,0x80,0x00,0xff,0x80,0x00,0xff,0x80,0x00,0x00,0xf0,0xf0,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,
|
||||
0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,
|
||||
0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0xff
|
||||
};
|
85
programs/games/donkey/car_02.h
Normal file
@ -0,0 +1,85 @@
|
||||
char CAR_02[]= {
|
||||
0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,
|
||||
0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,
|
||||
0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,
|
||||
0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,
|
||||
0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,
|
||||
0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,
|
||||
0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,
|
||||
0x88,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,
|
||||
0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,
|
||||
0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x00,
|
||||
0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,
|
||||
0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,
|
||||
0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,
|
||||
0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0xff,0x80,0x00,0xff,0x80,
|
||||
0x00,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x80,0x00,0x00,0x80,0x00,0x00,0xff,0x80,0x00,0x00,0xf0,0xf0,0x00,0xf0,
|
||||
0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x80,0x00,0x00,0x80,0x00,0x00,0x80,
|
||||
0x00,0x00,0xff,0x80,0x00,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x80,0x00,0x00,0x80,0x00,0x00,0x80,0x00,0x00,0xff,0x80,0x00,0x00,0xf0,0xf0,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x80,0x00,0x00,0x80,0x00,0x00,0x80,0x00,0x00,
|
||||
0xff,0x80,0x00,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x80,0x00,
|
||||
0x00,0x80,0x00,0x00,0x80,0x00,0x00,0xff,0x80,0x00,0x00,0xf0,0xf0,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0xff,0x80,0x00,0xff,0x80,0x00,0xff,0x80,0x00,0xff,0x80,
|
||||
0x00,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,
|
||||
0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0xf0,0xf0,0xff,0x80,0x00,0xff,0x80,0x00,0xff,0x80,0x00,0x00,
|
||||
0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xf0,0xff,0x80,0x00,
|
||||
0x00,0x00,0x00,0xff,0x80,0x00,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0xf0,0xf0,0xff,0x80,0x00,0xff,0x80,0x00,0xff,0x80,0x00,0x00,0xf0,0xf0,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,
|
||||
0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0xf0,0xf0,0xff,0x80,0x00,0xff,0x80,0x00,0xff,0x80,0x00,0x00,0xf0,0xf0,0x00,0xf0,
|
||||
0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xf0,0xff,0x80,0x00,0x00,0x00,0x00,0xff,
|
||||
0x80,0x00,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xf0,
|
||||
0xff,0x80,0x00,0xff,0x80,0x00,0xff,0x80,0x00,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,
|
||||
0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xf0,0xff,0x80,
|
||||
0x00,0xff,0x80,0x00,0xff,0x80,0x00,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0xf0,0xf0,0xff,0x80,0x00,0x00,0x00,0x00,0xff,0x80,0x00,0x00,0xf0,
|
||||
0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xf0,0xff,0x80,0x00,0xff,
|
||||
0x80,0x00,0xff,0x80,0x00,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x00,0xf0,0xf0,
|
||||
0x00,0xf0,0xf0,0x00,0xf0,0xf0,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0xff
|
||||
};
|
5
programs/games/donkey/compile.bat
Normal file
@ -0,0 +1,5 @@
|
||||
fasm asm_code.asm
|
||||
gcc -c c_code.c
|
||||
ld -nostdlib -T kolibri.ld -o donkey.kex asm_code.obj kolibri.o stdlib.o string.o gblib.o c_code.o
|
||||
objcopy donkey.kex -O binary
|
||||
pause
|
57
programs/games/donkey/donkey_01.h
Normal file
@ -0,0 +1,57 @@
|
||||
char DONKEY_01[]= {
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x40,0x80,0x00,0x40,
|
||||
0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,
|
||||
0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x40,
|
||||
0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,
|
||||
0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,
|
||||
0x40,0x80,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x40,
|
||||
0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,
|
||||
0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,
|
||||
0x40,0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,
|
||||
0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,
|
||||
0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,
|
||||
0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,
|
||||
0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x00,0x40,0x80,0x88,0x88,0x88,0x00,0x40,0x80,0x00,0x40,0x80,
|
||||
0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,
|
||||
0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,0x88,
|
||||
0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x00,0x40,0x80,
|
||||
0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,
|
||||
0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,
|
||||
0x80,0x88,0x88,0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,
|
||||
0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,
|
||||
0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x00,0x40,0x80,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x00,
|
||||
0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,
|
||||
0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,
|
||||
0x88,0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x00,
|
||||
0x40,0x80,0x88,0x88,0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x40,0x80,0x00,
|
||||
0x40,0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,
|
||||
0x80,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,
|
||||
0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x00,0x40,0x80,0x00,0x40,
|
||||
0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0xff
|
||||
};
|
44
programs/games/donkey/donkey_02.h
Normal file
@ -0,0 +1,44 @@
|
||||
char DONKEY_02[]= {
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x00,0x40,0x80,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x88,
|
||||
0x88,0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,
|
||||
0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x00,0x40,0x80,0x00,
|
||||
0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,
|
||||
0x80,0xff,0x80,0x00,0x00,0x40,0x80,0x00,0x40,0x80,0xff,0x80,0x00,0x00,0x40,0x80,
|
||||
0x88,0x88,0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,
|
||||
0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0xff,0x80,0x00,0x00,0x40,0x80,0x00,0x40,
|
||||
0x80,0xff,0x80,0x00,0x00,0x40,0x80,0x88,0x88,0x88,0x00,0x40,0x80,0x00,0x40,0x80,
|
||||
0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,
|
||||
0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,
|
||||
0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,
|
||||
0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,
|
||||
0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,
|
||||
0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,
|
||||
0x88,0x88,0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,
|
||||
0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,
|
||||
0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x40,0x80,
|
||||
0x00,0x40,0x80,0x88,0x88,0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,
|
||||
0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x00,0x40,0x80,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x40,0x80,
|
||||
0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x00,
|
||||
0x40,0x80,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,0x88,0x88,
|
||||
0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x40,0x80,0x00,0x40,
|
||||
0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x00,0x40,
|
||||
0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x00,
|
||||
0x40,0x80,0x88,0x88,0x88,0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x00,0x40,0x80,0x00,0x40,0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x00,0x40,0x80,0x00,
|
||||
0x40,0x80,0x00,0x40,0x80,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88,
|
||||
0x88,0x88,0x88,0x88,0x88,0x88,0x88,0xff
|
||||
};
|
16
programs/games/donkey/gblib.h
Normal file
@ -0,0 +1,16 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int w __attribute__((packed));
|
||||
int h __attribute__((packed));
|
||||
char *bmp __attribute__((packed));
|
||||
char *alpha __attribute__((packed));
|
||||
} GB_BMP __attribute__((packed));
|
||||
|
||||
void gb_pixel_set(GB_BMP *b, int x, int y, unsigned c);
|
||||
int gb_pixel_get(GB_BMP *b, int x, int y, unsigned *c);
|
||||
void gb_line(GB_BMP *b, int x1, int y1, int x2, int y2, unsigned c);
|
||||
void gb_rect(GB_BMP *b, int x, int y, int w, int h, unsigned c);
|
||||
void gb_bar(GB_BMP *b, int x, int y, int w, int h, unsigned c);
|
||||
void gb_image_set(GB_BMP *b_dest, int x_d, int y_d, GB_BMP *b_src, int x_s, int y_s, int w, int h);
|
||||
void gb_image_set_t(GB_BMP *b_dest, int x_d, int y_d, GB_BMP *b_src, int x_s, int y_s, int w, int h, unsigned c);
|
73
programs/games/donkey/kolibri.h
Normal file
@ -0,0 +1,73 @@
|
||||
|
||||
#define NULL ((void*)0)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned p00 __attribute__((packed));
|
||||
unsigned p04 __attribute__((packed));
|
||||
unsigned p08 __attribute__((packed));
|
||||
unsigned p12 __attribute__((packed));
|
||||
unsigned p16 __attribute__((packed));
|
||||
char p20 __attribute__((packed));
|
||||
char *p21 __attribute__((packed));
|
||||
} kol_struct70 __attribute__((packed));
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned p00 __attribute__((packed));
|
||||
char p04 __attribute__((packed));
|
||||
char p05[3] __attribute__((packed));
|
||||
unsigned p08 __attribute__((packed));
|
||||
unsigned p12 __attribute__((packed));
|
||||
unsigned p16 __attribute__((packed));
|
||||
unsigned p20 __attribute__((packed));
|
||||
unsigned p24 __attribute__((packed));
|
||||
unsigned p28 __attribute__((packed));
|
||||
unsigned p32[2] __attribute__((packed));
|
||||
} kol_struct_BDVK __attribute__((packed));
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *name __attribute__((packed));
|
||||
void *data __attribute__((packed));
|
||||
} kol_struct_import __attribute__((packed));
|
||||
|
||||
|
||||
void kol_exit();
|
||||
void kol_sleep(unsigned d);
|
||||
void kol_wnd_define(unsigned x, unsigned y, unsigned w, unsigned h, unsigned c);
|
||||
void kol_wnd_caption(char *s);
|
||||
void kol_event_mask(unsigned e);
|
||||
unsigned kol_event_wait();
|
||||
unsigned kol_event_wait_time(unsigned time);
|
||||
unsigned kol_event_check();
|
||||
void kol_paint_start();
|
||||
void kol_paint_end();
|
||||
void kol_paint_pixel(unsigned x, unsigned y, unsigned c);
|
||||
void kol_paint_bar(unsigned x, unsigned y, unsigned w, unsigned h, unsigned c);
|
||||
void kol_paint_line(unsigned x1, unsigned y1, unsigned x2, unsigned y2, unsigned c);
|
||||
void kol_paint_string(unsigned x, unsigned y, char *s, unsigned c);
|
||||
void kol_paint_image(unsigned x, unsigned y, unsigned w, unsigned h, char *d);
|
||||
unsigned kol_key_get();
|
||||
void kol_btn_define(unsigned x, unsigned y, unsigned w, unsigned h, unsigned d, unsigned c);
|
||||
unsigned kol_btn_get();
|
||||
void kol_btn_type(unsigned t);
|
||||
unsigned kol_mouse_pos();
|
||||
unsigned kol_mouse_posw();
|
||||
unsigned kol_mouse_btn();
|
||||
void kol_board_putc(char c);
|
||||
void kol_board_puts(char *s);
|
||||
unsigned kol_file_70(kol_struct70 *k);
|
||||
kol_struct_import* kol_cofflib_load(char *name);
|
||||
void* kol_cofflib_procload (kol_struct_import *imp, char *name);
|
||||
unsigned kol_cofflib_procnum (kol_struct_import *imp);
|
||||
void kol_cofflib_procname (kol_struct_import *imp, char *name, unsigned n);
|
||||
unsigned kol_system_cpufreq();
|
||||
unsigned kol_system_mem();
|
||||
unsigned kol_system_memfree();
|
||||
unsigned kol_system_time_get();
|
||||
void kol_path_file2dir(char *dir, char *fname);
|
||||
void kol_path_full(char *full, char *fname);
|
||||
void kol_screen_wait_rr();
|
||||
unsigned kol_skin_height();
|
20
programs/games/donkey/kolibri.ld
Normal file
@ -0,0 +1,20 @@
|
||||
/*OUTPUT_FORMAT("binary")*/
|
||||
ENTRY(Start)
|
||||
SECTIONS
|
||||
{
|
||||
.text 0x000000:
|
||||
{
|
||||
*(.text)
|
||||
}
|
||||
|
||||
.data : {
|
||||
*(.data)
|
||||
hEnd = . ;
|
||||
}
|
||||
|
||||
.bss :
|
||||
{
|
||||
*(.bss)
|
||||
}
|
||||
Memory = . ;
|
||||
}
|
16
programs/games/donkey/readme.txt
Normal file
@ -0,0 +1,16 @@
|
||||
Игра Donkey
|
||||
версия 0.7
|
||||
==============
|
||||
|
||||
Интересна тем, что версию под DOS написал Билл Гейтс.
|
||||
Исходники версии для QBasic прилагаются.
|
||||
|
||||
Эта версия - ремейк для KolibriOS, потому что из оригинала
|
||||
заимствованы только интерфейс и правила, а код собственный.
|
||||
|
||||
Версия 0.7 написана с использованием библиотеки gblib.
|
||||
|
||||
==============
|
||||
|
||||
автор: Александр Богомаз aka Albom (albom85@yandex.ru)
|
||||
26 марта 2008
|
14
programs/games/donkey/stdlib.h
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
#define RAND_MAX 0x7FFFU
|
||||
|
||||
#define isspace(c) ((c)==' ')
|
||||
#define abs(i) (((i)<0)?(-(i)):(i))
|
||||
|
||||
#define random(num) ((rand()*(num))/((RAND_MAX+1)))
|
||||
|
||||
void* malloc(unsigned size);
|
||||
void free(void *pointer);
|
||||
void* realloc(void* pointer, unsigned size);
|
||||
|
||||
void srand (unsigned seed);
|
||||
int rand (void);
|
9
programs/games/donkey/string.h
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
void* memset(void *mem, int c, unsigned size);
|
||||
void* memcpy(void *dst, const void *src, unsigned size);
|
||||
|
||||
char* strcat(char* strDest, const char* strSource);
|
||||
int strcmp(const char* string1, const char* string2);
|
||||
char* strcpy(char *strDest, const char *strSource);
|
||||
char* strncpy(char *strDest, const char *strSource, unsigned n);
|
||||
int strlen(const char* string);
|
1388
programs/games/invaders/ASCGL.INC
Normal file
BIN
programs/games/invaders/alien.gif
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
programs/games/invaders/bullet.gif
Normal file
After Width: | Height: | Size: 855 B |
BIN
programs/games/invaders/bullet2.gif
Normal file
After Width: | Height: | Size: 862 B |
BIN
programs/games/invaders/enemy1.gif
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
programs/games/invaders/enemy2.gif
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
programs/games/invaders/enemy3.gif
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
programs/games/invaders/enemy4.gif
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
programs/games/invaders/enemy5.gif
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
programs/games/invaders/font_capital.gif
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
programs/games/invaders/font_small.gif
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
programs/games/invaders/gameover.gif
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
programs/games/invaders/highscores.gif
Normal file
After Width: | Height: | Size: 4.9 KiB |
1408
programs/games/invaders/invaders.asm
Normal file
BIN
programs/games/invaders/invaders.dat
Normal file
108
programs/games/invaders/invaders_kolibri.inc
Normal file
@ -0,0 +1,108 @@
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01' ; 8 byte id
|
||||
dd 0x01 ; header version
|
||||
dd START ; start of code
|
||||
dd IM_END ; size of image
|
||||
dd I_END+1000 ; memory for app
|
||||
dd I_END+1000 ; esp
|
||||
dd 0x0 , 0x0 ; I_Param , I_Icon
|
||||
|
||||
|
||||
KEY_RIGHT equ 179
|
||||
KEY_LEFT equ 176
|
||||
KEY_UP equ 178
|
||||
KEY_P equ 'p'
|
||||
KEY_DOWN equ 177
|
||||
KEY_ENTER equ 13
|
||||
KEY_ESC equ 27
|
||||
|
||||
START:
|
||||
mov [drawroutine], draw_picture_kolibri
|
||||
call draw_window
|
||||
jmp decodegif
|
||||
|
||||
draw_picture_kolibri:
|
||||
|
||||
mov eax,7 ; Draw buffer to screen
|
||||
mov ebx,vscreen+8
|
||||
mov ecx,SCREEN_X*65536+SCREEN_Y
|
||||
mov edx,SCREEN_X_POS*65536+SCREEN_Y_POS
|
||||
int 0x40
|
||||
|
||||
ret
|
||||
|
||||
waitandgetkey:
|
||||
|
||||
mov eax, 5
|
||||
mov ebx, 1
|
||||
int 0x40
|
||||
|
||||
mov eax, 11 ; check for event (no wait)
|
||||
int 0x40
|
||||
|
||||
cmp eax,1 ; redraw request ?
|
||||
je red
|
||||
cmp eax,2 ; key in buffer ?
|
||||
je key
|
||||
cmp eax,3 ; button in buffer ?
|
||||
je button
|
||||
|
||||
xor ax,ax
|
||||
|
||||
ret
|
||||
|
||||
red: ; redraw
|
||||
call draw_window
|
||||
|
||||
jmp waitandgetkey
|
||||
|
||||
key: ; key
|
||||
mov eax,2 ; read it
|
||||
int 0x40
|
||||
|
||||
mov al, ah
|
||||
|
||||
ret
|
||||
|
||||
button: ; button
|
||||
mov eax,17 ; get id
|
||||
int 0x40
|
||||
|
||||
cmp ah,1 ; button id=1 ?
|
||||
jne noclose
|
||||
|
||||
exit:
|
||||
mov eax,-1 ; close this program
|
||||
int 0x40
|
||||
noclose:
|
||||
|
||||
jmp waitandgetkey
|
||||
|
||||
|
||||
draw_window:
|
||||
mov eax,12 ; function 12:tell os about windowdraw
|
||||
mov ebx,1 ; 1, start of draw
|
||||
int 0x40
|
||||
; DRAW WINDOW
|
||||
mov eax,0 ; function 0 : define and draw window
|
||||
mov ebx,WINDOW_X*65536+10+SCREEN_X ; [x start] *65536 + [x size]
|
||||
mov ecx,WINDOW_Y*65536+30+SCREEN_Y ; [y start] *65536 + [y size]
|
||||
mov edx,0x04000000 ; color of work area RRGGBB,8->color gl
|
||||
mov esi,0x805080d0 ; color of grab bar RRGGBB,8->color gl
|
||||
mov edi,0x005080d0 ; color of frames RRGGBB
|
||||
int 0x40
|
||||
|
||||
call [drawroutine]
|
||||
|
||||
mov eax,12 ; function 12:tell os about windowdraw
|
||||
mov ebx,2 ; 2, end of draw
|
||||
int 0x40
|
||||
|
||||
ret
|
||||
|
||||
load_highscores:
|
||||
ret
|
||||
|
||||
save_highscores:
|
||||
ret
|
BIN
programs/games/invaders/logo.gif
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
programs/games/invaders/menu1.gif
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
programs/games/invaders/menu2.gif
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
programs/games/invaders/menu3.gif
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
programs/games/invaders/menu4.gif
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
programs/games/invaders/nextlevel.gif
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
programs/games/invaders/numbers.gif
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
programs/games/invaders/pause.gif
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
programs/games/invaders/ship.gif
Normal file
After Width: | Height: | Size: 1.2 KiB |
183
programs/games/lines/ball_operations.inc
Normal file
@ -0,0 +1,183 @@
|
||||
;<EFBFBD>ˆ‘Ž‚€<EFBFBD>ˆ… ˜€<EFBFBD>ˆŠ€, <EFBFBD>Ž ‡€„€<EFBFBD><EFBFBD>ŽŒ“ ID Š<EFBFBD>Ž<EFBFBD>Šˆ (AX)
|
||||
paint_ball:
|
||||
pushad
|
||||
|
||||
movzx bx, byte [eax*2 + lineCoord - 4]
|
||||
movzx cx, byte [eax*2 + lineCoord - 3]
|
||||
|
||||
movzx eax, byte [eax + lineBall - 2]
|
||||
test eax, eax
|
||||
jz @F
|
||||
|
||||
mov edx,[tableColor+eax*4]
|
||||
|
||||
imul bx, bx, 37
|
||||
add bx, 11
|
||||
shl ebx, 16
|
||||
mov bx, 19 ; ebx=[x start]*65536+[x size]
|
||||
|
||||
imul cx, cx, 37
|
||||
add cx, 57
|
||||
shl ecx, 16
|
||||
mov cx, 19 ; ecx=[y start]*65536+[y size]
|
||||
|
||||
mcall 13
|
||||
@@:
|
||||
popad
|
||||
ret
|
||||
|
||||
|
||||
;Ž<EFBFBD><EFBFBD>ˆ‘Ž‚Š€ <EFBFBD>€ŒŠˆ ‚ŽŠ<EFBFBD>“ƒ ‚›<EFBFBD><EFBFBD>€<EFBFBD><EFBFBD>ŽƒŽ ˜€<EFBFBD>ˆŠ€ [current]
|
||||
choice_ball:
|
||||
pushad
|
||||
mov eax, [current]
|
||||
movzx bx, byte [eax*2 + lineCoord - 4]
|
||||
movzx cx, byte [eax*2 + lineCoord - 3]
|
||||
|
||||
imul bx, bx, 37
|
||||
add bx, 3
|
||||
shl ebx, 16
|
||||
mov bx, 34 ; ebx=[x start]*65536+[x size]
|
||||
|
||||
imul cx, cx, 37
|
||||
add cx, 49
|
||||
shl ecx, 16
|
||||
mov cx, 34 ; ecx=[y start]*65536+[y size]
|
||||
|
||||
mov edx,0x0
|
||||
mcall 13
|
||||
popad
|
||||
ret
|
||||
|
||||
;<EFBFBD>…<EFBFBD>…<EFBFBD>ˆ‘Ž‚Š€ Ÿ—…‰Šˆ (eax)
|
||||
redraw_cell:
|
||||
pushad
|
||||
or eax, 0x80000000
|
||||
mov edx,eax
|
||||
mcall 8
|
||||
|
||||
and edx, 0x7FFFFFFF
|
||||
movzx bx, byte [edx*2 + lineCoord - 4]
|
||||
movzx cx, byte [edx*2 + lineCoord - 3]
|
||||
|
||||
imul bx, bx, 37
|
||||
add bx, 3
|
||||
shl ebx, 16
|
||||
mov bx, 34 ; ebx=[x start]*65536+[x size]
|
||||
|
||||
imul cx, cx, 37
|
||||
add cx, 49
|
||||
shl ecx, 16
|
||||
mov cx, 34 ; ecx=[y start]*65536+[y size]
|
||||
|
||||
mov esi, 0x00B8C2D3
|
||||
mcall 8
|
||||
|
||||
popad
|
||||
ret
|
||||
|
||||
;<EFBFBD><EFBFBD>Ž–…„“<EFBFBD>€ <EFBFBD><EFBFBD>Ž‚…<EFBFBD>Šˆ „‹ˆ<EFBFBD>› ‹ˆ<EFBFBD>ˆ‰ ˆ ‘<EFBFBD>ˆ‚€<EFBFBD>ˆ… ˜€<EFBFBD>ˆŠŽ‚
|
||||
vanish_balls:
|
||||
|
||||
mov [countVanishBall], 0
|
||||
mov al, [findUpDown]
|
||||
cmp al, 4
|
||||
jb @F
|
||||
|
||||
add [countVanishBall], al
|
||||
mov ah, 1
|
||||
call zero_vanish_matrix
|
||||
mov ah, 2
|
||||
call zero_vanish_matrix
|
||||
@@:
|
||||
mov al, [findRightLeft]
|
||||
cmp al, 4
|
||||
jb @F
|
||||
|
||||
add [countVanishBall], al
|
||||
mov ah, 3
|
||||
call zero_vanish_matrix
|
||||
mov ah, 4
|
||||
call zero_vanish_matrix
|
||||
@@:
|
||||
mov al, [findUpRight_DownLeft]
|
||||
cmp al, 4
|
||||
jb @F
|
||||
|
||||
add [countVanishBall], al
|
||||
mov ah, 7
|
||||
call zero_vanish_matrix
|
||||
mov ah, 8
|
||||
call zero_vanish_matrix
|
||||
@@:
|
||||
mov al, [findUpLeft_DownRight]
|
||||
cmp al, 4
|
||||
jb @F
|
||||
|
||||
add [countVanishBall], al
|
||||
mov ah, 5
|
||||
call zero_vanish_matrix
|
||||
mov ah, 6
|
||||
call zero_vanish_matrix
|
||||
@@:
|
||||
ret
|
||||
|
||||
;®¡ã«ï¥â ¬ âà¨æã ¯® ᮮ⢠§ 票î ah
|
||||
zero_vanish_matrix:
|
||||
|
||||
mov ecx, 81
|
||||
mov edi, lineBall
|
||||
xor al, al
|
||||
|
||||
.cycle_zeros:
|
||||
mov dl, [edi]
|
||||
shr dl, 4
|
||||
cmp dl, 0x0F
|
||||
je @F
|
||||
cmp dl, ah
|
||||
je @F
|
||||
inc edi
|
||||
jmp .temp
|
||||
@@:
|
||||
stosb
|
||||
push eax
|
||||
mov eax, edi
|
||||
sub eax, lineBall - 1
|
||||
call redraw_cell
|
||||
pop eax
|
||||
.temp:
|
||||
loop .cycle_zeros
|
||||
ret
|
||||
|
||||
;<EFBFBD>ˆ‘“…Œ <EFBFBD>Ž‚›… –‚…’€
|
||||
paint_new_color:
|
||||
movzx eax, [newColor1]
|
||||
mov edx, [tableColor + eax*4]
|
||||
mov ebx, 123*65536 + 19
|
||||
mov ecx, 15*65536 + 19
|
||||
mcall 13
|
||||
movzx eax, [newColor2]
|
||||
mov edx, [tableColor + eax*4]
|
||||
mov ebx, 160*65536 + 19
|
||||
mov ecx, 15*65536 + 19
|
||||
mcall 13
|
||||
movzx eax, [newColor3]
|
||||
mov edx, [tableColor + eax*4]
|
||||
mov ebx, 197*65536 + 19
|
||||
mov ecx, 15*65536 + 19
|
||||
mcall 13
|
||||
ret
|
||||
|
||||
;<EFBFBD>ˆ‘“…Œ Ž—Šˆ
|
||||
redraw_score:
|
||||
mov ebx, 8*65536 + 100
|
||||
mov ecx, 20*65536 + 20
|
||||
mov edx, 0x0
|
||||
mcall 13
|
||||
|
||||
mov ebx, 0xB0000
|
||||
mov ecx, [score]
|
||||
mov edx, 15*65536 + 27
|
||||
mov esi, 0x10ffffff
|
||||
mcall 47
|
||||
ret
|
128
programs/games/lines/basic_alg.inc
Normal file
@ -0,0 +1,128 @@
|
||||
;<EFBFBD><EFBFBD>Ž–…„“<EFBFBD>€ <EFBFBD><EFBFBD>Ž‚…<EFBFBD>Šˆ ‘“™…‘’‚Ž‚€<EFBFBD>ˆŸ <EFBFBD>“’ˆ „Ž Š<EFBFBD>Ž<EFBFBD>Šˆ [dest] ¨§ EAX
|
||||
test_path:
|
||||
pushad
|
||||
mov cx, [lineCoord + eax*2 - 4]
|
||||
mov edx, eax
|
||||
cmp eax, [current]
|
||||
je .recurs_call
|
||||
|
||||
cmp eax, [dest]
|
||||
je .end_yes
|
||||
|
||||
cmp byte [eax + lineBall - 2], 0
|
||||
jne .end_no
|
||||
|
||||
or byte [eax + lineBall - 2], 0x8 ;4-© ¡¨â - 1 (cheked)
|
||||
|
||||
.recurs_call:
|
||||
;â㯮© ¢ë§®¢ ¤«ï á®á¥¤¨å ª«¥â®ª
|
||||
test cl, cl
|
||||
jz @F
|
||||
sub eax, 9
|
||||
call test_path
|
||||
jc .end_yes
|
||||
|
||||
@@:
|
||||
test cl, 8
|
||||
jnz @F
|
||||
mov eax, edx
|
||||
add eax, 9
|
||||
call test_path
|
||||
jc .end_yes
|
||||
|
||||
@@:
|
||||
test ch, ch
|
||||
jz @F
|
||||
mov eax, edx
|
||||
dec eax
|
||||
call test_path
|
||||
jc .end_yes
|
||||
|
||||
@@:
|
||||
test ch, 8
|
||||
jnz .end_no
|
||||
mov eax, edx
|
||||
inc eax
|
||||
call test_path
|
||||
jc .end_yes
|
||||
|
||||
.end_no:
|
||||
clc
|
||||
popad
|
||||
ret
|
||||
.end_yes:
|
||||
stc
|
||||
popad
|
||||
ret
|
||||
|
||||
;<EFBFBD><EFBFBD>Ž–…„“<EFBFBD>€ <EFBFBD>Žˆ‘Š€ ‘<EFBFBD>ˆ’›• ‹ˆ<EFBFBD>ˆ‰ ([dest] - ID ª®¯ª¨ ¤«ï ¯®¨áª )
|
||||
find_line:
|
||||
mov dword [findRightLeft], 0 ;®¡ã«ï¥¬ ç «ìë¥ § 票ï
|
||||
|
||||
mov eax, [dest]
|
||||
add eax, lineBall - 2
|
||||
mov dh, [eax]
|
||||
mov [baseAddr], eax
|
||||
or byte [eax], 0xF0
|
||||
|
||||
mov ecx, 8 ;¢ ecx - áç¥â稪
|
||||
.cycle_find:
|
||||
lea eax, [ecx*4 + ecx]
|
||||
shl eax, 1 ;eax = ecx*10
|
||||
mov edi, [eax + findTable - 4] ;edi - ªã¤ë § ¯¨áë¢ âì १-âë
|
||||
mov ebp, [eax + findTable - 8] ;ebp - ¯à¨¡ ¢«¥¨¥ ¤à¥á
|
||||
mov bx, [eax + findTable - 10] ;bx - ¯à¨¡ ¢«¥¨¥ ª®®à¤¨ â
|
||||
mov dl, cl
|
||||
shl dl, 4
|
||||
mov esi, [baseAddr]
|
||||
mov eax, [dest]
|
||||
mov ax, [eax*2 + lineCoord - 4]
|
||||
.small_cycle_find:
|
||||
add al, bh
|
||||
cmp al, 8 ;¢ [0..8] ?
|
||||
ja @F
|
||||
add ah, bl
|
||||
cmp ah, 8
|
||||
ja @F
|
||||
|
||||
add esi, ebp
|
||||
cmp byte [esi], dh
|
||||
jne @F
|
||||
|
||||
or byte [esi], dl
|
||||
inc byte [edi]
|
||||
jmp .small_cycle_find
|
||||
@@:
|
||||
loop .cycle_find
|
||||
ret
|
||||
|
||||
findRightLeft db ?
|
||||
findUpRight_DownLeft db ?
|
||||
findUpDown db ?
|
||||
findUpLeft_DownRight db ?
|
||||
|
||||
findTable:
|
||||
Up:
|
||||
db -1, 0
|
||||
dd -1, findUpDown
|
||||
Down:
|
||||
db +1, 0
|
||||
dd +1, findUpDown
|
||||
Left:
|
||||
db 0, -1
|
||||
dd -9, findRightLeft
|
||||
Right:
|
||||
db 0, +1
|
||||
dd +9, findRightLeft
|
||||
UpLeft:
|
||||
db -1, -1
|
||||
dd -10, findUpLeft_DownRight
|
||||
DownRight:
|
||||
db +1, +1
|
||||
dd +10, findUpLeft_DownRight
|
||||
UpRight:
|
||||
db -1, +1
|
||||
dd +8, findUpRight_DownLeft
|
||||
DownLeft:
|
||||
db +1, -1
|
||||
dd -8, findUpRight_DownLeft
|
5
programs/games/lines/build_en.bat
Normal file
@ -0,0 +1,5 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix en >lang.inc
|
||||
@fasm lines.asm lines.kex
|
||||
@erase lang.inc
|
||||
@pause
|
5
programs/games/lines/build_ru.bat
Normal file
@ -0,0 +1,5 @@
|
||||
@erase /s lang.inc > nul
|
||||
@echo lang fix ru >lang.inc
|
||||
@fasm lines.asm lines.kex
|
||||
@erase lang.inc
|
||||
@pause
|
71
programs/games/lines/draw_window.inc
Normal file
@ -0,0 +1,71 @@
|
||||
;======================================================================
|
||||
;=============== WINDOW DEFINITIONS AND DRAW ========================
|
||||
;======================================================================
|
||||
macro draw_window {
|
||||
mcall 12, 1 ; ç¨ ¥¬ ¯¥à¥à¨á®ªã ®ª
|
||||
|
||||
mov ebx, 100*65536 + 347 ; [x start] *65536 + [x size]
|
||||
mov ecx, 100*65536 + 465 ; [y start] *65536 + [y size]
|
||||
mov edx, 0x33D0D6C9 ; color of work area RRGGBB,8->color gl
|
||||
mov edi, szTitle ; § £®«®¢®ª
|
||||
mcall 0 ; à¨á®¢ âì ®ª®
|
||||
|
||||
|
||||
mov ebx, 12*65536 + 7 ;<EFBFBD>ˆ‘“…Œ Ž—Šˆ
|
||||
mov ecx, 0x90000000
|
||||
mov edx, szScore
|
||||
mcall 4
|
||||
call redraw_score
|
||||
|
||||
mov ebx, 234*65536 + 7 ;<EFBFBD>ˆ‘“…Œ <EFBFBD>…ŠŽ<EFBFBD>„
|
||||
mov ecx, 0x90000000
|
||||
mov edx, szRecord
|
||||
mcall 4
|
||||
|
||||
mov ebx, 230*65536 + 100
|
||||
mov ecx, 20*65536 + 20
|
||||
mov edx, 0x0
|
||||
mcall 13
|
||||
|
||||
mov ebx, 0xB0000
|
||||
mov ecx, [record]
|
||||
mov edx, 237*65536 + 27
|
||||
mov esi, 0x10ffffff
|
||||
mcall 47
|
||||
|
||||
mov ebx, 115*65536 + 34 ;<EFBFBD>ˆ‘“…Œ Œ…‘’Ž <EFBFBD>Ž„ <EFBFBD>Ž‚›… –‚…’€
|
||||
mov ecx, 7*65536 + 34
|
||||
mov edx, 0x00B8C2D3
|
||||
@@:
|
||||
mcall 13
|
||||
add ebx, 37*65536
|
||||
cmp ebx, 189*65536 + 34
|
||||
jbe @B
|
||||
|
||||
call paint_new_color
|
||||
|
||||
mov ebx, 20*65536 + 400 ;<EFBFBD>ˆ‘“…Œ “<EFBFBD><EFBFBD>€‚‹Ÿž™ˆ… Š<EFBFBD>Ž<EFBFBD>Šˆ ‘<EFBFBD>ˆ‡“
|
||||
mov ecx, 0x90000000
|
||||
mov edx, szNewGame
|
||||
mcall 4
|
||||
|
||||
mov ecx,9 ;<EFBFBD>ˆ‘“…Œ Ž‘<EFBFBD>Ž‚<EFBFBD>›… Š<EFBFBD>Ž<EFBFBD>Šˆ
|
||||
mov edx, 82
|
||||
|
||||
.drm1:
|
||||
mov ebx,ecx
|
||||
mov ecx,9
|
||||
.drm2:
|
||||
mov eax, edx
|
||||
call redraw_cell
|
||||
cmp eax, [current]
|
||||
jne @F
|
||||
call choice_ball
|
||||
@@:
|
||||
call paint_ball
|
||||
dec edx
|
||||
loop .drm2
|
||||
mov ecx,ebx
|
||||
loop .drm1
|
||||
mcall 12,2
|
||||
}
|
275
programs/games/lines/lines.asm
Normal file
@ -0,0 +1,275 @@
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
dd _preSTART
|
||||
dd I_END
|
||||
dd 0x4000
|
||||
dd 0x4000
|
||||
dd 0x0,0x0
|
||||
|
||||
include '..\..\macros.inc'
|
||||
include 'lang.inc'
|
||||
include 'draw_window.inc'
|
||||
include 'ball_operations.inc'
|
||||
include 'basic_alg.inc'
|
||||
|
||||
_preSTART:
|
||||
mcall 66, 1, 1 ;¯à¨¨¬ ¥¬ ᪠-ª®¤ë
|
||||
mcall 3 ;randomize
|
||||
ror eax, 16
|
||||
mov [TC_U_SYSTEM_RANDSEED], eax ;from PPro "system.inc"
|
||||
|
||||
new_game:
|
||||
;®¡ã«¥¨¥ ¬ âà¨æë
|
||||
mov eax, 0
|
||||
mov ecx, 81 / 4
|
||||
mov edi, lineBall
|
||||
rep stosd
|
||||
stosb
|
||||
|
||||
mov [score], 0
|
||||
mov [countAllBall], 0
|
||||
mov [current], 0
|
||||
mov ecx, 5
|
||||
@@:
|
||||
push ecx
|
||||
mov ebx, 7
|
||||
call random
|
||||
inc dl
|
||||
call add_new_ball
|
||||
pop ecx
|
||||
loop @B
|
||||
call generate_new___new_color
|
||||
|
||||
START:
|
||||
draw_window
|
||||
still:
|
||||
mcall 10
|
||||
|
||||
dec eax
|
||||
jz START ; ¯¥à¥à¨á®¢ âì ®ª®
|
||||
dec eax
|
||||
jnz button ;¥á«¨ ¥ ª« ¢¨è - § ç¨â ª®¯ª
|
||||
|
||||
key: ; ¦ ⨥ ª« ¢¨è¨
|
||||
mcall 2 ; ¯®«ãç ¥¬ ª®¤ ª« ¢¨è¨
|
||||
cmp ah, 60
|
||||
je new_game
|
||||
jmp still
|
||||
|
||||
button: ; ¦ ⨥ ª®¯ª¨
|
||||
mcall 17
|
||||
shr eax, 8
|
||||
cmp ax, 1 ; ¥á«¨ ª®¯ª ¢ë室 ?
|
||||
je .exit
|
||||
|
||||
;¯à®¢¥à¨¬, ¥ ¯ãáâ «¨ ª«¥âª
|
||||
mov edx, [current]
|
||||
test byte [eax + lineBall - 2], 0x7
|
||||
jz .blank
|
||||
|
||||
;¯à®¢¥à¨¬ ¥ ¡ë« «¨ íâ ª«¥âª 㦥 ¢ë¡à
|
||||
cmp eax, edx
|
||||
je .double_choice
|
||||
|
||||
mov [current], eax
|
||||
call choice_ball
|
||||
call paint_ball ;á ç « ¯à®à¨á㥬 ®¢ë© ¢ë¡à ë© è ਪ
|
||||
|
||||
test edx, edx ;cmp [current], 0
|
||||
jz still
|
||||
mov eax, edx
|
||||
|
||||
@@:
|
||||
call redraw_cell ; 㦥 ¯®â®¬ 㡥६ à ¬ªã ®â áâ ண®
|
||||
call paint_ball
|
||||
jmp still
|
||||
|
||||
.double_choice:
|
||||
mov [current], 0
|
||||
jmp @B
|
||||
|
||||
.blank: ; ¦ â ï ª®¯ª - ¯ãáâ
|
||||
test edx, edx ;cmp [current], 0
|
||||
jz still
|
||||
mov [dest], eax ;ª®¯ªã § 票ï -> ¢ [dest]
|
||||
mov eax, edx ;¯ à ¬¥âà ¢ eax
|
||||
call test_path ;¢ë§ë¢ ¥¬ ४ãàá¨î test_path
|
||||
call zero_cheked
|
||||
jnc still
|
||||
|
||||
;^^^^^^^^^^^^^^^^^ move_ball proc
|
||||
mov eax, [current]
|
||||
mov cl, byte [eax + lineBall - 2]
|
||||
mov byte [eax + lineBall - 2], 0
|
||||
mov eax, [dest]
|
||||
mov byte [eax + lineBall - 2], cl
|
||||
|
||||
mov eax, [current]
|
||||
call redraw_cell
|
||||
mov eax, [dest]
|
||||
call paint_ball
|
||||
mov [current], 0
|
||||
;^^^^^^^^^^^^^^^^^ move_ball endp
|
||||
|
||||
call find_line
|
||||
call vanish_balls
|
||||
call zero_cheked
|
||||
|
||||
cmp [countVanishBall], 0
|
||||
je new_3_balls
|
||||
movzx eax, [countVanishBall]
|
||||
inc eax
|
||||
add [score], eax
|
||||
sub [countAllBall], al
|
||||
call redraw_score
|
||||
jmp still
|
||||
|
||||
.exit:
|
||||
mcall -1 ;¢ë室¨¬
|
||||
|
||||
new_3_balls:
|
||||
|
||||
rept 3 num
|
||||
{
|
||||
mov dl, [newColor#num]
|
||||
call add_new_ball
|
||||
call test_new_ball
|
||||
cmp [countAllBall],81
|
||||
je .record_li
|
||||
}
|
||||
|
||||
call generate_new___new_color
|
||||
call paint_new_color
|
||||
jmp still
|
||||
|
||||
.record_li:
|
||||
mov eax, [score]
|
||||
cmp eax, [record]
|
||||
jbe still
|
||||
mov [record], eax
|
||||
jmp START
|
||||
|
||||
zero_cheked: ;®¡ã«¥¨¥ ¬ âà¨æë cheked
|
||||
pushfd
|
||||
mov eax, lineBall
|
||||
mov ecx, 81
|
||||
@@:
|
||||
and byte [eax], 0x7
|
||||
inc eax
|
||||
loop @B
|
||||
popfd
|
||||
ret
|
||||
|
||||
random: ; edx := random [0..(ebx-1)]
|
||||
mov eax, 134775813
|
||||
mul [TC_U_SYSTEM_RANDSEED]
|
||||
inc eax
|
||||
mov [ TC_U_SYSTEM_RANDSEED], eax
|
||||
xor edx, edx
|
||||
div ebx
|
||||
ret
|
||||
|
||||
generate_new___new_color:
|
||||
rept 3 num
|
||||
{
|
||||
mov ebx, 7
|
||||
call random
|
||||
inc dl
|
||||
mov [newColor#num], dl
|
||||
}
|
||||
ret
|
||||
|
||||
add_new_ball: ;¢ dl - 梥â è ਪ
|
||||
mov ebp, edx
|
||||
mov ebx, 81
|
||||
sub bl, [countAllBall]
|
||||
call random
|
||||
mov ecx, edx
|
||||
mov eax, lineBall-1
|
||||
inc ecx
|
||||
@@:
|
||||
inc eax
|
||||
test byte [eax], 0x7
|
||||
jnz @B
|
||||
loop @B
|
||||
|
||||
;⥯¥àì ã á ¢ eax - ¤à¥á 襣® è ਪ
|
||||
mov edx, ebp
|
||||
or byte [eax], dl
|
||||
inc [countAllBall]
|
||||
ret
|
||||
|
||||
test_new_ball:
|
||||
;¯®«ã稬 ID ª®¯ª¨
|
||||
sub eax, lineBall-2
|
||||
call paint_ball
|
||||
|
||||
call find_line
|
||||
call vanish_balls
|
||||
call zero_cheked
|
||||
|
||||
cmp [countVanishBall], 0
|
||||
je @F
|
||||
movzx eax, [countVanishBall]
|
||||
inc eax
|
||||
add [score], eax
|
||||
sub [countAllBall], al
|
||||
call redraw_score
|
||||
@@:
|
||||
ret
|
||||
|
||||
if lang eq ru
|
||||
szTitle db '–¢¥âë¥ «¨¨¨ v 0.2',0
|
||||
szNewGame db 'F2 - ®¢ ï ¨£à ',0
|
||||
szRecord db '<27>¥ª®à¤',0
|
||||
szScore db 'Žçª¨',0
|
||||
else
|
||||
szTitle db 'Color lines v 0.2',0
|
||||
szNewGame db 'F2 - new game',0
|
||||
szRecord db 'Record',0
|
||||
szScore db 'Score',0
|
||||
end if
|
||||
|
||||
|
||||
blank = 0xB8C2D3
|
||||
brown = 0x804000
|
||||
red = 0xff0000
|
||||
yellow = 0xffff00
|
||||
green = 0x008000
|
||||
cyan = 0x00ffff
|
||||
blue = 0x0000ff
|
||||
purple = 0x800080
|
||||
|
||||
tableColor dd blank,brown,red,yellow,green,cyan,blue,purple
|
||||
|
||||
lineCoord:
|
||||
rept 9 coory:0
|
||||
{
|
||||
rept 9 coorx:0
|
||||
\{
|
||||
dw coorx*256+coory
|
||||
|
||||
\}
|
||||
}
|
||||
|
||||
record dd 25
|
||||
|
||||
lineBall db 81 dup ?
|
||||
score dd ?
|
||||
baseAddr dd ?
|
||||
current dd ?
|
||||
dest dd ?
|
||||
|
||||
newColor1 db ?
|
||||
newColor2 db ?
|
||||
newColor3 db ?
|
||||
|
||||
countVanishBall db ?
|
||||
countAllBall db ?
|
||||
|
||||
TC_U_SYSTEM_RANDSEED dd ?
|
||||
bitID dd ?
|
||||
|
||||
I_END:
|
28
programs/games/piton/asm_code.asm
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
format MS COFF
|
||||
|
||||
public Start
|
||||
|
||||
extrn Memory
|
||||
extrn hEnd
|
||||
|
||||
extrn _kol_main
|
||||
|
||||
section ".text" code
|
||||
db "MENUET01"
|
||||
dd 1, Start, hEnd, Memory, hStack, 0, 0
|
||||
|
||||
Start:
|
||||
|
||||
; âûçîâ ãëàâíîé ïðîöåäóðû
|
||||
mov eax, _kol_main
|
||||
call eax
|
||||
|
||||
; çàâåðøåíèå ðàáîòû ïðîãðàììû
|
||||
mov eax, -1
|
||||
int 0x40
|
||||
|
||||
section ".bss"
|
||||
|
||||
rb 4096
|
||||
hStack:
|
2095
programs/games/piton/az3.h
Normal file
1443
programs/games/piton/az4.h
Normal file
381
programs/games/piton/c_code.c
Normal file
@ -0,0 +1,381 @@
|
||||
|
||||
#include "kolibri.h"
|
||||
#include "stdio.h"
|
||||
#include "stdlib.h"
|
||||
#include "string.h"
|
||||
|
||||
#include "gblib.h"
|
||||
#include "az3.h"
|
||||
#include "az4.h"
|
||||
|
||||
//=====================================
|
||||
|
||||
#define scrw (8*32)
|
||||
#define scrh (16+8*32)
|
||||
|
||||
//=====================================
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char x;
|
||||
char y;
|
||||
} p_point;
|
||||
|
||||
//=====================================
|
||||
|
||||
char STR_TITLE[] = {"Piton 0.3"};
|
||||
|
||||
int mode;
|
||||
char score[10];
|
||||
|
||||
char scr[scrw*scrh*3];
|
||||
GB_BMP screen, az, azr;
|
||||
|
||||
char M[32][32];
|
||||
p_point z[32*32];
|
||||
p_point v;
|
||||
p_point r;
|
||||
int len;
|
||||
|
||||
unsigned color[] = {0xcccccc, 0xaa2222, 0x44bb, 0x7788aa};
|
||||
|
||||
|
||||
//=====================================
|
||||
|
||||
void az_putc(unsigned char c, int x, int y)
|
||||
{
|
||||
if (c > 191)
|
||||
gb_image_set_t(&screen, x, y, &azr, (c-192)*8, 1, 8, 14, 0);
|
||||
else
|
||||
gb_image_set_t(&screen, x, y, &az, (c-' ')*8, 1, 8, 14, 0);
|
||||
}
|
||||
|
||||
//=====================================
|
||||
|
||||
void az_puts(unsigned char *s, int x, int y)
|
||||
{
|
||||
unsigned i;
|
||||
i = 0;
|
||||
while (*(s+i))
|
||||
{
|
||||
az_putc(*(s+i), x+i*9, y);
|
||||
i++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//=====================================
|
||||
|
||||
az_puti(int n, int x, int y)
|
||||
{
|
||||
char c;
|
||||
int i = 0;
|
||||
do
|
||||
{
|
||||
c = n % 10 + '0';
|
||||
az_putc(c, x-9*i, y);
|
||||
i++;
|
||||
}
|
||||
while ((n /= 10) > 0);
|
||||
}
|
||||
|
||||
//=====================================
|
||||
|
||||
void clear()
|
||||
{
|
||||
|
||||
int x, y;
|
||||
|
||||
for (y = 0; y < 32; y++)
|
||||
for (x = 0; x < 32; x++)
|
||||
M[x][y] = 0;
|
||||
|
||||
for (y = 0; y < 32; y++)
|
||||
{
|
||||
M[0][y] = 1;
|
||||
M[31][y] = 1;
|
||||
M[y][0] = 1;
|
||||
M[y][31] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
//=====================================
|
||||
|
||||
void put_z()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
M[z[i].x][z[i].y] = 2;
|
||||
|
||||
}
|
||||
|
||||
//=====================================
|
||||
|
||||
void put_r()
|
||||
{
|
||||
M[r.x][r.y] = 3;
|
||||
}
|
||||
|
||||
//=====================================
|
||||
|
||||
void rabbit_new()
|
||||
{
|
||||
|
||||
for (;;)
|
||||
{
|
||||
r.x = rand()%29+1;
|
||||
r.y = rand()%29+1;
|
||||
|
||||
if (0 == M[r.x][r.y])
|
||||
return;
|
||||
}
|
||||
}
|
||||
//=====================================
|
||||
|
||||
void game_start()
|
||||
{
|
||||
|
||||
clear();
|
||||
|
||||
v.x = 1;
|
||||
v.y = 0;
|
||||
|
||||
len = 2;
|
||||
|
||||
z[0].x = 16;
|
||||
z[0].y = 16;
|
||||
|
||||
z[1].x = 15;
|
||||
z[1].y = 16;
|
||||
|
||||
rabbit_new();
|
||||
put_r();
|
||||
put_z();
|
||||
|
||||
kol_sleep(30);
|
||||
}
|
||||
|
||||
//=====================================
|
||||
|
||||
void press_space()
|
||||
{
|
||||
az_puts("íàæìèòå Ïðîáåë", 10, 180);
|
||||
az_puts("÷òîáû ïðîäîëæèòü", 10, 195);
|
||||
}
|
||||
|
||||
//=====================================
|
||||
|
||||
void screen_draw()
|
||||
{
|
||||
|
||||
int x, y;
|
||||
|
||||
switch ( mode)
|
||||
{
|
||||
case 0:
|
||||
gb_bar(&screen, 0, 0, scrw, scrh, 0xbb);
|
||||
az_puts("Ï È Ò Î Í 0.3", 10, 60);
|
||||
az_puts("ðåìåéê äëÿ ÎÑ Êîëèáðè", 10, 120);
|
||||
az_puts("àâòîð: À. Áîãîìàç", 10, 135);
|
||||
press_space();
|
||||
break;
|
||||
|
||||
|
||||
case 1:
|
||||
gb_bar(&screen, 0, 0, scrw, 16, 0xbb);
|
||||
az_puts("Î×ÊÈ:", 10, 0);
|
||||
az_puti(len-2, 120, 0);
|
||||
for (y = 0; y < 32; y++)
|
||||
for (x = 0; x < 32; x++)
|
||||
gb_bar(&screen, x*8, y*8+16, 8, 8, color[ M[x][y] ]);
|
||||
|
||||
break;
|
||||
|
||||
case 2:
|
||||
gb_bar(&screen, 0, 0, scrw, scrh, 0xbb0000);
|
||||
az_puts("Ï À Ó Ç À", 10, 60);
|
||||
press_space();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
gb_bar(&screen, 0, 0, scrw, scrh, 0xee0000);
|
||||
az_puts("Ê Î Í Å Ö È Ã Ð Û", 10, 60);
|
||||
kol_screen_wait_rr();
|
||||
kol_paint_image(0, 0, scrw, scrh, screen.bmp);
|
||||
kol_sleep(120);
|
||||
mode = 0;
|
||||
return;
|
||||
};
|
||||
|
||||
kol_screen_wait_rr();
|
||||
kol_paint_image(0, 0, scrw, scrh, screen.bmp);
|
||||
|
||||
}
|
||||
|
||||
//=====================================
|
||||
|
||||
void wnd_draw()
|
||||
{
|
||||
kol_paint_start();
|
||||
kol_wnd_define(280, 30, scrw+8, scrh+kol_skin_height()+4, 0x34888888);
|
||||
kol_wnd_caption(STR_TITLE);
|
||||
screen_draw();
|
||||
kol_paint_end();
|
||||
}
|
||||
|
||||
//=====================================
|
||||
|
||||
int piton_move()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = len-1; i > 0; i--)
|
||||
{
|
||||
z[i].x = z[i-1].x;
|
||||
z[i].y = z[i-1].y;
|
||||
}
|
||||
|
||||
z[0].x += v.x;
|
||||
z[0].y += v.y;
|
||||
|
||||
if ((1 == M[z[0].x][z[0].y])||(2 == M[z[0].x][z[0].y]))
|
||||
return -1;
|
||||
|
||||
if (3 == M[z[0].x][z[0].y])
|
||||
{
|
||||
rabbit_new();
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
clear();
|
||||
put_r();
|
||||
put_z();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=====================================
|
||||
|
||||
void kol_main()
|
||||
{
|
||||
|
||||
unsigned event, key;
|
||||
int res;
|
||||
|
||||
srand(kol_system_time_get()<<8);
|
||||
|
||||
screen.bmp = scr;
|
||||
screen.w = scrw;
|
||||
screen.h = scrh;
|
||||
|
||||
az.bmp = AZ3;
|
||||
az.w = 744;
|
||||
az.h = 15;
|
||||
|
||||
azr.bmp = AZ4;
|
||||
azr.w = 512;
|
||||
azr.h = 15;
|
||||
|
||||
mode = 0;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
kol_sleep(9);
|
||||
|
||||
if ( 1 == mode)
|
||||
{
|
||||
res = piton_move();
|
||||
|
||||
if (1 == res)
|
||||
len++;
|
||||
|
||||
if (-1 == res)
|
||||
mode = 3;
|
||||
|
||||
}
|
||||
|
||||
screen_draw();
|
||||
event = kol_event_check();
|
||||
|
||||
switch (event)
|
||||
{
|
||||
case 1:
|
||||
wnd_draw();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
key = (kol_key_get() & 0xff00)>>8;
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
|
||||
case 0:
|
||||
if (32 == key)
|
||||
{
|
||||
mode = 1;
|
||||
game_start();
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
switch (key)
|
||||
{
|
||||
case 27:
|
||||
mode = 0;
|
||||
break;
|
||||
case 32:
|
||||
mode = 2;
|
||||
break;
|
||||
case 178:
|
||||
if (0 == v.y)
|
||||
{
|
||||
v.x = 0;
|
||||
v.y = -1;
|
||||
}
|
||||
break;
|
||||
case 177:
|
||||
if (0 == v.y)
|
||||
{
|
||||
v.x = 0;
|
||||
v.y = 1;
|
||||
}
|
||||
break;
|
||||
case 176:
|
||||
if (0 == v.x)
|
||||
{
|
||||
v.x = -1;
|
||||
v.y = 0;
|
||||
}
|
||||
break;
|
||||
case 179:
|
||||
if (0 == v.x)
|
||||
{
|
||||
v.x = 1;
|
||||
v.y = 0;
|
||||
}
|
||||
break;
|
||||
};
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (32 == key)
|
||||
mode = 1;
|
||||
break;
|
||||
|
||||
};
|
||||
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if ( 1 == (kol_btn_get() & 0xff00)>>8 )
|
||||
kol_exit();
|
||||
break;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//=====================================
|
5
programs/games/piton/compile.bat
Normal file
@ -0,0 +1,5 @@
|
||||
fasm asm_code.asm
|
||||
gcc -c c_code.c
|
||||
ld -nostdlib -T kolibri.ld -o piton.kex asm_code.obj kolibri.o stdlib.o string.o gblib.o c_code.o
|
||||
objcopy piton.kex -O binary
|
||||
pause
|
17
programs/games/piton/gblib.h
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int w __attribute__((packed));
|
||||
int h __attribute__((packed));
|
||||
char *bmp __attribute__((packed));
|
||||
char *alpha __attribute__((packed));
|
||||
} GB_BMP __attribute__((packed));
|
||||
|
||||
void gb_pixel_set(GB_BMP *b, int x, int y, unsigned c);
|
||||
int gb_pixel_get(GB_BMP *b, int x, int y, unsigned *c);
|
||||
void gb_line(GB_BMP *b, int x1, int y1, int x2, int y2, unsigned c);
|
||||
void gb_rect(GB_BMP *b, int x, int y, int w, int h, unsigned c);
|
||||
void gb_bar(GB_BMP *b, int x, int y, int w, int h, unsigned c);
|
||||
void gb_circle(GB_BMP *b, int x, int y, int r, unsigned c);
|
||||
void gb_image_set(GB_BMP *b_dest, int x_d, int y_d, GB_BMP *b_src, int x_s, int y_s, int w, int h);
|
||||
void gb_image_set_t(GB_BMP *b_dest, int x_d, int y_d, GB_BMP *b_src, int x_s, int y_s, int w, int h, unsigned c);
|
73
programs/games/piton/kolibri.h
Normal file
@ -0,0 +1,73 @@
|
||||
|
||||
#define NULL ((void*)0)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned p00 __attribute__((packed));
|
||||
unsigned p04 __attribute__((packed));
|
||||
unsigned p08 __attribute__((packed));
|
||||
unsigned p12 __attribute__((packed));
|
||||
unsigned p16 __attribute__((packed));
|
||||
char p20 __attribute__((packed));
|
||||
char *p21 __attribute__((packed));
|
||||
} kol_struct70 __attribute__((packed));
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned p00 __attribute__((packed));
|
||||
char p04 __attribute__((packed));
|
||||
char p05[3] __attribute__((packed));
|
||||
unsigned p08 __attribute__((packed));
|
||||
unsigned p12 __attribute__((packed));
|
||||
unsigned p16 __attribute__((packed));
|
||||
unsigned p20 __attribute__((packed));
|
||||
unsigned p24 __attribute__((packed));
|
||||
unsigned p28 __attribute__((packed));
|
||||
unsigned p32[2] __attribute__((packed));
|
||||
} kol_struct_BDVK __attribute__((packed));
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *name __attribute__((packed));
|
||||
void *data __attribute__((packed));
|
||||
} kol_struct_import __attribute__((packed));
|
||||
|
||||
|
||||
void kol_exit();
|
||||
void kol_sleep(unsigned d);
|
||||
void kol_wnd_define(unsigned x, unsigned y, unsigned w, unsigned h, unsigned c);
|
||||
void kol_wnd_caption(char *s);
|
||||
void kol_event_mask(unsigned e);
|
||||
unsigned kol_event_wait();
|
||||
unsigned kol_event_wait_time(unsigned time);
|
||||
unsigned kol_event_check();
|
||||
void kol_paint_start();
|
||||
void kol_paint_end();
|
||||
void kol_paint_pixel(unsigned x, unsigned y, unsigned c);
|
||||
void kol_paint_bar(unsigned x, unsigned y, unsigned w, unsigned h, unsigned c);
|
||||
void kol_paint_line(unsigned x1, unsigned y1, unsigned x2, unsigned y2, unsigned c);
|
||||
void kol_paint_string(unsigned x, unsigned y, char *s, unsigned c);
|
||||
void kol_paint_image(unsigned x, unsigned y, unsigned w, unsigned h, char *d);
|
||||
unsigned kol_key_get();
|
||||
void kol_btn_define(unsigned x, unsigned y, unsigned w, unsigned h, unsigned d, unsigned c);
|
||||
unsigned kol_btn_get();
|
||||
void kol_btn_type(unsigned t);
|
||||
unsigned kol_mouse_pos();
|
||||
unsigned kol_mouse_posw();
|
||||
unsigned kol_mouse_btn();
|
||||
void kol_board_putc(char c);
|
||||
void kol_board_puts(char *s);
|
||||
unsigned kol_file_70(kol_struct70 *k);
|
||||
kol_struct_import* kol_cofflib_load(char *name);
|
||||
void* kol_cofflib_procload (kol_struct_import *imp, char *name);
|
||||
unsigned kol_cofflib_procnum (kol_struct_import *imp);
|
||||
void kol_cofflib_procname (kol_struct_import *imp, char *name, unsigned n);
|
||||
unsigned kol_system_cpufreq();
|
||||
unsigned kol_system_mem();
|
||||
unsigned kol_system_memfree();
|
||||
unsigned kol_system_time_get();
|
||||
void kol_path_file2dir(char *dir, char *fname);
|
||||
void kol_path_full(char *full, char *fname);
|
||||
void kol_screen_wait_rr();
|
||||
unsigned kol_skin_height();
|
17
programs/games/piton/readme.txt
Normal file
@ -0,0 +1,17 @@
|
||||
Игра Piton
|
||||
версия 0.1
|
||||
|
||||
==============
|
||||
|
||||
Ремейк для KolibriOS.
|
||||
Написана с использованием библиотеки gblib.
|
||||
|
||||
Управление:
|
||||
- стрелочки
|
||||
- пробел
|
||||
- esc
|
||||
|
||||
==============
|
||||
|
||||
автор: Александр Богомаз aka Albom (albom85@yandex.ru)
|
||||
28 марта 2008
|
14
programs/games/piton/stdlib.h
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
#define RAND_MAX 0x7FFFU
|
||||
|
||||
#define isspace(c) ((c)==' ')
|
||||
#define abs(i) (((i)<0)?(-(i)):(i))
|
||||
|
||||
#define random(num) ((rand()*(num))/((RAND_MAX+1)))
|
||||
|
||||
void* malloc(unsigned size);
|
||||
void free(void *pointer);
|
||||
void* realloc(void* pointer, unsigned size);
|
||||
|
||||
void srand (unsigned seed);
|
||||
int rand (void);
|
9
programs/games/piton/string.h
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
void* memset(void *mem, int c, unsigned size);
|
||||
void* memcpy(void *dst, const void *src, unsigned size);
|
||||
|
||||
char* strcat(char* strDest, const char* strSource);
|
||||
int strcmp(const char* string1, const char* string2);
|
||||
char* strcpy(char *strDest, const char *strSource);
|
||||
char* strncpy(char *strDest, const char *strSource, unsigned n);
|
||||
int strlen(const char* string);
|