still adjusting asm for better as compatibility..
[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_TOGGLE_FPS },
43         { KEY_8,        IN_BINDTYPE_EMU, SACTION_SWITCH_DISPMODE },
44         { KEY_BACKSPACE,IN_BINDTYPE_EMU, SACTION_FAST_FORWARD },
45         { 0, 0, 0 }
46 };
47
48 int plat_init(void)
49 {
50         plat_omap_init();
51         plat_target_init();
52
53         in_evdev_init(in_evdev_defbinds);
54         in_probe();
55         plat_target_setup_input();
56
57         in_adev[0] = in_name_to_id("evdev:nub0");
58         in_adev[1] = in_name_to_id("evdev:nub1");
59         in_adev_is_nublike[0] = in_adev_is_nublike[1] = 1;
60
61         return 0;
62 }
63
64 void plat_finish(void)
65 {
66         plat_omap_finish();
67         plat_target_finish();
68 }
69
70 void plat_gvideo_open(int is_pal)
71 {
72         plat_target_lcdrate_set(is_pal);
73         plat_target_hwfilter_set(plat_target.hwfilter);
74         plat_target_gamma_set(g_gamma, 0);
75
76         plat_omap_gvideo_open();
77 }
78
79 void plat_trigger_vibrate(int is_strong)
80 {
81 }