2015-04-08 01:58:09 +02:00
|
|
|
/* RetroArch - A frontend for libretro.
|
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
2020-08-30 18:59:57 +02:00
|
|
|
* Copyright (C) 2011-2020 - Daniel De Matteis
|
2017-12-11 23:55:31 -08:00
|
|
|
*
|
2015-04-08 01:58:09 +02:00
|
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2015-06-30 00:38:10 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <windowsx.h>
|
|
|
|
|
2015-09-05 20:49:57 +02:00
|
|
|
#include <dinput.h>
|
2019-07-23 19:40:22 +02:00
|
|
|
#include <mmsystem.h>
|
2015-09-05 20:49:57 +02:00
|
|
|
|
2015-04-08 01:58:09 +02:00
|
|
|
#include <boolean.h>
|
2016-09-11 15:08:07 +02:00
|
|
|
#include <compat/strl.h>
|
2017-05-16 04:00:37 +02:00
|
|
|
#include <string/stdstring.h>
|
2015-06-30 00:38:10 +02:00
|
|
|
|
2016-09-11 14:59:18 +02:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "../../config.h"
|
|
|
|
#endif
|
|
|
|
|
2016-12-01 20:38:20 +01:00
|
|
|
#include "../../tasks/tasks_internal.h"
|
2015-04-08 01:58:09 +02:00
|
|
|
#include "../input_keymaps.h"
|
2019-06-17 15:10:22 +02:00
|
|
|
#include "../../retroarch.h"
|
2016-09-11 14:59:18 +02:00
|
|
|
#include "../../verbosity.h"
|
2017-12-06 04:33:54 +01:00
|
|
|
#include "dinput_joypad.h"
|
2015-04-08 01:58:09 +02:00
|
|
|
|
2020-08-03 17:31:22 +02:00
|
|
|
/* TODO/FIXME - globals referenced outside */
|
2020-07-31 19:30:03 +02:00
|
|
|
struct dinput_joypad_data g_pads[MAX_USERS];
|
|
|
|
unsigned g_joypad_cnt;
|
2015-04-08 01:58:09 +02:00
|
|
|
|
2020-07-31 19:30:03 +02:00
|
|
|
/* TODO/FIXME - forward declaration */
|
2020-07-31 18:15:36 +02:00
|
|
|
extern LPDIRECTINPUT8 g_dinput_ctx;
|
|
|
|
|
2020-07-31 18:48:45 +02:00
|
|
|
#include "dinput_joypad_inl.h"
|
2020-08-30 06:53:16 +02:00
|
|
|
#include "dinput_joypad_excl.h"
|
2015-04-08 01:58:09 +02:00
|
|
|
|
2015-04-14 16:37:59 +02:00
|
|
|
input_device_driver_t dinput_joypad = {
|
2015-04-08 01:58:09 +02:00
|
|
|
dinput_joypad_init,
|
|
|
|
dinput_joypad_query_pad,
|
|
|
|
dinput_joypad_destroy,
|
|
|
|
dinput_joypad_button,
|
2020-07-19 03:18:12 +02:00
|
|
|
dinput_joypad_state,
|
2015-04-08 01:58:09 +02:00
|
|
|
NULL,
|
|
|
|
dinput_joypad_axis,
|
|
|
|
dinput_joypad_poll,
|
2018-07-05 20:01:23 +02:00
|
|
|
dinput_joypad_set_rumble,
|
2015-04-08 01:58:09 +02:00
|
|
|
dinput_joypad_name,
|
|
|
|
"dinput",
|
|
|
|
};
|