28aaaab2083034d5471f552b0eb7d89125404d73
[pcsx_rearmed.git] / frontend / plat_pandora.c
1 /*
2  * (C) notaz, 2011
3  *
4  * This work is licensed under the terms of the GNU GPLv2 or later.
5  * See the COPYING file in the top-level directory.
6  */
7
8 #include <stdio.h>
9 #include <linux/input.h>
10
11 #include "libpicofe/input.h"
12 #include "libpicofe/linux/in_evdev.h"
13 #include "libpicofe/plat.h"
14 #include "plugin_lib.h"
15 #include "plat_omap.h"
16 #include "main.h"
17 #include "menu.h"
18
19 static const struct in_default_bind in_evdev_defbinds[] = {
20         { KEY_UP,       IN_BINDTYPE_PLAYER12, DKEY_UP },
21         { KEY_DOWN,     IN_BINDTYPE_PLAYER12, DKEY_DOWN },
22         { KEY_LEFT,     IN_BINDTYPE_PLAYER12, DKEY_LEFT },
23         { KEY_RIGHT,    IN_BINDTYPE_PLAYER12, DKEY_RIGHT },
24         { KEY_PAGEUP,   IN_BINDTYPE_PLAYER12, DKEY_TRIANGLE },
25         { KEY_PAGEDOWN, IN_BINDTYPE_PLAYER12, DKEY_CROSS },
26         { KEY_END,      IN_BINDTYPE_PLAYER12, DKEY_CIRCLE },
27         { KEY_HOME,     IN_BINDTYPE_PLAYER12, DKEY_SQUARE },
28         { KEY_LEFTALT,  IN_BINDTYPE_PLAYER12, DKEY_START },
29         { KEY_LEFTCTRL, IN_BINDTYPE_PLAYER12, DKEY_SELECT },
30         { KEY_RIGHTSHIFT,IN_BINDTYPE_PLAYER12, DKEY_L1 },
31         { KEY_RIGHTCTRL, IN_BINDTYPE_PLAYER12, DKEY_R1 },
32         { KEY_Q,        IN_BINDTYPE_PLAYER12, DKEY_L2 },
33         { KEY_P,        IN_BINDTYPE_PLAYER12, DKEY_R2 },
34         { KEY_MENU,     IN_BINDTYPE_EMU, SACTION_MINIMIZE },
35         { KEY_SPACE,    IN_BINDTYPE_EMU, SACTION_ENTER_MENU },
36         { KEY_1,        IN_BINDTYPE_EMU, SACTION_SAVE_STATE },
37         { KEY_2,        IN_BINDTYPE_EMU, SACTION_LOAD_STATE },
38         { KEY_3,        IN_BINDTYPE_EMU, SACTION_PREV_SSLOT },
39         { KEY_4,        IN_BINDTYPE_EMU, SACTION_NEXT_SSLOT },
40         { KEY_5,        IN_BINDTYPE_EMU, SACTION_TOGGLE_FSKIP },
41         { KEY_6,        IN_BINDTYPE_EMU, SACTION_SCREENSHOT },
42         { KEY_7,        IN_BINDTYPE_EMU, SACTION_FAST_FORWARD },
43         { KEY_8,        IN_BINDTYPE_EMU, SACTION_SWITCH_DISPMODE },
44         { 0, 0, 0 }
45 };
46
47 int plat_init(void)
48 {
49         plat_omap_init();
50         plat_target_init();
51
52         in_evdev_init(in_evdev_defbinds);
53         in_probe();
54         plat_target_setup_input();
55
56         in_adev[0] = in_name_to_id("evdev:nub0");
57         in_adev[1] = in_name_to_id("evdev:nub1");
58         in_adev_is_nublike[0] = in_adev_is_nublike[1] = 1;
59
60         return 0;
61 }
62
63 void plat_finish(void)
64 {
65         plat_omap_finish();
66         plat_target_finish();
67 }
68
69 void plat_gvideo_open(int is_pal)
70 {
71         plat_target_lcdrate_set(is_pal);
72         plat_target_hwfilter_set(filter);
73         plat_target_gamma_set(g_gamma, 0);
74
75         plat_omap_gvideo_open();
76 }
77
78 void plat_trigger_vibrate(int is_strong)
79 {
80 }