Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
361 | giacomo | 1 | /* |
2 | * Project: HARTIK (HA-rd R-eal TI-me K-ernel) |
||
3 | * |
||
4 | * Coordinators: Giorgio Buttazzo <giorgio@sssup.it> |
||
5 | * Gerardo Lamastra <gerardo@sssup.it> |
||
6 | * |
||
7 | * Authors : Mauro MArinoni <mauro.marinoni@unipv.it> |
||
8 | * (see authors.txt for full list of hartik's authors) |
||
9 | * |
||
10 | * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
||
11 | * |
||
12 | * http://www.sssup.it |
||
13 | * http://retis.sssup.it |
||
14 | * http://hartik.sssup.it |
||
15 | */ |
||
16 | |||
17 | /* |
||
18 | * Copyright (C) 2000 Paolo Gai |
||
19 | * |
||
20 | * This program is free software; you can redistribute it and/or modify |
||
21 | * it under the terms of the GNU General Public License as published by |
||
22 | * the Free Software Foundation; either version 2 of the License, or |
||
23 | * (at your option) any later version. |
||
24 | * |
||
25 | * This program is distributed in the hope that it will be useful, |
||
26 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
27 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
28 | * GNU General Public License for more details. |
||
29 | * |
||
30 | * You should have received a copy of the GNU General Public License |
||
31 | * along with this program; if not, write to the Free Software |
||
32 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
33 | * |
||
34 | */ |
||
35 | |||
36 | #ifndef __JOY_H__ |
||
37 | #define __JOY_H__ |
||
38 | |||
39 | /* standard I/O port address for the PC joystick */ |
||
40 | #define JPORT 0x201 |
||
41 | |||
42 | /* |
||
43 | * max counts to wait for joystick. In normal usage, you don't |
||
44 | * want this too large, so that the program doesn't hang up too long |
||
45 | * if no joystick is attached. But if you make it too small, a |
||
46 | * program that works on a slow machine may fail on a faster CPU |
||
47 | * (unless you have a "speed adjustable" game card). |
||
48 | */ |
||
49 | #define CMAX 9999 |
||
50 | |||
51 | typedef struct { /*describe the position and buttons state of a joystick*/ |
||
52 | int x; |
||
53 | int y; |
||
54 | char b1; |
||
55 | char b2; |
||
56 | } JOY_STATE; |
||
57 | |||
58 | typedef struct { /*describe the four buttons state of a joystick*/ |
||
59 | char b1; |
||
60 | char b2; |
||
61 | char b3; |
||
62 | char b4; |
||
63 | } JOY_BUTTONS; |
||
64 | |||
65 | typedef struct { /*describe the position boundaries of a joystick*/ |
||
66 | int x_min; |
||
67 | int y_min; |
||
68 | int x_max; |
||
69 | int y_max; |
||
70 | } JOY_BOUND; |
||
71 | |||
72 | void get_joystick_buttons(JOY_BUTTONS *jb); |
||
73 | int get_joystick_AB(JOY_STATE *jsa, JOY_STATE *jsb); |
||
74 | int get_joystick_A(JOY_STATE *js); |
||
75 | int get_joystick_B(JOY_STATE *js); |
||
76 | int get_joystick_bound_A(JOY_BOUND *jb); |
||
77 | int get_joystick_bound_B(JOY_BOUND *jb); |
||
78 | |||
79 | #endif |