Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 1372 → Rev 1373

/demos/trunk/astro/asteroid.c
16,6 → 16,8
sem_t mx_mat, mx_grf, mx_pos, mx_vel, mx_xy, mx_rk, mx_rn; /* mutex semaphores */
sem_t mx_st_nrg, mx_st_scr, mx_st_kil, mx_st_liv; /* mutex semaphores */
 
volatile int shark_running = 1;
 
double dist_xy(int x1, int y1, int x2, int y2)
{
double dst;
63,16 → 65,54
 
void end_func(KEY_EVT *k) {
 
shark_running = 0;
 
}
 
int device_drivers_close() {
 
FB26_close(FRAME_BUFFER_DEVICE);
sys_end();
 
KEYB26_close();
INPUT26_close();
 
return 0;
 
}
 
int device_drivers_init() {
 
KEYB_PARMS kparms = BASE_KEYB;
LINUXC26_register_module();
 
PCI26_init();
 
INPUT26_init();
 
keyb_def_ctrlC(kparms, NULL);
 
KEYB26_init(&kparms);
 
FB26_init();
FB26_open(FRAME_BUFFER_DEVICE);
FB26_use_grx(FRAME_BUFFER_DEVICE);
FB26_setmode(FRAME_BUFFER_DEVICE,"640x480-16");
return 0;
 
}
 
int main(int argc, char **argv)
{
KEY_EVT k;
TIME seme;
 
device_drivers_init();
 
k.flag = CNTR_BIT;
k.scan = KEY_C;
k.ascii = 'c';
100,14 → 140,6
seme = sys_gettime(NULL);
srand(seme);
 
FB26_init();
 
FB26_open(FRAME_BUFFER_DEVICE);
 
FB26_use_grx(FRAME_BUFFER_DEVICE);
 
FB26_setmode(FRAME_BUFFER_DEVICE,"640x480-16");
 
frame_main();
 
init_stat();
114,5 → 146,12
init_astro();
init_rock();
 
while(shark_running);
 
device_drivers_close();
 
sys_end();
 
return 0;
 
}