annotate linda.h @ 95:b0249b856488

change_ps2util
author Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
date Thu, 26 May 2011 18:13:40 +0900
parents 8edae89a3877
children 0b65ca27f113
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
1 #ifndef LINDA_H
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
2 #define LINDA_H
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
3
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
4
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
5 //#include "linda/lindaapi.h"
44
3b71b39411b1 *** empty log message ***
gongo
parents:
diff changeset
6 /*
3b71b39411b1 *** empty log message ***
gongo
parents:
diff changeset
7 +-------+-------+-------+-----------+
3b71b39411b1 *** empty log message ***
gongo
parents:
diff changeset
8 | game | car | course| data |
3b71b39411b1 *** empty log message ***
gongo
parents:
diff changeset
9 | mode | id | id | (fmatrix) |
3b71b39411b1 *** empty log message ***
gongo
parents:
diff changeset
10 +-------+-------+-------+-----------+
3b71b39411b1 *** empty log message ***
gongo
parents:
diff changeset
11
88
ce9ef7dcf2f0 convert UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
12 mode : ゲームの状態(オープニング、車選択等)
ce9ef7dcf2f0 convert UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
13 car id : ユーザの選んだ車
ce9ef7dcf2f0 convert UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
14 course id : 走るコース(1Pのみ選択可能)
ce9ef7dcf2f0 convert UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
15 data : ユーザの車の状態(location、angle等)
44
3b71b39411b1 *** empty log message ***
gongo
parents:
diff changeset
16
88
ce9ef7dcf2f0 convert UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
17 ユーザのIDはLinda_IDで判断する
ce9ef7dcf2f0 convert UTF-8
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 75
diff changeset
18 linda_seq[i]: ユーザID=i
44
3b71b39411b1 *** empty log message ***
gongo
parents:
diff changeset
19 */
3b71b39411b1 *** empty log message ***
gongo
parents:
diff changeset
20
3b71b39411b1 *** empty log message ***
gongo
parents:
diff changeset
21 #define MODE_INIT 0
3b71b39411b1 *** empty log message ***
gongo
parents:
diff changeset
22 #define MODE_WAIT 1
3b71b39411b1 *** empty log message ***
gongo
parents:
diff changeset
23 #define MODE_WAIT_READY 2
3b71b39411b1 *** empty log message ***
gongo
parents:
diff changeset
24 #define MODE_OPENING 3
3b71b39411b1 *** empty log message ***
gongo
parents:
diff changeset
25 #define MODE_SELECT_CAR 4
46
abadcc080667 *** empty log message ***
gongo
parents: 44
diff changeset
26 #define MODE_SELECT_COURSE 5
abadcc080667 *** empty log message ***
gongo
parents: 44
diff changeset
27 #define MODE_READY 6
abadcc080667 *** empty log message ***
gongo
parents: 44
diff changeset
28 #define MODE_MAIN_INIT 7
69
672b16f9d28f *** empty log message ***
gongo
parents: 67
diff changeset
29 #define MODE_MAIN_READY 8
672b16f9d28f *** empty log message ***
gongo
parents: 67
diff changeset
30 #define MODE_MAIN 9
672b16f9d28f *** empty log message ***
gongo
parents: 67
diff changeset
31 #define MODE_MAIN_PAUSE 10
672b16f9d28f *** empty log message ***
gongo
parents: 67
diff changeset
32 #define MODE_MAIN_GOAL 11
672b16f9d28f *** empty log message ***
gongo
parents: 67
diff changeset
33 #define MODE_MAIN_FINISH 12
672b16f9d28f *** empty log message ***
gongo
parents: 67
diff changeset
34 #define MODE_FINISH 13
46
abadcc080667 *** empty log message ***
gongo
parents: 44
diff changeset
35
abadcc080667 *** empty log message ***
gongo
parents: 44
diff changeset
36 #define PLAYER_1P 1
abadcc080667 *** empty log message ***
gongo
parents: 44
diff changeset
37
90
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
38 #define CLIENT_MAX 2
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
39 #define LINDA_ASK_ID 65535
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
40 #define LINDA_HOST "firefly.cr.ie.u-ryukyu.ac.jp"
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
41
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
42
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
43 #define PKT_MODE_OFFSET 0
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
44 #define PKT_CARID_OFFSET 4
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
45 #define PKT_COURSEID_OFFSET 8
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
46 #define PKT_DATA_OFFSET 12
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
47
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
48 #define PKT_HEADER_SIZE 12
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
49 #include "game.h"
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
50 //#include "schedule.h"
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
51 #include <stdbool.h>
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
52
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
53 extern Game *game;
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
54
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
55 static void linda_set_schedule(void *func, int mode, Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
56 static bool linda_sche_wait0(int p, Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
57 static bool linda_sche_wait1(int p, Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
58 static bool linda_sche_wait_ready0(int p, Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
59 static bool linda_sche_wait_ready1(int p, Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
60 static bool linda_sche_opening0(int p, Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
61 static bool linda_sche_opening1(int p, Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
62 static bool linda_sche_select_car0(int p, Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
63 static bool linda_sche_select_car1(int p, Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
64 static bool linda_sche_select_course0(int p, Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
65 static bool linda_sche_select_course1(int p, Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
66 static bool linda_sche_ready0(int p, Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
67 static bool linda_sche_ready1(int p, Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
68 static bool linda_sche_main_init(int p, Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
69 //static bool linda_sche_main_init(int p, Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
70 static bool linda_sche_main_ready0(int p, Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
71 static bool linda_sche_main_ready1(int p, Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
72 static bool linda_sche_main(int p, Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
73
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
74 int linda_int(Game *game);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
75
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
76 extern void psx_id(unsigned char *);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
77 extern void psx_linda(unsigned char *);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
78 extern void psx_sync(unsigned char *);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
79 //unsigned char psx_reply(int seq);
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
80
8edae89a3877 compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 88
diff changeset
81 #endif