annotate game.c @ 47:d7e0a5c33540

*** empty log message ***
author gongo
date Wed, 08 Nov 2006 06:17:21 +0000
parents abadcc080667
children 8cef655f3bf9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
1 /*
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
2 * $Id$
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
3 */
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
4
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
5 #include <stdio.h>
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
6 #include <stdlib.h>
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
7 #include "libps2.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
8 #include "ps2util.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
9 #include "controler.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
10 #include "lindaapi.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
11 #include "car.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
12 #include "game.h"
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
13
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
14 /* schedule.c */
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
15 extern void schedule();
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
16 /* controler.c */
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
17 extern Bool padCheck();
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
18 /* linda.c */
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
19 #ifdef LINDA
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
20 extern int linda_init();
47
d7e0a5c33540 *** empty log message ***
gongo
parents: 46
diff changeset
21 #else
d7e0a5c33540 *** empty log message ***
gongo
parents: 46
diff changeset
22 define linda_init linda_init0
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
23 #endif
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
24
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
25 Game game;
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
26
9
2fdac80d03ae *** empty log message ***
gongo
parents: 2
diff changeset
27 extern void sche_game_init();
21
447281fe6845 *** empty log message ***
gongo
parents: 19
diff changeset
28 extern void set_schedule(void*);
9
2fdac80d03ae *** empty log message ***
gongo
parents: 2
diff changeset
29
46
abadcc080667 *** empty log message ***
gongo
parents: 44
diff changeset
30 static Bool
abadcc080667 *** empty log message ***
gongo
parents: 44
diff changeset
31 ret()
abadcc080667 *** empty log message ***
gongo
parents: 44
diff changeset
32 {
abadcc080667 *** empty log message ***
gongo
parents: 44
diff changeset
33 return TRUE;
abadcc080667 *** empty log message ***
gongo
parents: 44
diff changeset
34 }
abadcc080667 *** empty log message ***
gongo
parents: 44
diff changeset
35
abadcc080667 *** empty log message ***
gongo
parents: 44
diff changeset
36 static int
47
d7e0a5c33540 *** empty log message ***
gongo
parents: 46
diff changeset
37 linda_init0()
46
abadcc080667 *** empty log message ***
gongo
parents: 44
diff changeset
38 {
abadcc080667 *** empty log message ***
gongo
parents: 44
diff changeset
39 game.linda_exec = &ret;
abadcc080667 *** empty log message ***
gongo
parents: 44
diff changeset
40 return 1;
abadcc080667 *** empty log message ***
gongo
parents: 44
diff changeset
41 }
abadcc080667 *** empty log message ***
gongo
parents: 44
diff changeset
42
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
43 void
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
44 game_main()
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
45 {
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
46 Bool flg = TRUE;
21
447281fe6845 *** empty log message ***
gongo
parents: 19
diff changeset
47 set_schedule(sche_game_init);
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
48
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
49 game.play_id = linda_init();
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
50
9
2fdac80d03ae *** empty log message ***
gongo
parents: 2
diff changeset
51 while (1) {
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
52 flg = padCheck();
9
2fdac80d03ae *** empty log message ***
gongo
parents: 2
diff changeset
53 if (flg == FALSE) {
2fdac80d03ae *** empty log message ***
gongo
parents: 2
diff changeset
54 break;
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
55 }
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
56 schedule();
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
57
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
58 #ifdef LINDA
9
2fdac80d03ae *** empty log message ***
gongo
parents: 2
diff changeset
59 psx_sync_n();
0
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
60 #endif
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
61 }
0fae5658fb0b Initial revision
gongo
parents:
diff changeset
62 }