switch over to libpicofe
[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_SWITCH_DISPMODE },
43         { 0, 0, 0 }
44 };
45
46 int plat_init(void)
47 {
48         plat_omap_init();
49         plat_target_init();
50
51         in_evdev_init(in_evdev_defbinds);
52         in_probe();
53         plat_target_setup_input();
54
55         in_adev[0] = in_name_to_id("evdev:nub0");
56         in_adev[1] = in_name_to_id("evdev:nub1");
57
58         return 0;
59 }
60
61 void plat_finish(void)
62 {
63         plat_omap_finish();
64         plat_target_finish();
65 }
66
67 void plat_gvideo_open(int is_pal)
68 {
69         plat_target_lcdrate_set(is_pal);
70         plat_target_hwfilter_set(filter);
71         plat_target_gamma_set(g_gamma, 0);
72
73         plat_omap_gvideo_open();
74 }
75
76 void plat_trigger_vibrate(int is_strong)
77 {
78 }