1 /* RetroArch - A frontend for libretro. 2 * Copyright (C) 2010-2014 - Hans-Kristian Arntzen 3 * Copyright (C) 2011-2020 - Daniel De Matteis 4 * 5 * RetroArch is free software: you can redistribute it and/or modify it under the terms 6 * of the GNU General Public License as published by the Free Software Found- 7 * ation, either version 3 of the License, or (at your option) any later version. 8 * 9 * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 10 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 11 * PURPOSE. See the GNU General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public License along with RetroArch. 14 * If not, see <http://www.gnu.org/licenses/>. 15 */ 16 17 #include <stdlib.h> 18 #include <stddef.h> 19 #include <string.h> 20 #include <windowsx.h> 21 22 #include <dinput.h> 23 #include <mmsystem.h> 24 25 #include <boolean.h> 26 #include <compat/strl.h> 27 #include <string/stdstring.h> 28 29 #ifdef HAVE_CONFIG_H 30 #include "../../config.h" 31 #endif 32 33 #include "../../tasks/tasks_internal.h" 34 #include "../input_keymaps.h" 35 #include "../../retroarch.h" 36 #include "../../verbosity.h" 37 #include "dinput_joypad.h" 38 39 /* TODO/FIXME - globals referenced outside */ 40 struct dinput_joypad_data g_pads[MAX_USERS]; 41 unsigned g_joypad_cnt; 42 43 /* TODO/FIXME - forward declaration */ 44 extern LPDIRECTINPUT8 g_dinput_ctx; 45 46 #include "dinput_joypad_inl.h" 47 #include "dinput_joypad_excl.h" 48 49 input_device_driver_t dinput_joypad = { 50 dinput_joypad_init, 51 dinput_joypad_query_pad, 52 dinput_joypad_destroy, 53 dinput_joypad_button, 54 dinput_joypad_state, 55 NULL, 56 dinput_joypad_axis, 57 dinput_joypad_poll, 58 dinput_joypad_set_rumble, 59 dinput_joypad_name, 60 "dinput", 61 }; 62