static void *shadow_fb;
-static const struct in_default_bind in_sdl_defbinds[] = {
+const struct in_default_bind in_sdl_defbinds[] __attribute__((weak)) = {
{ SDLK_UP, IN_BINDTYPE_PLAYER12, GBTN_UP },
{ SDLK_DOWN, IN_BINDTYPE_PLAYER12, GBTN_DOWN },
{ SDLK_LEFT, IN_BINDTYPE_PLAYER12, GBTN_LEFT },
{ 0, 0, 0 }
};
+const struct menu_keymap in_sdl_key_map[] __attribute__((weak)) =
+{
+ { SDLK_UP, PBTN_UP },
+ { SDLK_DOWN, PBTN_DOWN },
+ { SDLK_LEFT, PBTN_LEFT },
+ { SDLK_RIGHT, PBTN_RIGHT },
+ { SDLK_RETURN, PBTN_MOK },
+ { SDLK_ESCAPE, PBTN_MBACK },
+ { SDLK_SEMICOLON, PBTN_MA2 },
+ { SDLK_QUOTE, PBTN_MA3 },
+ { SDLK_LEFTBRACKET, PBTN_L },
+ { SDLK_RIGHTBRACKET, PBTN_R },
+};
+
+const struct menu_keymap in_sdl_joy_map[] __attribute__((weak)) =
+{
+ { SDLK_UP, PBTN_UP },
+ { SDLK_DOWN, PBTN_DOWN },
+ { SDLK_LEFT, PBTN_LEFT },
+ { SDLK_RIGHT, PBTN_RIGHT },
+ /* joystick */
+ { SDLK_WORLD_0, PBTN_MOK },
+ { SDLK_WORLD_1, PBTN_MBACK },
+ { SDLK_WORLD_2, PBTN_MA2 },
+ { SDLK_WORLD_3, PBTN_MA3 },
+};
+
+static const struct in_pdata in_sdl_platform_data = {
+ .defbinds = in_sdl_defbinds,
+ .key_map = in_sdl_key_map,
+ .kmap_size = sizeof(in_sdl_key_map) / sizeof(in_sdl_key_map[0]),
+ .joy_map = in_sdl_joy_map,
+ .jmap_size = sizeof(in_sdl_joy_map) / sizeof(in_sdl_joy_map[0]),
+};
+
/* YUV stuff */
static int yuv_ry[32], yuv_gy[32], yuv_by[32];
static unsigned char yuv_u[32 * 2], yuv_v[32 * 2];
g_screen_height = 240;
g_screen_ptr = shadow_fb;
- in_sdl_init(in_sdl_defbinds, plat_sdl_event_handler);
+ in_sdl_init(&in_sdl_platform_data, plat_sdl_event_handler);
in_probe();
bgr_to_uyvy_init();
{ 0, 0, 0 }
};
+static const struct menu_keymap key_pbtn_map[] =
+{
+ { KEY_UP, PBTN_UP },
+ { KEY_DOWN, PBTN_DOWN },
+ { KEY_LEFT, PBTN_LEFT },
+ { KEY_RIGHT, PBTN_RIGHT },
+ /* Caanoo */
+ { BTN_THUMB2, PBTN_MOK },
+ { BTN_THUMB, PBTN_MBACK },
+ { BTN_TRIGGER, PBTN_MA2 },
+ { BTN_TOP, PBTN_MA3 },
+ { BTN_BASE, PBTN_MENU },
+ { BTN_TOP2, PBTN_L },
+ { BTN_PINKIE, PBTN_R },
+ /* "normal" keyboards */
+ { KEY_ENTER, PBTN_MOK },
+ { KEY_ESC, PBTN_MBACK },
+ { KEY_SEMICOLON, PBTN_MA2 },
+ { KEY_APOSTROPHE, PBTN_MA3 },
+ { KEY_BACKSLASH, PBTN_MENU },
+ { KEY_LEFTBRACE, PBTN_L },
+ { KEY_RIGHTBRACE, PBTN_R },
+};
+
+static const struct in_evdev_pdata gp2x_evdev_pdata = {
+ .defbinds = in_gp2x_defbinds,
+ .key_map = key_pbtn_map,
+ .kmap_size = sizeof(key_pbtn_map) / sizeof(key_pbtn_map[0]),
+};
+
void gp2x_video_changemode(int bpp, int is_pal)
{
gp2x_video_changemode_ll(bpp, is_pal);
flip_after_sync = 1;
gp2x_menu_init();
- in_evdev_init(in_evdev_defbinds);
+ in_evdev_init(&gp2x_evdev_pdata);
in_gp2x_init(in_gp2x_defbinds);
in_probe();
plat_target_setup_input();
-Subproject commit c52e6628cdf9c53e9143e903ab793bf59987a0ea
+Subproject commit c19e28f62660cdaed26698234cff9c084517b34c
{ 0, 0, 0 }\r
};\r
\r
+static const struct menu_keymap key_pbtn_map[] =\r
+{\r
+ { KEY_UP, PBTN_UP },\r
+ { KEY_DOWN, PBTN_DOWN },\r
+ { KEY_LEFT, PBTN_LEFT },\r
+ { KEY_RIGHT, PBTN_RIGHT },\r
+ /* Pandora */\r
+ { KEY_END, PBTN_MOK },\r
+ { KEY_PAGEDOWN, PBTN_MBACK },\r
+ { KEY_HOME, PBTN_MA2 },\r
+ { KEY_PAGEUP, PBTN_MA3 },\r
+ { KEY_LEFTCTRL, PBTN_MENU },\r
+ { KEY_RIGHTSHIFT, PBTN_L },\r
+ { KEY_RIGHTCTRL, PBTN_R },\r
+ /* "normal" keyboards */\r
+ { KEY_ENTER, PBTN_MOK },\r
+ { KEY_ESC, PBTN_MBACK },\r
+ { KEY_SEMICOLON, PBTN_MA2 },\r
+ { KEY_APOSTROPHE, PBTN_MA3 },\r
+ { KEY_BACKSLASH, PBTN_MENU },\r
+ { KEY_LEFTBRACE, PBTN_L },\r
+ { KEY_RIGHTBRACE, PBTN_R },\r
+};\r
+\r
+static const struct in_pdata pandora_evdev_pdata = {\r
+ .defbinds = in_evdev_defbinds,\r
+ .key_map = key_pbtn_map,\r
+ .kmap_size = sizeof(key_pbtn_map) / sizeof(key_pbtn_map[0]),\r
+};\r
+\r
void pemu_prep_defconfig(void)\r
{\r
defaultConfig.EmuOpt |= EOPT_VSYNC|EOPT_16BPP;\r
// default ROM path\r
strcpy(rom_fname_loaded, "/media");\r
\r
- in_evdev_init(in_evdev_defbinds);\r
+ in_evdev_init(&pandora_evdev_pdata);\r
in_probe();\r
plat_target_setup_input();\r
\r