18,16 → 18,16 |
|
/** |
------------ |
CVS : $Id: demo.c,v 1.3 2003-01-07 17:10:17 pj Exp $ |
CVS : $Id: demo.c,v 1.4 2003-05-01 19:43:16 pj Exp $ |
|
File: $File$ |
Revision: $Revision: 1.3 $ |
Last update: $Date: 2003-01-07 17:10:17 $ |
Revision: $Revision: 1.4 $ |
Last update: $Date: 2003-05-01 19:43:16 $ |
------------ |
**/ |
|
/* |
* Copyright (C) 2000 Paolo Gai |
* Copyright (C) 2000-2003 Paolo Gai |
* |
* 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 |
65,11 → 65,11 |
|
static void version( void ) |
{ |
cprintf( "S.Ha.R.K. Pavia Demo 1.0\n" ); |
cprintf( "------------------------\n" ); |
cprintf( "S.Ha.R.K. Jumpball Demo 1.0\n" ); |
cprintf( "---------------------------\n" ); |
cprintf( "by Paolo Gai 1999-2001\n" ); |
cprintf( " <pj@sssup.it>\n" ); |
cprintf( "------------------------\n" ); |
cprintf( "---------------------------\n" ); |
} |
|
int myrand(int x) |
116,12 → 116,12 |
|
void scenario() |
{ |
grx_text("S.Ha.R.K. Pavia Demo 1.0", 0, 0, rgb16(0,255,0), black ); |
grx_text("by Paolo Gai 1999-2001" , 0, 8, rgb16(0,255,0), black ); |
grx_text(" pj@sssup.it" , 0,16, rgb16(0,255,0), black ); |
grx_text("S.Ha.R.K. Jumpball Demo 1.0", 0, 0, rgb16(0,255,0), black ); |
grx_text(" by Paolo Gai 1999-2001" , 0, 8, rgb16(0,255,0), black ); |
grx_text(" pj@sssup.it" , 0,16, rgb16(0,255,0), black ); |
|
grx_text("Ctrl-C, Ctrr-C, Enter: exit" ,320, 0, gray, black ); |
grx_text("Alt-C : void stat." ,320, 8, gray, black ); |
grx_text("Alt-C : void statistics" ,320, 8, gray, black ); |
grx_text("Space : create noise ball",320,16, gray, black ); |
grx_text("Backspace : kill noise balls" ,320,24, gray, black ); |
|
135,28 → 135,9 |
#endif |
} |
|
|
void demo_exc_handler(int signo, siginfo_t *info, void *extra) |
void my_close(void *arg) |
{ |
struct timespec t; |
|
grx_close(); |
|
/* Default action for an kern exception is */ |
kern_cli(); |
kern_gettime(&t), |
kern_printf("\nS.Ha.R.K. Exception raised!!!" |
"\nTime (s:ns) :%ld:%ld" |
"\nException number:%d" |
"\nPID :%d\n", |
t.tv_sec, t.tv_nsec, info->si_value.sival_int, |
info->si_task); |
sys_end(); |
} |
|
void my_close(void *arg) |
{ |
grx_close(); |
kern_printf("my_close\n"); |
} |
|
163,8 → 144,8 |
|
void endfun(KEY_EVT *k) |
{ |
cprintf("Ctrl-Brk pressed! Ending...\n"); |
sys_end(); |
cprintf("Ending...\n"); |
sys_end(); |
} |
|
void zerofun(KEY_EVT *k) |
173,21 → 154,6 |
for (i=0; i<MAX_PROC; i++) jet_delstat(i); |
} |
|
void printeventqueue(void *arg) |
{ |
struct event *p; |
extern struct event *firstevent; |
|
kern_cli(); |
grx_close(); |
kern_cli(); |
for (p = firstevent; p != NULL; p = p->next) { |
kern_printf("par:%d time:%ld.%ld p:%d handler:%d\n", |
(int)p->par, p->time.tv_sec, p->time.tv_nsec/1000, (int)p, (int)p->handler); |
} |
kern_sti(); |
} |
|
int main(int argc, char **argv) |
{ |
int modenum; |