1 /*
2  * OpenBOR - http://www.LavaLit.com
3  * -----------------------------------------------------------------------
4  * Licensed under the BSD license, see LICENSE in OpenBOR root for details.
5  *
6  * Copyright (c) 2004 - 2011 OpenBOR Team
7  */
8 
9 #ifndef	CONTROL_H
10 #define	CONTROL_H
11 
12 #define	CONTROL_ESC					12
13 
14 #define	CONTROL_DEFAULT1_UP			1
15 #define	CONTROL_DEFAULT1_RIGHT		2
16 #define	CONTROL_DEFAULT1_DOWN		3
17 #define	CONTROL_DEFAULT1_LEFT		4
18 #define CONTROL_DEFAULT1_FIRE1		5
19 #define CONTROL_DEFAULT1_FIRE2		6
20 #define	CONTROL_DEFAULT1_FIRE3		7
21 #define	CONTROL_DEFAULT1_FIRE4		8
22 #define	CONTROL_DEFAULT1_FIRE5		13
23 #define	CONTROL_DEFAULT1_FIRE6		14
24 #define CONTROL_DEFAULT1_START		11
25 #define CONTROL_DEFAULT1_SCREENSHOT 10
26 
27 #define	CONTROL_DEFAULT2_UP			(1+16)
28 #define	CONTROL_DEFAULT2_RIGHT		(2+16)
29 #define	CONTROL_DEFAULT2_DOWN		(3+16)
30 #define	CONTROL_DEFAULT2_LEFT		(4+16)
31 #define CONTROL_DEFAULT2_FIRE1		(5+16)
32 #define CONTROL_DEFAULT2_FIRE2		(6+16)
33 #define	CONTROL_DEFAULT2_FIRE3		(7+16)
34 #define	CONTROL_DEFAULT2_FIRE4		(8+16)
35 #define	CONTROL_DEFAULT2_FIRE5		(13+16)
36 #define	CONTROL_DEFAULT2_FIRE6		(14+16)
37 #define CONTROL_DEFAULT2_START		(11+16)
38 #define CONTROL_DEFAULT2_SCREENSHOT (10+16)
39 
40 #define	CONTROL_DEFAULT3_UP			(1+(16*2))
41 #define	CONTROL_DEFAULT3_RIGHT		(2+(16*2))
42 #define	CONTROL_DEFAULT3_DOWN		(3+(16*2))
43 #define	CONTROL_DEFAULT3_LEFT		(4+(16*2))
44 #define CONTROL_DEFAULT3_FIRE1		(5+(16*2))
45 #define CONTROL_DEFAULT3_FIRE2		(6+(16*2))
46 #define	CONTROL_DEFAULT3_FIRE3		(7+(16*2))
47 #define	CONTROL_DEFAULT3_FIRE4		(8+(16*2))
48 #define	CONTROL_DEFAULT3_FIRE5		(13+(16*2))
49 #define	CONTROL_DEFAULT3_FIRE6		(14+(16*2))
50 #define CONTROL_DEFAULT3_START		(11+(16*2))
51 #define CONTROL_DEFAULT3_SCREENSHOT (10+(16*2))
52 
53 #define	CONTROL_DEFAULT4_UP			(1+(16*3))
54 #define	CONTROL_DEFAULT4_RIGHT		(2+(16*3))
55 #define	CONTROL_DEFAULT4_DOWN		(3+(16*3))
56 #define	CONTROL_DEFAULT4_LEFT		(4+(16*3))
57 #define CONTROL_DEFAULT4_FIRE1		(5+(16*3))
58 #define CONTROL_DEFAULT4_FIRE2		(6+(16*3))
59 #define	CONTROL_DEFAULT4_FIRE3		(7+(16*3))
60 #define	CONTROL_DEFAULT4_FIRE4		(8+(16*3))
61 #define	CONTROL_DEFAULT4_FIRE5		(13+(16*3))
62 #define	CONTROL_DEFAULT4_FIRE6		(14+(16*3))
63 #define CONTROL_DEFAULT4_START		(11+(16*3))
64 #define CONTROL_DEFAULT4_SCREENSHOT (10+(16*3))
65 
66 
67 typedef struct{
68 	int		settings[32];
69 	unsigned long	keyflags, newkeyflags;
70 	int		kb_break;
71 }s_playercontrols;
72 
73 
74 void control_exit();
75 void control_init(int joy_enable);
76 int control_usejoy(int enable);
77 int control_getjoyenabled();
78 
79 void control_setkey(s_playercontrols * pcontrols, unsigned int flag, int key);
80 int control_scankey();
81 
82 char * control_getkeyname(unsigned int keycode);
83 void control_update(s_playercontrols ** playercontrols, int numplayers);
control_rumble(int port,int msec)84 void control_rumble(int port, int msec)
85 {
86 }
87 
88 #endif
89 
90