initial pandora port, with hardware scaling and stuff
[gpsp.git] / input.h
1 /* gameplaySP
2  *
3  * Copyright (C) 2006 Exophase <exophase@gmail.com>
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation; either version 2 of
8  * the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19
20 #ifndef INPUT_H
21 #define INPUT_H
22
23 typedef enum
24 {
25   BUTTON_L = 0x200,
26   BUTTON_R = 0x100,
27   BUTTON_DOWN = 0x80,
28   BUTTON_UP = 0x40,
29   BUTTON_LEFT = 0x20,
30   BUTTON_RIGHT = 0x10,
31   BUTTON_START = 0x08,
32   BUTTON_SELECT = 0x04,
33   BUTTON_B = 0x02,
34   BUTTON_A = 0x01,
35   BUTTON_NONE = 0x00
36 } input_buttons_type;
37
38 typedef enum
39 {
40   BUTTON_ID_UP,
41   BUTTON_ID_DOWN,
42   BUTTON_ID_LEFT,
43   BUTTON_ID_RIGHT,
44   BUTTON_ID_A,
45   BUTTON_ID_B,
46   BUTTON_ID_L,
47   BUTTON_ID_R,
48   BUTTON_ID_START,
49   BUTTON_ID_SELECT,
50   BUTTON_ID_MENU,
51   BUTTON_ID_FASTFORWARD,
52   BUTTON_ID_LOADSTATE,
53   BUTTON_ID_SAVESTATE,
54   BUTTON_ID_RAPIDFIRE_A,
55   BUTTON_ID_RAPIDFIRE_B,
56   BUTTON_ID_RAPIDFIRE_L,
57   BUTTON_ID_RAPIDFIRE_R,
58   BUTTON_ID_VOLUP,
59   BUTTON_ID_VOLDOWN,
60   BUTTON_ID_FPS,
61   BUTTON_ID_NONE
62 } input_buttons_id_type;
63
64 typedef enum
65 {
66   CURSOR_UP,
67   CURSOR_DOWN,
68   CURSOR_LEFT,
69   CURSOR_RIGHT,
70   CURSOR_SELECT,
71   CURSOR_BACK,
72   CURSOR_EXIT,
73   CURSOR_L,
74   CURSOR_R,
75   CURSOR_NONE
76 } gui_action_type;
77
78 void init_input();
79 u32 update_input();
80 gui_action_type get_gui_input();
81 gui_action_type get_gui_input_fs_hold(u32 button_id);
82 void input_write_mem_savestate(file_tag_type savestate_file);
83 void input_read_savestate(file_tag_type savestate_file);
84
85 extern u32 gamepad_config_map[];
86 extern u32 global_enable_analog;
87 extern u32 analog_sensitivity_level;
88
89 #endif
90