diff --git a/Makefile.common b/Makefile.common index 00bd4f74dd..f6c4233ca8 100644 --- a/Makefile.common +++ b/Makefile.common @@ -207,7 +207,6 @@ OBJ += frontend/frontend.o \ gfx/drivers_font_renderer/bitmapfont.o \ tasks/task_autodetect.o \ input/input_autodetect_builtin.o \ - input/input_config.o \ input/input_keymaps.o \ input/input_remapping.o \ tasks/task_overlay.o \ diff --git a/command.c b/command.c index b443ee5520..9fa4b5b80e 100644 --- a/command.c +++ b/command.c @@ -58,7 +58,7 @@ #include "defaults.h" #include "driver.h" -#include "input/input_config.h" +#include "input/input_driver.h" #include "frontend/frontend_driver.h" #include "audio/audio_driver.h" #include "record/record_driver.h" diff --git a/configuration.c b/configuration.c index cf37d12a05..61ea37a212 100644 --- a/configuration.c +++ b/configuration.c @@ -37,7 +37,6 @@ #include "content.h" #include "config.def.h" #include "config.features.h" -#include "input/input_config.h" #include "input/input_keymaps.h" #include "input/input_remapping.h" #include "defaults.h" diff --git a/gfx/video_state_tracker.c b/gfx/video_state_tracker.c index 4a6694d892..8cebede20f 100644 --- a/gfx/video_state_tracker.c +++ b/gfx/video_state_tracker.c @@ -29,7 +29,7 @@ #include "video_state_tracker.h" -#include "../input/input_config.h" +#include "../input/input_driver.h" #include "../verbosity.h" diff --git a/griffin/griffin.c b/griffin/griffin.c index 9eeebde565..528cefc8a6 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -459,7 +459,6 @@ INPUT ============================================================ */ #include "../tasks/task_autodetect.c" #include "../tasks/task_audio_mixer.c" -#include "../input/input_config.c" #include "../input/input_keymaps.c" #include "../input/input_remapping.c" diff --git a/input/connect/joypad_connection.c b/input/connect/joypad_connection.c index 2d98612de7..0942505db2 100644 --- a/input/connect/joypad_connection.c +++ b/input/connect/joypad_connection.c @@ -19,7 +19,7 @@ #include -#include "../input_config.h" +#include "../input_driver.h" #include "joypad_connection.h" diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index adf3f18404..f25477e372 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -33,7 +33,6 @@ #include "../../menu/menu_driver.h" #endif -#include "../input_config.h" #include "../input_driver.h" #include "../../frontend/drivers/platform_unix.h" diff --git a/input/drivers/cocoa_input.c b/input/drivers/cocoa_input.c index bb59111bde..9b84770b8b 100644 --- a/input/drivers/cocoa_input.c +++ b/input/drivers/cocoa_input.c @@ -21,7 +21,6 @@ #include "../../config.h" #endif -#include "../input_config.h" #include "../input_driver.h" #include "../input_keymaps.h" diff --git a/input/drivers/ctr_input.c b/input/drivers/ctr_input.c index 002212ec96..579769dc78 100644 --- a/input/drivers/ctr_input.c +++ b/input/drivers/ctr_input.c @@ -25,7 +25,6 @@ #include "../../config.h" #endif -#include "../input_config.h" #include "../input_driver.h" #define MAX_PADS 1 diff --git a/input/drivers/dinput.c b/input/drivers/dinput.c index b1b34051c8..e376dfb68e 100644 --- a/input/drivers/dinput.c +++ b/input/drivers/dinput.c @@ -44,7 +44,6 @@ #include -#include "../input_config.h" #include "../input_driver.h" #include "../input_keymaps.h" diff --git a/input/drivers/psp_input.c b/input/drivers/psp_input.c index d396072c13..b7e2b959ae 100644 --- a/input/drivers/psp_input.c +++ b/input/drivers/psp_input.c @@ -41,7 +41,6 @@ #include "../../defines/psp_defines.h" -#include "../input_config.h" #include "../input_driver.h" typedef struct psp_input diff --git a/input/drivers/rwebinput_input.c b/input/drivers/rwebinput_input.c index 47af72d4ca..9d2fde4d96 100644 --- a/input/drivers/rwebinput_input.c +++ b/input/drivers/rwebinput_input.c @@ -20,7 +20,6 @@ #include -#include "../input_config.h" #include "../input_driver.h" #include "../input_keymaps.h" diff --git a/input/drivers/sdl_input.c b/input/drivers/sdl_input.c index 7944f18cd7..83d18551d3 100644 --- a/input/drivers/sdl_input.c +++ b/input/drivers/sdl_input.c @@ -24,7 +24,6 @@ #include "SDL.h" -#include "../input_config.h" #include "../input_driver.h" #include "../input_keymaps.h" diff --git a/input/drivers/udev_input.c b/input/drivers/udev_input.c index 950096951e..501e408d6f 100644 --- a/input/drivers/udev_input.c +++ b/input/drivers/udev_input.c @@ -46,7 +46,6 @@ #include #include -#include "../input_config.h" #include "../input_driver.h" #include "../input_keymaps.h" diff --git a/input/drivers/wayland_input.c b/input/drivers/wayland_input.c index 22cf62239e..21ff484568 100644 --- a/input/drivers/wayland_input.c +++ b/input/drivers/wayland_input.c @@ -37,7 +37,6 @@ #include #include -#include "../input_config.h" #include "../input_driver.h" #include "../input_keymaps.h" diff --git a/input/drivers/wiiu_input.c b/input/drivers/wiiu_input.c index 2fb3a6736f..df0d7f208b 100644 --- a/input/drivers/wiiu_input.c +++ b/input/drivers/wiiu_input.c @@ -28,7 +28,6 @@ #include "../../config.h" #endif -#include "../input_config.h" #include "../input_driver.h" #include "../input_keymaps.h" diff --git a/input/drivers/x11_input.c b/input/drivers/x11_input.c index eeadfb5456..40842f0719 100644 --- a/input/drivers/x11_input.c +++ b/input/drivers/x11_input.c @@ -24,7 +24,6 @@ #include #include -#include "../input_config.h" #include "../input_driver.h" #include "../input_keymaps.h" diff --git a/input/drivers_joypad/android_joypad.c b/input/drivers_joypad/android_joypad.c index 0171bafab2..a818406092 100644 --- a/input/drivers_joypad/android_joypad.c +++ b/input/drivers_joypad/android_joypad.c @@ -15,7 +15,7 @@ * If not, see . */ -#include "../input_config.h" +#include "../input_driver.h" #include "../drivers_keyboard/keyboard_event_android.h" static const char *android_joypad_name(unsigned pad) diff --git a/input/drivers_joypad/ctr_joypad.c b/input/drivers_joypad/ctr_joypad.c index 59faf35fc0..aa1b3efcbe 100644 --- a/input/drivers_joypad/ctr_joypad.c +++ b/input/drivers_joypad/ctr_joypad.c @@ -19,7 +19,6 @@ #endif #include "../input_driver.h" -#include "../input_config.h" #include "../../tasks/tasks_internal.h" diff --git a/input/drivers_joypad/dinput_joypad.c b/input/drivers_joypad/dinput_joypad.c index 7541cf0dbb..653b666f30 100644 --- a/input/drivers_joypad/dinput_joypad.c +++ b/input/drivers_joypad/dinput_joypad.c @@ -31,7 +31,6 @@ #include "../../tasks/tasks_internal.h" #include "../gfx/video_driver.h" -#include "../input_config.h" #include "../input_driver.h" #include "../input_keymaps.h" #include "../../verbosity.h" diff --git a/input/drivers_joypad/dos_joypad.c b/input/drivers_joypad/dos_joypad.c index fae3480b24..473e6c5326 100644 --- a/input/drivers_joypad/dos_joypad.c +++ b/input/drivers_joypad/dos_joypad.c @@ -27,7 +27,6 @@ #include #include "../input_driver.h" -#include "../input_config.h" #include "../input_keymaps.h" #include "../../tasks/tasks_internal.h" #include "../drivers_keyboard/keyboard_event_dos.h" diff --git a/input/drivers_joypad/linuxraw_joypad.c b/input/drivers_joypad/linuxraw_joypad.c index 57595d4e99..4178ffe188 100644 --- a/input/drivers_joypad/linuxraw_joypad.c +++ b/input/drivers_joypad/linuxraw_joypad.c @@ -30,7 +30,6 @@ #include #include -#include "../input_config.h" #include "../input_driver.h" #include "../../verbosity.h" diff --git a/input/drivers_joypad/parport_joypad.c b/input/drivers_joypad/parport_joypad.c index 4107775c3f..c3bc156db3 100644 --- a/input/drivers_joypad/parport_joypad.c +++ b/input/drivers_joypad/parport_joypad.c @@ -26,7 +26,6 @@ #include -#include "../input_config.h" #include "../input_driver.h" #include "../../configuration.h" diff --git a/input/drivers_joypad/psp_joypad.c b/input/drivers_joypad/psp_joypad.c index 97e05eb785..47014ba7f7 100644 --- a/input/drivers_joypad/psp_joypad.c +++ b/input/drivers_joypad/psp_joypad.c @@ -17,7 +17,7 @@ #include #include -#include "../input_config.h" +#include "../input_driver.h" #include "../../tasks/tasks_internal.h" diff --git a/input/drivers_joypad/sdl_joypad.c b/input/drivers_joypad/sdl_joypad.c index b3de6f554d..fa141059e0 100644 --- a/input/drivers_joypad/sdl_joypad.c +++ b/input/drivers_joypad/sdl_joypad.c @@ -21,7 +21,6 @@ #include "SDL.h" -#include "../input_config.h" #include "../input_driver.h" #include "../../tasks/tasks_internal.h" diff --git a/input/drivers_joypad/udev_joypad.c b/input/drivers_joypad/udev_joypad.c index 5b22a519fb..ce3ad8617d 100644 --- a/input/drivers_joypad/udev_joypad.c +++ b/input/drivers_joypad/udev_joypad.c @@ -32,7 +32,6 @@ #include #include -#include "../input_config.h" #include "../input_driver.h" #include "../../tasks/tasks_internal.h" diff --git a/input/drivers_joypad/wiiu_joypad.c b/input/drivers_joypad/wiiu_joypad.c index 33d2da4d7b..62e2317d2c 100644 --- a/input/drivers_joypad/wiiu_joypad.c +++ b/input/drivers_joypad/wiiu_joypad.c @@ -23,7 +23,6 @@ #include "wiiu/controller_patcher/ControllerPatcherWrapper.h" -#include "../input_config.h" #include "../input_driver.h" #include "../../tasks/tasks_internal.h" diff --git a/input/drivers_joypad/xdk_joypad.c b/input/drivers_joypad/xdk_joypad.c index 0ccf538d1b..d9549428a3 100644 --- a/input/drivers_joypad/xdk_joypad.c +++ b/input/drivers_joypad/xdk_joypad.c @@ -16,7 +16,7 @@ #include -#include "../input_config.h" +#include "../input_driver.h" #include "../../tasks/tasks_internal.h" static uint64_t pad_state[MAX_PADS]; diff --git a/input/drivers_joypad/xinput_joypad.c b/input/drivers_joypad/xinput_joypad.c index eacba9e370..d753a889dc 100644 --- a/input/drivers_joypad/xinput_joypad.c +++ b/input/drivers_joypad/xinput_joypad.c @@ -36,7 +36,7 @@ #endif #include "../../tasks/tasks_internal.h" -#include "../input_config.h" +#include "../input_driver.h" #include "../../verbosity.h" diff --git a/input/input_autodetect_builtin.c b/input/input_autodetect_builtin.c index 5931bb2c76..ba55e1ecbd 100644 --- a/input/input_autodetect_builtin.c +++ b/input/input_autodetect_builtin.c @@ -22,7 +22,7 @@ #include #include "../tasks/tasks_internal.h" -#include "input_config.h" +#include "input_driver.h" #ifdef __QNX__ #include diff --git a/input/input_config.c b/input/input_config.c deleted file mode 100644 index b3c92117d9..0000000000 --- a/input/input_config.c +++ /dev/null @@ -1,599 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2017 - Daniel De Matteis - * Copyright (C) 2016-2017 - Brad Parker - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . - */ - -#include -#include -#include - -#include -#include -#include -#include -#include - -#ifdef HAVE_CONFIG_H -#include "../config.h" -#endif - -#include "input_config.h" -#include "input_driver.h" -#include "input_keymaps.h" -#include "input_remapping.h" - -#include "../config.def.keybinds.h" - -#include "../msg_hash.h" -#include "../configuration.h" -#include "../file_path_special.h" -#include "../tasks/tasks_internal.h" -#include "../verbosity.h" - -/* Input config. */ -struct input_bind_map -{ - bool valid; - - /* Meta binds get input as prefix, not input_playerN". - * 0 = libretro related. - * 1 = Common hotkey. - * 2 = Uncommon/obscure hotkey. - */ - unsigned meta; - - const char *base; - enum msg_hash_enums desc; - unsigned retro_key; -}; - -static const char *bind_user_prefix[MAX_USERS] = { - "input_player1", - "input_player2", - "input_player3", - "input_player4", - "input_player5", - "input_player6", - "input_player7", - "input_player8", - "input_player9", - "input_player10", - "input_player11", - "input_player12", - "input_player13", - "input_player14", - "input_player15", - "input_player16", -}; - -static int input_config_vid[MAX_USERS]; -static int input_config_pid[MAX_USERS]; - -char input_device_names[MAX_USERS][64]; -struct retro_keybind input_config_binds[MAX_USERS][RARCH_BIND_LIST_END]; -struct retro_keybind input_autoconf_binds[MAX_USERS][RARCH_BIND_LIST_END]; -const struct retro_keybind *libretro_input_binds[MAX_USERS]; - -#define DECLARE_BIND(x, bind, desc) { true, 0, #x, desc, bind } -#define DECLARE_META_BIND(level, x, bind, desc) { true, level, #x, desc, bind } - -const struct input_bind_map input_config_bind_map[RARCH_BIND_LIST_END_NULL] = { - DECLARE_BIND(b, RETRO_DEVICE_ID_JOYPAD_B, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B), - DECLARE_BIND(y, RETRO_DEVICE_ID_JOYPAD_Y, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_Y), - DECLARE_BIND(select, RETRO_DEVICE_ID_JOYPAD_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_SELECT), - DECLARE_BIND(start, RETRO_DEVICE_ID_JOYPAD_START, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_START), - DECLARE_BIND(up, RETRO_DEVICE_ID_JOYPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_UP), - DECLARE_BIND(down, RETRO_DEVICE_ID_JOYPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_DOWN), - DECLARE_BIND(left, RETRO_DEVICE_ID_JOYPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LEFT), - DECLARE_BIND(right, RETRO_DEVICE_ID_JOYPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_RIGHT), - DECLARE_BIND(a, RETRO_DEVICE_ID_JOYPAD_A, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_A), - DECLARE_BIND(x, RETRO_DEVICE_ID_JOYPAD_X, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_X), - DECLARE_BIND(l, RETRO_DEVICE_ID_JOYPAD_L, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L), - DECLARE_BIND(r, RETRO_DEVICE_ID_JOYPAD_R, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R), - DECLARE_BIND(l2, RETRO_DEVICE_ID_JOYPAD_L2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L2), - DECLARE_BIND(r2, RETRO_DEVICE_ID_JOYPAD_R2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R2), - DECLARE_BIND(l3, RETRO_DEVICE_ID_JOYPAD_L3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L3), - DECLARE_BIND(r3, RETRO_DEVICE_ID_JOYPAD_R3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R3), - DECLARE_BIND(l_x_plus, RARCH_ANALOG_LEFT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_PLUS), - DECLARE_BIND(l_x_minus, RARCH_ANALOG_LEFT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_MINUS), - DECLARE_BIND(l_y_plus, RARCH_ANALOG_LEFT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_PLUS), - DECLARE_BIND(l_y_minus, RARCH_ANALOG_LEFT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_MINUS), - DECLARE_BIND(r_x_plus, RARCH_ANALOG_RIGHT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_PLUS), - DECLARE_BIND(r_x_minus, RARCH_ANALOG_RIGHT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_MINUS), - DECLARE_BIND(r_y_plus, RARCH_ANALOG_RIGHT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_PLUS), - DECLARE_BIND(r_y_minus, RARCH_ANALOG_RIGHT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_MINUS), - - DECLARE_BIND(turbo, RARCH_TURBO_ENABLE, MENU_ENUM_LABEL_VALUE_INPUT_TURBO_ENABLE), - - DECLARE_META_BIND(1, toggle_fast_forward, RARCH_FAST_FORWARD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_KEY), - DECLARE_META_BIND(2, hold_fast_forward, RARCH_FAST_FORWARD_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_HOLD_KEY), - DECLARE_META_BIND(1, load_state, RARCH_LOAD_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_LOAD_STATE_KEY), - DECLARE_META_BIND(1, save_state, RARCH_SAVE_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SAVE_STATE_KEY), - DECLARE_META_BIND(2, toggle_fullscreen, RARCH_FULLSCREEN_TOGGLE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FULLSCREEN_TOGGLE_KEY), - DECLARE_META_BIND(2, exit_emulator, RARCH_QUIT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_QUIT_KEY), - DECLARE_META_BIND(2, state_slot_increase, RARCH_STATE_SLOT_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_PLUS), - DECLARE_META_BIND(2, state_slot_decrease, RARCH_STATE_SLOT_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_MINUS), - DECLARE_META_BIND(1, rewind, RARCH_REWIND, MENU_ENUM_LABEL_VALUE_INPUT_META_REWIND), - DECLARE_META_BIND(2, movie_record_toggle, RARCH_MOVIE_RECORD_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_MOVIE_RECORD_TOGGLE), - DECLARE_META_BIND(2, pause_toggle, RARCH_PAUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_PAUSE_TOGGLE), - DECLARE_META_BIND(2, frame_advance, RARCH_FRAMEADVANCE, MENU_ENUM_LABEL_VALUE_INPUT_META_FRAMEADVANCE), - DECLARE_META_BIND(2, reset, RARCH_RESET, MENU_ENUM_LABEL_VALUE_INPUT_META_RESET), - DECLARE_META_BIND(2, shader_next, RARCH_SHADER_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_NEXT), - DECLARE_META_BIND(2, shader_prev, RARCH_SHADER_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_PREV), - DECLARE_META_BIND(2, cheat_index_plus, RARCH_CHEAT_INDEX_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_PLUS), - DECLARE_META_BIND(2, cheat_index_minus, RARCH_CHEAT_INDEX_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_MINUS), - DECLARE_META_BIND(2, cheat_toggle, RARCH_CHEAT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_TOGGLE), - DECLARE_META_BIND(2, screenshot, RARCH_SCREENSHOT, MENU_ENUM_LABEL_VALUE_INPUT_META_SCREENSHOT), - DECLARE_META_BIND(2, audio_mute, RARCH_MUTE, MENU_ENUM_LABEL_VALUE_INPUT_META_MUTE), - DECLARE_META_BIND(2, osk_toggle, RARCH_OSK, MENU_ENUM_LABEL_VALUE_INPUT_META_OSK), - DECLARE_META_BIND(2, netplay_flip_players_1_2, RARCH_NETPLAY_FLIP, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_FLIP), - DECLARE_META_BIND(2, netplay_game_watch, RARCH_NETPLAY_GAME_WATCH, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_GAME_WATCH), - DECLARE_META_BIND(2, slowmotion, RARCH_SLOWMOTION, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION), - DECLARE_META_BIND(2, enable_hotkey, RARCH_ENABLE_HOTKEY, MENU_ENUM_LABEL_VALUE_INPUT_META_ENABLE_HOTKEY), - DECLARE_META_BIND(2, volume_up, RARCH_VOLUME_UP, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_UP), - DECLARE_META_BIND(2, volume_down, RARCH_VOLUME_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_DOWN), - DECLARE_META_BIND(2, overlay_next, RARCH_OVERLAY_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_OVERLAY_NEXT), - DECLARE_META_BIND(2, disk_eject_toggle, RARCH_DISK_EJECT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_EJECT_TOGGLE), - DECLARE_META_BIND(2, disk_next, RARCH_DISK_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_NEXT), - DECLARE_META_BIND(2, disk_prev, RARCH_DISK_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_PREV), - DECLARE_META_BIND(2, grab_mouse_toggle, RARCH_GRAB_MOUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GRAB_MOUSE_TOGGLE), - DECLARE_META_BIND(2, game_focus_toggle, RARCH_GAME_FOCUS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GAME_FOCUS_TOGGLE), -#ifdef HAVE_MENU - DECLARE_META_BIND(1, menu_toggle, RARCH_MENU_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_MENU_TOGGLE), -#endif -}; - -static const void *input_config_bind_map_get(unsigned i) -{ - return (const struct input_bind_map*)&input_config_bind_map[i]; -} - -bool input_config_bind_map_get_valid(unsigned i) -{ - const struct input_bind_map *keybind = - (const struct input_bind_map*)input_config_bind_map_get(i); - if (!keybind) - return false; - return keybind->valid; -} - -unsigned input_config_bind_map_get_meta(unsigned i) -{ - const struct input_bind_map *keybind = - (const struct input_bind_map*)input_config_bind_map_get(i); - if (!keybind) - return 0; - return keybind->meta; -} - -const char *input_config_bind_map_get_base(unsigned i) -{ - const struct input_bind_map *keybind = - (const struct input_bind_map*)input_config_bind_map_get(i); - if (!keybind) - return NULL; - return keybind->base; -} - -const char *input_config_bind_map_get_desc(unsigned i) -{ - const struct input_bind_map *keybind = - (const struct input_bind_map*)input_config_bind_map_get(i); - if (!keybind) - return NULL; - return msg_hash_to_str(keybind->desc); -} - -void input_config_parse_key(void *data, - const char *prefix, const char *btn, - struct retro_keybind *bind) -{ - char tmp[64]; - char key[64]; - config_file_t *conf = (config_file_t*)data; - - tmp[0] = key[0] = '\0'; - - fill_pathname_join_delim(key, prefix, btn, '_', sizeof(key)); - - if (config_get_array(conf, key, tmp, sizeof(tmp))) - bind->key = input_config_translate_str_to_rk(tmp); -} - -const char *input_config_get_prefix(unsigned user, bool meta) -{ - if (user == 0) - return meta ? "input" : bind_user_prefix[user]; - - if (user != 0 && !meta) - return bind_user_prefix[user]; - - /* Don't bother with meta bind for anyone else than first user. */ - return NULL; -} - -static enum retro_key find_rk_bind(const char *str) -{ - size_t i; - - for (i = 0; input_config_key_map[i].str; i++) - { - if (string_is_equal_noncase(input_config_key_map[i].str, str)) - return input_config_key_map[i].key; - } - - RARCH_WARN("Key name %s not found.\n", str); - return RETROK_UNKNOWN; -} - -/** - * input_config_translate_str_to_rk: - * @str : String to translate to key ID. - * - * Translates tring representation to key identifier. - * - * Returns: key identifier. - **/ -enum retro_key input_config_translate_str_to_rk(const char *str) -{ - if (strlen(str) == 1 && isalpha((int)*str)) - return (enum retro_key)(RETROK_a + (tolower((int)*str) - (int)'a')); - return find_rk_bind(str); -} - -/** - * input_config_translate_str_to_bind_id: - * @str : String to translate to bind ID. - * - * Translate string representation to bind ID. - * - * Returns: Bind ID value on success, otherwise - * RARCH_BIND_LIST_END on not found. - **/ -unsigned input_config_translate_str_to_bind_id(const char *str) -{ - unsigned i; - - for (i = 0; input_config_bind_map[i].valid; i++) - if (string_is_equal(str, input_config_bind_map[i].base)) - return i; - - return RARCH_BIND_LIST_END; -} - -static void parse_hat(struct retro_keybind *bind, const char *str) -{ - uint16_t hat; - uint16_t hat_dir = 0; - char *dir = NULL; - - if (!bind || !str || !isdigit((int)*str)) - return; - - hat = strtoul(str, &dir, 0); - - if (!dir) - { - RARCH_WARN("Found invalid hat in config!\n"); - return; - } - - if (string_is_equal_fast(dir, "up", 2)) - hat_dir = HAT_UP_MASK; - else if (string_is_equal_fast(dir, "down", 4)) - hat_dir = HAT_DOWN_MASK; - else if (string_is_equal_fast(dir, "left", 4)) - hat_dir = HAT_LEFT_MASK; - else if (string_is_equal_fast(dir, "right", 5)) - hat_dir = HAT_RIGHT_MASK; - - if (hat_dir) - bind->joykey = HAT_MAP(hat, hat_dir); -} - -void input_config_parse_joy_button(void *data, const char *prefix, - const char *btn, struct retro_keybind *bind) -{ - char str[256]; - char tmp[64]; - char key[64]; - char key_label[64]; - char *tmp_a = NULL; - config_file_t *conf = (config_file_t*)data; - - str[0] = tmp[0] = key[0] = key_label[0] = '\0'; - - fill_pathname_join_delim(str, prefix, btn, - '_', sizeof(str)); - fill_pathname_join_delim(key, str, - "btn", '_', sizeof(key)); - fill_pathname_join_delim(key_label, str, - "btn_label", '_', sizeof(key_label)); - - if (config_get_array(conf, key, tmp, sizeof(tmp))) - { - btn = tmp; - if (string_is_equal(btn, file_path_str(FILE_PATH_NUL))) - bind->joykey = NO_BTN; - else - { - if (*btn == 'h') - parse_hat(bind, btn + 1); - else - bind->joykey = strtoull(tmp, NULL, 0); - } - } - - if (config_get_string(conf, key_label, &tmp_a)) - { - strlcpy(bind->joykey_label, tmp_a, sizeof(bind->joykey_label)); - free(tmp_a); - } -} - -void input_config_parse_joy_axis(void *data, const char *prefix, - const char *axis, struct retro_keybind *bind) -{ - char str[256]; - char tmp[64]; - char key[64]; - char key_label[64]; - char *tmp_a = NULL; - config_file_t *conf = (config_file_t*)data; - - str[0] = tmp[0] = key[0] = key_label[0] = '\0'; - - fill_pathname_join_delim(str, prefix, axis, - '_', sizeof(str)); - fill_pathname_join_delim(key, str, - "axis", '_', sizeof(key)); - fill_pathname_join_delim(key_label, str, - "axis_label", '_', sizeof(key_label)); - - if (config_get_array(conf, key, tmp, sizeof(tmp))) - { - if (string_is_equal(tmp, file_path_str(FILE_PATH_NUL))) - bind->joyaxis = AXIS_NONE; - else if (strlen(tmp) >= 2 && (*tmp == '+' || *tmp == '-')) - { - int i_axis = (int)strtol(tmp + 1, NULL, 0); - if (*tmp == '+') - bind->joyaxis = AXIS_POS(i_axis); - else - bind->joyaxis = AXIS_NEG(i_axis); - } - - /* Ensure that D-pad emulation doesn't screw this over. */ - bind->orig_joyaxis = bind->joyaxis; - } - - if (config_get_string(conf, key_label, &tmp_a)) - { - strlcpy(bind->joyaxis_label, tmp_a, sizeof(bind->joyaxis_label)); - free(tmp_a); - } -} - -static void input_config_get_bind_string_joykey( - char *buf, const char *prefix, - const struct retro_keybind *bind, size_t size) -{ - settings_t *settings = config_get_ptr(); - bool label_show = settings->bools.input_descriptor_label_show; - - if (GET_HAT_DIR(bind->joykey)) - { - if (!string_is_empty(bind->joykey_label) && label_show) - snprintf(buf, size, "%s %s ", prefix, bind->joykey_label); - else - { - const char *dir = "?"; - - switch (GET_HAT_DIR(bind->joykey)) - { - case HAT_UP_MASK: - dir = "up"; - break; - case HAT_DOWN_MASK: - dir = "down"; - break; - case HAT_LEFT_MASK: - dir = "left"; - break; - case HAT_RIGHT_MASK: - dir = "right"; - break; - default: - break; - } - snprintf(buf, size, "%sHat #%u %s (%s)", prefix, - (unsigned)GET_HAT(bind->joykey), dir, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE)); - } - } - else - { - if (!string_is_empty(bind->joykey_label) && label_show) - snprintf(buf, size, "%s%s (btn) ", prefix, bind->joykey_label); - else - snprintf(buf, size, "%s%u (%s) ", prefix, (unsigned)bind->joykey, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE)); - } -} - -static void input_config_get_bind_string_joyaxis(char *buf, const char *prefix, - const struct retro_keybind *bind, size_t size) -{ - settings_t *settings = config_get_ptr(); - - if (!string_is_empty(bind->joyaxis_label) - && settings->bools.input_descriptor_label_show) - snprintf(buf, size, "%s%s (axis) ", prefix, bind->joyaxis_label); - else - { - unsigned axis = 0; - char dir = '\0'; - if (AXIS_NEG_GET(bind->joyaxis) != AXIS_DIR_NONE) - { - dir = '-'; - axis = AXIS_NEG_GET(bind->joyaxis); - } - else if (AXIS_POS_GET(bind->joyaxis) != AXIS_DIR_NONE) - { - dir = '+'; - axis = AXIS_POS_GET(bind->joyaxis); - } - snprintf(buf, size, "%s%c%u (%s) ", prefix, dir, axis, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE)); - } -} - -void input_config_get_bind_string(char *buf, const struct retro_keybind *bind, - const struct retro_keybind *auto_bind, size_t size) -{ -#ifndef RARCH_CONSOLE - char key[64]; - char keybuf[64]; - - key[0] = keybuf[0] = '\0'; -#endif - - *buf = '\0'; - if (bind->joykey != NO_BTN) - input_config_get_bind_string_joykey(buf, "", bind, size); - else if (bind->joyaxis != AXIS_NONE) - input_config_get_bind_string_joyaxis(buf, "", bind, size); - else if (auto_bind && auto_bind->joykey != NO_BTN) - input_config_get_bind_string_joykey(buf, "Auto: ", auto_bind, size); - else if (auto_bind && auto_bind->joyaxis != AXIS_NONE) - input_config_get_bind_string_joyaxis(buf, "Auto: ", auto_bind, size); - -#ifndef RARCH_CONSOLE - input_keymaps_translate_rk_to_str(bind->key, key, sizeof(key)); - if (string_is_equal(key, file_path_str(FILE_PATH_NUL))) - *key = '\0'; - - snprintf(keybuf, sizeof(keybuf), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_INPUT_KEY), key); - strlcat(buf, keybuf, size); -#endif -} - -const char *input_config_get_device_name(unsigned port) -{ - if (string_is_empty(input_device_names[port])) - return NULL; - return input_device_names[port]; -} - -void input_config_set_device_name(unsigned port, const char *name) -{ - if (!string_is_empty(name)) - { - strlcpy(input_device_names[port], - name, - sizeof(input_device_names[port])); - } -} - -void input_config_clear_device_name(unsigned port) -{ - input_device_names[port][0] = '\0'; -} - -unsigned *input_config_get_device_ptr(unsigned port) -{ - settings_t *settings = config_get_ptr(); - return &settings->uints.input_libretro_device[port]; -} - -unsigned input_config_get_device(unsigned port) -{ - settings_t *settings = config_get_ptr(); - return settings->uints.input_libretro_device[port]; -} - -void input_config_set_device(unsigned port, unsigned id) -{ - settings_t *settings = config_get_ptr(); - - if (settings) - settings->uints.input_libretro_device[port] = id; -} - -bool input_config_get_bind_idx(unsigned port, unsigned *joy_idx_real) -{ - settings_t *settings = config_get_ptr(); - unsigned joy_idx = settings->uints.input_joypad_map[port]; - - if (joy_idx >= MAX_USERS) - return false; - - *joy_idx_real = joy_idx; - return true; -} - -const struct retro_keybind *input_config_get_bind_auto(unsigned port, unsigned id) -{ - settings_t *settings = config_get_ptr(); - unsigned joy_idx = settings->uints.input_joypad_map[port]; - - if (joy_idx < MAX_USERS) - return &input_autoconf_binds[joy_idx][id]; - return NULL; -} - -void input_config_set_pid(unsigned port, unsigned pid) -{ - input_config_pid[port] = pid; -} - -int32_t input_config_get_pid(unsigned port) -{ - return input_config_pid[port]; -} - -void input_config_set_vid(unsigned port, unsigned vid) -{ - input_config_vid[port] = vid; -} - -int32_t input_config_get_vid(unsigned port) -{ - return input_config_vid[port]; -} - -void input_config_reset(void) -{ - unsigned i, j; - - retro_assert(sizeof(input_config_binds[0]) >= sizeof(retro_keybinds_1)); - retro_assert(sizeof(input_config_binds[1]) >= sizeof(retro_keybinds_rest)); - - memcpy(input_config_binds[0], retro_keybinds_1, sizeof(retro_keybinds_1)); - - for (i = 1; i < MAX_USERS; i++) - memcpy(input_config_binds[i], retro_keybinds_rest, - sizeof(retro_keybinds_rest)); - - for (i = 0; i < MAX_USERS; i++) - { - input_config_vid[i] = 0; - input_config_pid[i] = 0; - libretro_input_binds[i] = input_config_binds[i]; - - for (j = 0; j < 64; j++) - input_device_names[i][j] = 0; - } -} diff --git a/input/input_config.h b/input/input_config.h deleted file mode 100644 index 051ad77331..0000000000 --- a/input/input_config.h +++ /dev/null @@ -1,99 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2017 - Daniel De Matteis - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . - */ - -#ifndef INPUT_CONFIG_H__ -#define INPUT_CONFIG_H__ - -#include - -#include "input_driver.h" - -extern struct retro_keybind input_config_binds[MAX_USERS][RARCH_BIND_LIST_END]; -extern struct retro_keybind input_autoconf_binds[MAX_USERS][RARCH_BIND_LIST_END]; -extern const struct retro_keybind *libretro_input_binds[MAX_USERS]; -extern char input_device_names[MAX_USERS][64]; - -const char *input_config_bind_map_get_base(unsigned i); - -unsigned input_config_bind_map_get_meta(unsigned i); - -const char *input_config_bind_map_get_desc(unsigned i); - -bool input_config_bind_map_get_valid(unsigned i); - -/* auto_bind can be NULL. */ -void input_config_get_bind_string(char *buf, - const struct retro_keybind *bind, - const struct retro_keybind *auto_bind, size_t size); - -/** - * input_config_translate_str_to_rk: - * @str : String to translate to key ID. - * - * Translates tring representation to key identifier. - * - * Returns: key identifier. - **/ -enum retro_key input_config_translate_str_to_rk(const char *str); - -const char *input_config_get_prefix(unsigned user, bool meta); - -/** - * input_config_translate_str_to_bind_id: - * @str : String to translate to bind ID. - * - * Translate string representation to bind ID. - * - * Returns: Bind ID value on success, otherwise - * RARCH_BIND_LIST_END on not found. - **/ -unsigned input_config_translate_str_to_bind_id(const char *str); - -void input_config_parse_key(void *data, - const char *prefix, const char *btn, - struct retro_keybind *bind); - -void input_config_parse_joy_button(void *data, const char *prefix, - const char *btn, struct retro_keybind *bind); - -void input_config_parse_joy_axis(void *data, const char *prefix, - const char *axis, struct retro_keybind *bind); - -void input_config_set_device_name(unsigned port, const char *name); - -void input_config_clear_device_name(unsigned port); - -unsigned *input_config_get_device_ptr(unsigned port); - -unsigned input_config_get_device(unsigned port); - -void input_config_set_device(unsigned port, unsigned id); - -const char *input_config_get_device_name(unsigned port); - -const struct retro_keybind *input_config_get_bind_auto(unsigned port, unsigned id); - -void input_config_set_pid(unsigned port, unsigned pid); - -int32_t input_config_get_pid(unsigned port); - -void input_config_set_vid(unsigned port, unsigned vid); - -int32_t input_config_get_vid(unsigned port); - -void input_config_reset(void); - -#endif diff --git a/input/input_driver.c b/input/input_driver.c index 68e2f4a9a1..c7643b3e5b 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -18,9 +18,14 @@ #include #include +#include +#include +#include #include #include +#include + #ifdef HAVE_CONFIG_H #include "../config.h" #endif @@ -30,16 +35,20 @@ #endif #include "input_driver.h" -#include "input_config.h" +#include "input_keymaps.h" #include "input_remapping.h" +#include "../config.def.keybinds.h" + #ifdef HAVE_MENU #include "../menu/menu_driver.h" #include "../menu/menu_input.h" #include "../menu/widgets/menu_input_dialog.h" #endif +#include "../msg_hash.h" #include "../configuration.h" +#include "../file_path_special.h" #include "../driver.h" #include "../retroarch.h" #include "../movie.h" @@ -183,6 +192,120 @@ static hid_driver_t *hid_drivers[] = { }; #endif +/* Input config. */ +struct input_bind_map +{ + bool valid; + + /* Meta binds get input as prefix, not input_playerN". + * 0 = libretro related. + * 1 = Common hotkey. + * 2 = Uncommon/obscure hotkey. + */ + unsigned meta; + + const char *base; + enum msg_hash_enums desc; + unsigned retro_key; +}; + +static const char *bind_user_prefix[MAX_USERS] = { + "input_player1", + "input_player2", + "input_player3", + "input_player4", + "input_player5", + "input_player6", + "input_player7", + "input_player8", + "input_player9", + "input_player10", + "input_player11", + "input_player12", + "input_player13", + "input_player14", + "input_player15", + "input_player16", +}; + +static int input_config_vid[MAX_USERS]; +static int input_config_pid[MAX_USERS]; + +char input_device_names[MAX_USERS][64]; +struct retro_keybind input_config_binds[MAX_USERS][RARCH_BIND_LIST_END]; +struct retro_keybind input_autoconf_binds[MAX_USERS][RARCH_BIND_LIST_END]; +const struct retro_keybind *libretro_input_binds[MAX_USERS]; + +#define DECLARE_BIND(x, bind, desc) { true, 0, #x, desc, bind } +#define DECLARE_META_BIND(level, x, bind, desc) { true, level, #x, desc, bind } + +const struct input_bind_map input_config_bind_map[RARCH_BIND_LIST_END_NULL] = { + DECLARE_BIND(b, RETRO_DEVICE_ID_JOYPAD_B, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B), + DECLARE_BIND(y, RETRO_DEVICE_ID_JOYPAD_Y, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_Y), + DECLARE_BIND(select, RETRO_DEVICE_ID_JOYPAD_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_SELECT), + DECLARE_BIND(start, RETRO_DEVICE_ID_JOYPAD_START, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_START), + DECLARE_BIND(up, RETRO_DEVICE_ID_JOYPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_UP), + DECLARE_BIND(down, RETRO_DEVICE_ID_JOYPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_DOWN), + DECLARE_BIND(left, RETRO_DEVICE_ID_JOYPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LEFT), + DECLARE_BIND(right, RETRO_DEVICE_ID_JOYPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_RIGHT), + DECLARE_BIND(a, RETRO_DEVICE_ID_JOYPAD_A, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_A), + DECLARE_BIND(x, RETRO_DEVICE_ID_JOYPAD_X, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_X), + DECLARE_BIND(l, RETRO_DEVICE_ID_JOYPAD_L, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L), + DECLARE_BIND(r, RETRO_DEVICE_ID_JOYPAD_R, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R), + DECLARE_BIND(l2, RETRO_DEVICE_ID_JOYPAD_L2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L2), + DECLARE_BIND(r2, RETRO_DEVICE_ID_JOYPAD_R2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R2), + DECLARE_BIND(l3, RETRO_DEVICE_ID_JOYPAD_L3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L3), + DECLARE_BIND(r3, RETRO_DEVICE_ID_JOYPAD_R3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R3), + DECLARE_BIND(l_x_plus, RARCH_ANALOG_LEFT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_PLUS), + DECLARE_BIND(l_x_minus, RARCH_ANALOG_LEFT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_MINUS), + DECLARE_BIND(l_y_plus, RARCH_ANALOG_LEFT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_PLUS), + DECLARE_BIND(l_y_minus, RARCH_ANALOG_LEFT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_MINUS), + DECLARE_BIND(r_x_plus, RARCH_ANALOG_RIGHT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_PLUS), + DECLARE_BIND(r_x_minus, RARCH_ANALOG_RIGHT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_MINUS), + DECLARE_BIND(r_y_plus, RARCH_ANALOG_RIGHT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_PLUS), + DECLARE_BIND(r_y_minus, RARCH_ANALOG_RIGHT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_MINUS), + + DECLARE_BIND(turbo, RARCH_TURBO_ENABLE, MENU_ENUM_LABEL_VALUE_INPUT_TURBO_ENABLE), + + DECLARE_META_BIND(1, toggle_fast_forward, RARCH_FAST_FORWARD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_KEY), + DECLARE_META_BIND(2, hold_fast_forward, RARCH_FAST_FORWARD_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_HOLD_KEY), + DECLARE_META_BIND(1, load_state, RARCH_LOAD_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_LOAD_STATE_KEY), + DECLARE_META_BIND(1, save_state, RARCH_SAVE_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SAVE_STATE_KEY), + DECLARE_META_BIND(2, toggle_fullscreen, RARCH_FULLSCREEN_TOGGLE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FULLSCREEN_TOGGLE_KEY), + DECLARE_META_BIND(2, exit_emulator, RARCH_QUIT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_QUIT_KEY), + DECLARE_META_BIND(2, state_slot_increase, RARCH_STATE_SLOT_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_PLUS), + DECLARE_META_BIND(2, state_slot_decrease, RARCH_STATE_SLOT_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_MINUS), + DECLARE_META_BIND(1, rewind, RARCH_REWIND, MENU_ENUM_LABEL_VALUE_INPUT_META_REWIND), + DECLARE_META_BIND(2, movie_record_toggle, RARCH_MOVIE_RECORD_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_MOVIE_RECORD_TOGGLE), + DECLARE_META_BIND(2, pause_toggle, RARCH_PAUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_PAUSE_TOGGLE), + DECLARE_META_BIND(2, frame_advance, RARCH_FRAMEADVANCE, MENU_ENUM_LABEL_VALUE_INPUT_META_FRAMEADVANCE), + DECLARE_META_BIND(2, reset, RARCH_RESET, MENU_ENUM_LABEL_VALUE_INPUT_META_RESET), + DECLARE_META_BIND(2, shader_next, RARCH_SHADER_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_NEXT), + DECLARE_META_BIND(2, shader_prev, RARCH_SHADER_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_PREV), + DECLARE_META_BIND(2, cheat_index_plus, RARCH_CHEAT_INDEX_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_PLUS), + DECLARE_META_BIND(2, cheat_index_minus, RARCH_CHEAT_INDEX_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_MINUS), + DECLARE_META_BIND(2, cheat_toggle, RARCH_CHEAT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_TOGGLE), + DECLARE_META_BIND(2, screenshot, RARCH_SCREENSHOT, MENU_ENUM_LABEL_VALUE_INPUT_META_SCREENSHOT), + DECLARE_META_BIND(2, audio_mute, RARCH_MUTE, MENU_ENUM_LABEL_VALUE_INPUT_META_MUTE), + DECLARE_META_BIND(2, osk_toggle, RARCH_OSK, MENU_ENUM_LABEL_VALUE_INPUT_META_OSK), + DECLARE_META_BIND(2, netplay_flip_players_1_2, RARCH_NETPLAY_FLIP, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_FLIP), + DECLARE_META_BIND(2, netplay_game_watch, RARCH_NETPLAY_GAME_WATCH, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_GAME_WATCH), + DECLARE_META_BIND(2, slowmotion, RARCH_SLOWMOTION, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION), + DECLARE_META_BIND(2, enable_hotkey, RARCH_ENABLE_HOTKEY, MENU_ENUM_LABEL_VALUE_INPUT_META_ENABLE_HOTKEY), + DECLARE_META_BIND(2, volume_up, RARCH_VOLUME_UP, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_UP), + DECLARE_META_BIND(2, volume_down, RARCH_VOLUME_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_DOWN), + DECLARE_META_BIND(2, overlay_next, RARCH_OVERLAY_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_OVERLAY_NEXT), + DECLARE_META_BIND(2, disk_eject_toggle, RARCH_DISK_EJECT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_EJECT_TOGGLE), + DECLARE_META_BIND(2, disk_next, RARCH_DISK_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_NEXT), + DECLARE_META_BIND(2, disk_prev, RARCH_DISK_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_PREV), + DECLARE_META_BIND(2, grab_mouse_toggle, RARCH_GRAB_MOUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GRAB_MOUSE_TOGGLE), + DECLARE_META_BIND(2, game_focus_toggle, RARCH_GAME_FOCUS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GAME_FOCUS_TOGGLE), +#ifdef HAVE_MENU + DECLARE_META_BIND(1, menu_toggle, RARCH_MENU_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_MENU_TOGGLE), +#endif +}; + + typedef struct turbo_buttons turbo_buttons_t; /* Turbo support. */ @@ -1965,3 +2088,446 @@ bool input_keyboard_ctl(enum rarch_input_keyboard_ctl_state state, void *data) return true; } + +static const void *input_config_bind_map_get(unsigned i) +{ + return (const struct input_bind_map*)&input_config_bind_map[i]; +} + +bool input_config_bind_map_get_valid(unsigned i) +{ + const struct input_bind_map *keybind = + (const struct input_bind_map*)input_config_bind_map_get(i); + if (!keybind) + return false; + return keybind->valid; +} + +unsigned input_config_bind_map_get_meta(unsigned i) +{ + const struct input_bind_map *keybind = + (const struct input_bind_map*)input_config_bind_map_get(i); + if (!keybind) + return 0; + return keybind->meta; +} + +const char *input_config_bind_map_get_base(unsigned i) +{ + const struct input_bind_map *keybind = + (const struct input_bind_map*)input_config_bind_map_get(i); + if (!keybind) + return NULL; + return keybind->base; +} + +const char *input_config_bind_map_get_desc(unsigned i) +{ + const struct input_bind_map *keybind = + (const struct input_bind_map*)input_config_bind_map_get(i); + if (!keybind) + return NULL; + return msg_hash_to_str(keybind->desc); +} + +void input_config_parse_key(void *data, + const char *prefix, const char *btn, + struct retro_keybind *bind) +{ + char tmp[64]; + char key[64]; + config_file_t *conf = (config_file_t*)data; + + tmp[0] = key[0] = '\0'; + + fill_pathname_join_delim(key, prefix, btn, '_', sizeof(key)); + + if (config_get_array(conf, key, tmp, sizeof(tmp))) + bind->key = input_config_translate_str_to_rk(tmp); +} + +const char *input_config_get_prefix(unsigned user, bool meta) +{ + if (user == 0) + return meta ? "input" : bind_user_prefix[user]; + + if (user != 0 && !meta) + return bind_user_prefix[user]; + + /* Don't bother with meta bind for anyone else than first user. */ + return NULL; +} + +static enum retro_key find_rk_bind(const char *str) +{ + size_t i; + + for (i = 0; input_config_key_map[i].str; i++) + { + if (string_is_equal_noncase(input_config_key_map[i].str, str)) + return input_config_key_map[i].key; + } + + RARCH_WARN("Key name %s not found.\n", str); + return RETROK_UNKNOWN; +} + +/** + * input_config_translate_str_to_rk: + * @str : String to translate to key ID. + * + * Translates tring representation to key identifier. + * + * Returns: key identifier. + **/ +enum retro_key input_config_translate_str_to_rk(const char *str) +{ + if (strlen(str) == 1 && isalpha((int)*str)) + return (enum retro_key)(RETROK_a + (tolower((int)*str) - (int)'a')); + return find_rk_bind(str); +} + +/** + * input_config_translate_str_to_bind_id: + * @str : String to translate to bind ID. + * + * Translate string representation to bind ID. + * + * Returns: Bind ID value on success, otherwise + * RARCH_BIND_LIST_END on not found. + **/ +unsigned input_config_translate_str_to_bind_id(const char *str) +{ + unsigned i; + + for (i = 0; input_config_bind_map[i].valid; i++) + if (string_is_equal(str, input_config_bind_map[i].base)) + return i; + + return RARCH_BIND_LIST_END; +} + +static void parse_hat(struct retro_keybind *bind, const char *str) +{ + uint16_t hat; + uint16_t hat_dir = 0; + char *dir = NULL; + + if (!bind || !str || !isdigit((int)*str)) + return; + + hat = strtoul(str, &dir, 0); + + if (!dir) + { + RARCH_WARN("Found invalid hat in config!\n"); + return; + } + + if (string_is_equal_fast(dir, "up", 2)) + hat_dir = HAT_UP_MASK; + else if (string_is_equal_fast(dir, "down", 4)) + hat_dir = HAT_DOWN_MASK; + else if (string_is_equal_fast(dir, "left", 4)) + hat_dir = HAT_LEFT_MASK; + else if (string_is_equal_fast(dir, "right", 5)) + hat_dir = HAT_RIGHT_MASK; + + if (hat_dir) + bind->joykey = HAT_MAP(hat, hat_dir); +} + +void input_config_parse_joy_button(void *data, const char *prefix, + const char *btn, struct retro_keybind *bind) +{ + char str[256]; + char tmp[64]; + char key[64]; + char key_label[64]; + char *tmp_a = NULL; + config_file_t *conf = (config_file_t*)data; + + str[0] = tmp[0] = key[0] = key_label[0] = '\0'; + + fill_pathname_join_delim(str, prefix, btn, + '_', sizeof(str)); + fill_pathname_join_delim(key, str, + "btn", '_', sizeof(key)); + fill_pathname_join_delim(key_label, str, + "btn_label", '_', sizeof(key_label)); + + if (config_get_array(conf, key, tmp, sizeof(tmp))) + { + btn = tmp; + if (string_is_equal(btn, file_path_str(FILE_PATH_NUL))) + bind->joykey = NO_BTN; + else + { + if (*btn == 'h') + parse_hat(bind, btn + 1); + else + bind->joykey = strtoull(tmp, NULL, 0); + } + } + + if (config_get_string(conf, key_label, &tmp_a)) + { + strlcpy(bind->joykey_label, tmp_a, sizeof(bind->joykey_label)); + free(tmp_a); + } +} + +void input_config_parse_joy_axis(void *data, const char *prefix, + const char *axis, struct retro_keybind *bind) +{ + char str[256]; + char tmp[64]; + char key[64]; + char key_label[64]; + char *tmp_a = NULL; + config_file_t *conf = (config_file_t*)data; + + str[0] = tmp[0] = key[0] = key_label[0] = '\0'; + + fill_pathname_join_delim(str, prefix, axis, + '_', sizeof(str)); + fill_pathname_join_delim(key, str, + "axis", '_', sizeof(key)); + fill_pathname_join_delim(key_label, str, + "axis_label", '_', sizeof(key_label)); + + if (config_get_array(conf, key, tmp, sizeof(tmp))) + { + if (string_is_equal(tmp, file_path_str(FILE_PATH_NUL))) + bind->joyaxis = AXIS_NONE; + else if (strlen(tmp) >= 2 && (*tmp == '+' || *tmp == '-')) + { + int i_axis = (int)strtol(tmp + 1, NULL, 0); + if (*tmp == '+') + bind->joyaxis = AXIS_POS(i_axis); + else + bind->joyaxis = AXIS_NEG(i_axis); + } + + /* Ensure that D-pad emulation doesn't screw this over. */ + bind->orig_joyaxis = bind->joyaxis; + } + + if (config_get_string(conf, key_label, &tmp_a)) + { + strlcpy(bind->joyaxis_label, tmp_a, sizeof(bind->joyaxis_label)); + free(tmp_a); + } +} + +static void input_config_get_bind_string_joykey( + char *buf, const char *prefix, + const struct retro_keybind *bind, size_t size) +{ + settings_t *settings = config_get_ptr(); + bool label_show = settings->bools.input_descriptor_label_show; + + if (GET_HAT_DIR(bind->joykey)) + { + if (!string_is_empty(bind->joykey_label) && label_show) + snprintf(buf, size, "%s %s ", prefix, bind->joykey_label); + else + { + const char *dir = "?"; + + switch (GET_HAT_DIR(bind->joykey)) + { + case HAT_UP_MASK: + dir = "up"; + break; + case HAT_DOWN_MASK: + dir = "down"; + break; + case HAT_LEFT_MASK: + dir = "left"; + break; + case HAT_RIGHT_MASK: + dir = "right"; + break; + default: + break; + } + snprintf(buf, size, "%sHat #%u %s (%s)", prefix, + (unsigned)GET_HAT(bind->joykey), dir, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE)); + } + } + else + { + if (!string_is_empty(bind->joykey_label) && label_show) + snprintf(buf, size, "%s%s (btn) ", prefix, bind->joykey_label); + else + snprintf(buf, size, "%s%u (%s) ", prefix, (unsigned)bind->joykey, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE)); + } +} + +static void input_config_get_bind_string_joyaxis(char *buf, const char *prefix, + const struct retro_keybind *bind, size_t size) +{ + settings_t *settings = config_get_ptr(); + + if (!string_is_empty(bind->joyaxis_label) + && settings->bools.input_descriptor_label_show) + snprintf(buf, size, "%s%s (axis) ", prefix, bind->joyaxis_label); + else + { + unsigned axis = 0; + char dir = '\0'; + if (AXIS_NEG_GET(bind->joyaxis) != AXIS_DIR_NONE) + { + dir = '-'; + axis = AXIS_NEG_GET(bind->joyaxis); + } + else if (AXIS_POS_GET(bind->joyaxis) != AXIS_DIR_NONE) + { + dir = '+'; + axis = AXIS_POS_GET(bind->joyaxis); + } + snprintf(buf, size, "%s%c%u (%s) ", prefix, dir, axis, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE)); + } +} + +void input_config_get_bind_string(char *buf, const struct retro_keybind *bind, + const struct retro_keybind *auto_bind, size_t size) +{ +#ifndef RARCH_CONSOLE + char key[64]; + char keybuf[64]; + + key[0] = keybuf[0] = '\0'; +#endif + + *buf = '\0'; + if (bind->joykey != NO_BTN) + input_config_get_bind_string_joykey(buf, "", bind, size); + else if (bind->joyaxis != AXIS_NONE) + input_config_get_bind_string_joyaxis(buf, "", bind, size); + else if (auto_bind && auto_bind->joykey != NO_BTN) + input_config_get_bind_string_joykey(buf, "Auto: ", auto_bind, size); + else if (auto_bind && auto_bind->joyaxis != AXIS_NONE) + input_config_get_bind_string_joyaxis(buf, "Auto: ", auto_bind, size); + +#ifndef RARCH_CONSOLE + input_keymaps_translate_rk_to_str(bind->key, key, sizeof(key)); + if (string_is_equal(key, file_path_str(FILE_PATH_NUL))) + *key = '\0'; + + snprintf(keybuf, sizeof(keybuf), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_INPUT_KEY), key); + strlcat(buf, keybuf, size); +#endif +} + +const char *input_config_get_device_name(unsigned port) +{ + if (string_is_empty(input_device_names[port])) + return NULL; + return input_device_names[port]; +} + +void input_config_set_device_name(unsigned port, const char *name) +{ + if (!string_is_empty(name)) + { + strlcpy(input_device_names[port], + name, + sizeof(input_device_names[port])); + } +} + +void input_config_clear_device_name(unsigned port) +{ + input_device_names[port][0] = '\0'; +} + +unsigned *input_config_get_device_ptr(unsigned port) +{ + settings_t *settings = config_get_ptr(); + return &settings->uints.input_libretro_device[port]; +} + +unsigned input_config_get_device(unsigned port) +{ + settings_t *settings = config_get_ptr(); + return settings->uints.input_libretro_device[port]; +} + +void input_config_set_device(unsigned port, unsigned id) +{ + settings_t *settings = config_get_ptr(); + + if (settings) + settings->uints.input_libretro_device[port] = id; +} + +bool input_config_get_bind_idx(unsigned port, unsigned *joy_idx_real) +{ + settings_t *settings = config_get_ptr(); + unsigned joy_idx = settings->uints.input_joypad_map[port]; + + if (joy_idx >= MAX_USERS) + return false; + + *joy_idx_real = joy_idx; + return true; +} + +const struct retro_keybind *input_config_get_bind_auto(unsigned port, unsigned id) +{ + settings_t *settings = config_get_ptr(); + unsigned joy_idx = settings->uints.input_joypad_map[port]; + + if (joy_idx < MAX_USERS) + return &input_autoconf_binds[joy_idx][id]; + return NULL; +} + +void input_config_set_pid(unsigned port, unsigned pid) +{ + input_config_pid[port] = pid; +} + +int32_t input_config_get_pid(unsigned port) +{ + return input_config_pid[port]; +} + +void input_config_set_vid(unsigned port, unsigned vid) +{ + input_config_vid[port] = vid; +} + +int32_t input_config_get_vid(unsigned port) +{ + return input_config_vid[port]; +} + +void input_config_reset(void) +{ + unsigned i, j; + + retro_assert(sizeof(input_config_binds[0]) >= sizeof(retro_keybinds_1)); + retro_assert(sizeof(input_config_binds[1]) >= sizeof(retro_keybinds_rest)); + + memcpy(input_config_binds[0], retro_keybinds_1, sizeof(retro_keybinds_1)); + + for (i = 1; i < MAX_USERS; i++) + memcpy(input_config_binds[i], retro_keybinds_rest, + sizeof(retro_keybinds_rest)); + + for (i = 0; i < MAX_USERS; i++) + { + input_config_vid[i] = 0; + input_config_pid[i] = 0; + libretro_input_binds[i] = input_config_binds[i]; + + for (j = 0; j < 64; j++) + input_device_names[i][j] = 0; + } +} diff --git a/input/input_driver.h b/input/input_driver.h index 7b38221954..91ddd9355f 100644 --- a/input/input_driver.h +++ b/input/input_driver.h @@ -682,6 +682,81 @@ const char **input_keyboard_start_line(void *userdata, bool input_keyboard_ctl(enum rarch_input_keyboard_ctl_state state, void *data); +extern struct retro_keybind input_config_binds[MAX_USERS][RARCH_BIND_LIST_END]; +extern struct retro_keybind input_autoconf_binds[MAX_USERS][RARCH_BIND_LIST_END]; +extern const struct retro_keybind *libretro_input_binds[MAX_USERS]; +extern char input_device_names[MAX_USERS][64]; + +const char *input_config_bind_map_get_base(unsigned i); + +unsigned input_config_bind_map_get_meta(unsigned i); + +const char *input_config_bind_map_get_desc(unsigned i); + +bool input_config_bind_map_get_valid(unsigned i); + +/* auto_bind can be NULL. */ +void input_config_get_bind_string(char *buf, + const struct retro_keybind *bind, + const struct retro_keybind *auto_bind, size_t size); + +/** + * input_config_translate_str_to_rk: + * @str : String to translate to key ID. + * + * Translates tring representation to key identifier. + * + * Returns: key identifier. + **/ +enum retro_key input_config_translate_str_to_rk(const char *str); + +const char *input_config_get_prefix(unsigned user, bool meta); + +/** + * input_config_translate_str_to_bind_id: + * @str : String to translate to bind ID. + * + * Translate string representation to bind ID. + * + * Returns: Bind ID value on success, otherwise + * RARCH_BIND_LIST_END on not found. + **/ +unsigned input_config_translate_str_to_bind_id(const char *str); + +void input_config_parse_key(void *data, + const char *prefix, const char *btn, + struct retro_keybind *bind); + +void input_config_parse_joy_button(void *data, const char *prefix, + const char *btn, struct retro_keybind *bind); + +void input_config_parse_joy_axis(void *data, const char *prefix, + const char *axis, struct retro_keybind *bind); + +void input_config_set_device_name(unsigned port, const char *name); + +void input_config_clear_device_name(unsigned port); + +unsigned *input_config_get_device_ptr(unsigned port); + +unsigned input_config_get_device(unsigned port); + +void input_config_set_device(unsigned port, unsigned id); + +const char *input_config_get_device_name(unsigned port); + +const struct retro_keybind *input_config_get_bind_auto(unsigned port, unsigned id); + +void input_config_set_pid(unsigned port, unsigned pid); + +int32_t input_config_get_pid(unsigned port); + +void input_config_set_vid(unsigned port, unsigned vid); + +int32_t input_config_get_vid(unsigned port); + +void input_config_reset(void); + extern input_device_driver_t dinput_joypad; extern input_device_driver_t linuxraw_joypad; extern input_device_driver_t parport_joypad; diff --git a/input/input_remapping.c b/input/input_remapping.c index 6ca86e7270..e1fd314259 100644 --- a/input/input_remapping.c +++ b/input/input_remapping.c @@ -19,7 +19,7 @@ #include #include -#include "input_config.h" +#include "input_driver.h" #include "input_remapping.h" #include "../configuration.h" #include "../retroarch.h" diff --git a/menu/cbs/menu_cbs_get_value.c b/menu/cbs/menu_cbs_get_value.c index bbf7d7651b..ac9b76e4c0 100644 --- a/menu/cbs/menu_cbs_get_value.c +++ b/menu/cbs/menu_cbs_get_value.c @@ -28,7 +28,7 @@ #include "../menu_shader.h" #include "../../tasks/tasks_internal.h" -#include "../../input/input_config.h" +#include "../../input/input_driver.h" #include "../../core.h" #include "../../core_info.h" diff --git a/menu/cbs/menu_cbs_scan.c b/menu/cbs/menu_cbs_scan.c index 244dcc7394..e6021d4f89 100644 --- a/menu/cbs/menu_cbs_scan.c +++ b/menu/cbs/menu_cbs_scan.c @@ -25,7 +25,7 @@ #include "../menu_cbs.h" #include "../menu_setting.h" -#include "../../input/input_config.h" +#include "../../input/input_driver.h" #include "../../configuration.h" #include "../../tasks/tasks_internal.h" diff --git a/menu/cbs/menu_cbs_start.c b/menu/cbs/menu_cbs_start.c index 68cbed8a70..e6225eec3b 100644 --- a/menu/cbs/menu_cbs_start.c +++ b/menu/cbs/menu_cbs_start.c @@ -37,7 +37,7 @@ #include "../../gfx/video_driver.h" -#include "../../input/input_config.h" +#include "../../input/input_driver.h" #include "../../input/input_remapping.h" #ifndef BIND_ACTION_START diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 9a29b03239..fcd2a38541 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -72,7 +72,7 @@ #include "../gfx/video_driver.h" #include "../config.features.h" #include "../version_git.h" -#include "../input/input_config.h" +#include "../input/input_driver.h" #include "../list_special.h" #include "../performance_counters.h" #include "../core_info.h" diff --git a/menu/menu_setting.c b/menu/menu_setting.c index d41698c3ab..0f9ee3b227 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -71,7 +71,7 @@ #include "../location/location_driver.h" #include "../record/record_driver.h" #include "../audio/audio_driver.h" -#include "../input/input_config.h" +#include "../input/input_driver.h" #include "../tasks/tasks_internal.h" #include "../config.def.h" #include "../ui/ui_companion_driver.h" diff --git a/menu/widgets/menu_dialog.c b/menu/widgets/menu_dialog.c index f4e7549283..b3f078bcad 100644 --- a/menu/widgets/menu_dialog.c +++ b/menu/widgets/menu_dialog.c @@ -33,7 +33,7 @@ #include "../../configuration.h" #include "../../tasks/tasks_internal.h" -#include "../../input/input_config.h" +#include "../../input/input_driver.h" #include "../../performance_counters.h" static bool menu_dialog_pending_push = false; diff --git a/menu/widgets/menu_input_bind_dialog.c b/menu/widgets/menu_input_bind_dialog.c index be900689b6..9da3367292 100644 --- a/menu/widgets/menu_input_bind_dialog.c +++ b/menu/widgets/menu_input_bind_dialog.c @@ -23,7 +23,6 @@ #include "../menu_driver.h" #include "../../input/input_driver.h" -#include "../../input/input_config.h" #include "../../configuration.h" #include "../../performance_counters.h" diff --git a/network/netplay/netplay_handshake.c b/network/netplay/netplay_handshake.c index 36a2b8ec6f..e6e22e77c6 100644 --- a/network/netplay/netplay_handshake.c +++ b/network/netplay/netplay_handshake.c @@ -35,7 +35,7 @@ #include "../../content.h" #include "../../retroarch.h" #include "../../version.h" -#include "../../input/input_config.h" +#include "../../input/input_driver.h" #ifdef HAVE_MENU #include "../../menu/widgets/menu_input_dialog.h" diff --git a/retroarch.c b/retroarch.c index 273876455f..9300fb2eb0 100644 --- a/retroarch.c +++ b/retroarch.c @@ -90,7 +90,6 @@ #include "dynamic.h" #include "driver.h" #include "input/input_driver.h" -#include "input/input_config.h" #include "msg_hash.h" #include "movie.h" #include "dirs.h" diff --git a/setting_list.c b/setting_list.c index c2b4829009..3d626af078 100644 --- a/setting_list.c +++ b/setting_list.c @@ -34,7 +34,6 @@ #include "configuration.h" #include "config.def.h" -#include "input/input_config.h" #include "setting_list.h" rarch_setting_t setting_terminator_setting(void) diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index b43bf8e87e..d7c820c133 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -24,7 +24,7 @@ #include #include -#include "../input/input_config.h" +#include "../input/input_driver.h" #include "../configuration.h" #include "../file_path_special.h" diff --git a/tasks/task_overlay.c b/tasks/task_overlay.c index 0f43e7ffae..5d84911278 100644 --- a/tasks/task_overlay.c +++ b/tasks/task_overlay.c @@ -28,7 +28,7 @@ #include "../file_path_special.h" #include "../gfx/video_driver.h" -#include "../input/input_config.h" +#include "../input/input_driver.h" #include "../input/input_overlay.h" #include "../configuration.h" #include "../verbosity.h"