1 /** \file   joy-unix.h
2  * \brief   Joystick support for Linux - header
3  *
4  * \author  Bernhard Kuhn <kuhn@eikon.e-technik.tu-muenchen.de>
5  * \author  Ulmer Lionel <ulmer@poly.polytechnique.fr>
6  * \author  Daniel Sladic <sladic@eecg.toronto.edu>
7  * \author  Luca Montecchiani <m.luca@usa.net> (http://i.am/m.luca)
8  */
9 
10 /*
11  * This file is part of VICE, the Versatile Commodore Emulator.
12  * See README for copyright notice.
13  *
14  *  This program is free software; you can redistribute it and/or modify
15  *  it under the terms of the GNU General Public License as published by
16  *  the Free Software Foundation; either version 2 of the License, or
17  *  (at your option) any later version.
18  *
19  *  This program is distributed in the hope that it will be useful,
20  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  *  GNU General Public License for more details.
23  *
24  *  You should have received a copy of the GNU General Public License
25  *  along with this program; if not, write to the Free Software
26  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
27  *  02111-1307  USA.
28  *
29  */
30 
31 #ifndef VICE_JOY_UNIX_H
32 #define VICE_JOY_UNIX_H
33 
34 void joystick_close(void);
35 void joystick(void);
36 void old_joystick_init(void);
37 void old_joystick_close(void);
38 void old_joystick(void);
39 void new_joystick_init(void);
40 void new_joystick_close(void);
41 void new_joystick(void);
42 
43 #ifdef HAS_USB_JOYSTICK
44 int usb_joystick_init(void);
45 void usb_joystick_close(void);
46 void usb_joystick(void);
47 #endif
48 
49 /* standard devices */
50 #define JOYDEV_NONE      0
51 #define JOYDEV_NUMPAD    1
52 #define JOYDEV_KEYSET1   2
53 #define JOYDEV_KEYSET2   3
54 /* extra devices */
55 #define JOYDEV_ANALOG_0  4
56 #define JOYDEV_ANALOG_1  5
57 #define JOYDEV_ANALOG_2  6
58 #define JOYDEV_ANALOG_3  7
59 #define JOYDEV_ANALOG_4  8
60 #define JOYDEV_ANALOG_5  9
61 #define JOYDEV_DIGITAL_0 10
62 #define JOYDEV_DIGITAL_1 11
63 #define JOYDEV_USB_0     12
64 #define JOYDEV_USB_1     13
65 
66 #define JOYDEV_DEFAULT   JOYDEV_NUMPAD
67 
68 #ifdef HAS_JOYSTICK
69 #  ifdef HAS_USB_JOYSTICK
70 #    define JOYDEV_MAX          JOYDEV_USB_1
71 #  else
72 #    ifdef HAS_DIGITAL_JOYSTICK
73 #      define JOYDEV_MAX        JOYDEV_DIGITAL_1
74 #    else
75 #      define JOYDEV_MAX        JOYDEV_ANALOG_5
76 #    endif
77 #  endif
78 #else
79 #  define JOYDEV_MAX            JOYDEV_KEYSET2
80 #endif
81 
82 void joystick_ui_reset_device_list(void);
83 const char *joystick_ui_get_next_device_name(int *id);
84 
85 #endif
86