diff options
author | Twinaphex | 2014-12-20 20:43:18 +0100 |
---|---|---|
committer | Twinaphex | 2014-12-20 20:43:18 +0100 |
commit | 247fc699be6b3bd95fd9126541e0804cc8dffdd4 (patch) | |
tree | d38e169e68e48a3ccbf8a3805f9cb87197ed894a /frontend/plat_sdl.c | |
parent | 3e5b01fcef8ef20dacca45ea7a7b0c461e6bd666 (diff) | |
parent | 7931825ed8ef51dab3e37475d8126103ebc9fb6f (diff) | |
download | pcsx_rearmed-247fc699be6b3bd95fd9126541e0804cc8dffdd4.tar.gz pcsx_rearmed-247fc699be6b3bd95fd9126541e0804cc8dffdd4.tar.bz2 pcsx_rearmed-247fc699be6b3bd95fd9126541e0804cc8dffdd4.zip |
Merge pull request #11 from notaz/upstream_merge
Upstream merge
Diffstat (limited to 'frontend/plat_sdl.c')
-rw-r--r-- | frontend/plat_sdl.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/frontend/plat_sdl.c b/frontend/plat_sdl.c index 247437e..5e11cf8 100644 --- a/frontend/plat_sdl.c +++ b/frontend/plat_sdl.c @@ -53,6 +53,41 @@ static const struct in_default_bind in_sdl_defbinds[] = { { 0, 0, 0 } }; +const struct menu_keymap in_sdl_key_map[] = +{ + { 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[] = +{ + { 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]), +}; + static int psx_w, psx_h; static void *shadow_fb, *menubg_img; static int in_menu; @@ -122,7 +157,7 @@ void plat_init(void) exit(1); } - in_sdl_init(in_sdl_defbinds, plat_sdl_event_handler); + in_sdl_init(&in_sdl_platform_data, plat_sdl_event_handler); in_probe(); pl_rearmed_cbs.only_16bpp = 1; pl_rearmed_cbs.pl_get_layer_pos = get_layer_pos; @@ -301,7 +336,7 @@ void *plat_prepare_screenshot(int *w, int *h, int *bpp) return 0; } -void plat_trigger_vibrate(int is_strong) +void plat_trigger_vibrate(int pad, int low, int high) { } |