Commit Graph

338 Commits

Author SHA1 Message Date
twinaphex b1af12efc9 Add more PSL1GHT ifdefs 2020-12-27 18:56:00 +01:00
twinaphex 870707dbe8 Remove obsolete __CELLOS_LV2__ references - use PSL1GHT instead 2020-12-19 15:32:26 +01:00
Tony Jansson 278ddc64ed Add hold mode for turbo fire 'Single Button' 2020-11-13 15:44:32 +02:00
jdgleaver 2dc837850f OpenDingux: Add 'sdl_dingux' input/joypad drivers and use by default 2020-10-08 13:26:45 +01:00
twinaphex 236622ffa6 (Joypad driver) Init function - return void pointer 2020-09-22 02:30:47 +02:00
valadaa48 9ef2df242b ODROIDGO2 DEFAULT_MAX_PADS 1 2020-09-14 00:17:26 -04:00
twinaphex 812a5b541b Remove input_get_ptr 2020-09-04 07:27:28 +02:00
twinaphex b4b77fd6b0 Refactor out input_keyboard_ctl 2020-09-04 02:37:58 +02:00
twinaphex 2fde8c21a9 Remove set_rumble function from input driver 2020-09-02 00:38:11 +02:00
twinaphex acc0f2143f Change input_key_pressed so we no longer need to pass joypad
to the poll function callback
2020-09-01 21:43:39 +02:00
twinaphex 1d67ae3c63 Fix Android error 2020-09-01 17:41:05 +02:00
twinaphex d4d8b6934a Put keyboard_mapping_blocked into p_rarch / rarch struct
instead
2020-08-30 18:47:29 +02:00
twinaphex 5f08605680 Refactor joypad drivers 2020-08-30 05:29:32 +02:00
twinaphex 8999d6e4a6 (DInput) Set a userdata struct for the window message loop properly -
get rid of input_get_data - we no longer need it
2020-08-29 03:41:33 +02:00
twinaphex 89b441787a Reorder retro_keybind, alignment 2020-08-15 22:36:56 +02:00
twinaphex 10b06ce828 More struct reordering/alignment 2020-08-14 21:00:04 +02:00
twinaphex b6228729b6 More struct alignment 2020-08-14 17:11:18 +02:00
jdgleaver 535d73cf37 Ensure correct directory is used when saving autoconfig profiles 2020-08-03 13:10:00 +01:00
twinaphex d97e590aaf Reimplement multi button state functions 2020-07-19 03:18:12 +02:00
twinaphex 08ad00f5d3 Start preparing for being able to grab multiple buttons at the same time 2020-07-18 19:51:14 +02:00
twinaphex 8b078662cd Change function signature of joypad driver's 'button' 2020-07-18 18:07:57 +02:00
jdgleaver 84a71ea133 Rewrite 'task_autodetect.c': Ensure thread safety + clean-ups/rationalisation 2020-07-14 17:46:58 +01:00
twinaphex 634f18ad43 Turn more functions static 2020-06-24 10:14:03 +02:00
twinaphex 689ac432d6 MOve input_joypad_analog call to inside retroarch.c instead of the
input driver itself, and make function static
2020-06-23 18:31:40 +02:00
twinaphex c9f634e85d Cleanups 2020-06-23 17:51:45 +02:00
twinaphex 0503467f2c Turn functions static 2020-06-23 17:32:27 +02:00
twinaphex eb78b608d3 Cut down on code duplication 2020-06-12 00:50:08 +02:00
jdgleaver fa069c28f3 Add sublabels to all hotkey bind entries 2020-06-11 15:38:25 +01:00
twinaphex fa6ca2e39c Revert "Create input_joypad_analog_button"
This reverts commit 9e7ca7cbbe.
2020-06-10 05:50:51 +02:00
twinaphex 11cba2e805 Revert "Cleanups and documentation"
This reverts commit ec2a1e79a0.
2020-06-10 05:50:42 +02:00
twinaphex ec2a1e79a0 Cleanups and documentation 2020-06-10 05:18:59 +02:00
hizzlekizzle db63e0a60a
add hold-select to hardcoded menu gamepad combos (#10827)
* add hold-select to hardcoded menu gamepad combos
2020-06-09 21:54:28 -05:00
twinaphex 9e7ca7cbbe Create input_joypad_analog_button 2020-06-10 04:17:08 +02:00
twinaphex 26b3ccf2e5 Don't pass joypad_info by value 2020-02-27 07:33:14 +01:00
twinaphex 51bc64559b Revert "(Config file) Don't save 'nul' entries in config file anymore -"
This reverts commit 4c6d46137c.
2020-02-04 01:02:40 +01:00
twinaphex 4c6d46137c (Config file) Don't save 'nul' entries in config file anymore -
config file size goes from 100KB to 20KB
2020-02-04 00:05:11 +01:00
twinaphex 96018412c0 Cleanups 2020-02-01 03:27:58 +01:00
twinaphex 1d2150cb45 Remove drivers_hid/null_hid.c 2020-01-06 15:52:35 +01:00
twinaphex 246863279a Get rid of null input and null joypad driver files 2020-01-06 15:28:11 +01:00
twinaphex 7c63889b26 Move static inline functions over to input_bind_dialog.c - were
not used elsewhere
2020-01-01 10:53:36 +01:00
twinaphex 55de2803a4 Turn some input functions static 2020-01-01 10:22:29 +01:00
twinaphex 4de34a53e7 Turn input_driver_grab_mouse/input_driver_ungrab_mouse static 2020-01-01 09:22:23 +01:00
twinaphex 538f0c534f Backport Added alternate Turbo-Mode 'Single Button' -
For systems supporting only a single button, the turbo-button will toggle firing that button without the need to hold it.
When holding the button turbo will be suspended and resumed when the button is released. Holding the button may have a different function to just tapping it, e.g. charging the beam in R-Type on C64/Amiga.
The original implementation in RA is named 'Classic' because I have no
idea where it originates from.
2019-12-25 07:13:01 +01:00
twinaphex cbe68cbf88 Turn the find_handle/find_ident functions static 2019-11-17 22:31:57 +01:00
twinaphex b4375e3da0 Cleanups 2019-08-15 01:21:25 +02:00
twinaphex e54e8c4a1f Cleanups 2019-08-15 01:14:25 +02:00
twinaphex d30b2ecaca Merge menu_input_dialog.c into retroarch.c 2019-08-15 01:08:34 +02:00
twinaphex 890008491c Cleanups 2019-08-14 02:49:54 +02:00
twinaphex f7aebf02c8 No longer need input_driver_input_state 2019-08-12 18:00:31 +02:00
twinaphex 7900faa419 Move menu_display_libretro to retroarch.c 2019-08-09 21:59:58 +02:00
twinaphex 3ff237e278 Cleanups 2019-08-09 16:26:58 +02:00
twinaphex 70e54b2763 Get rid of unnecessary functions 2019-08-02 18:25:21 +02:00
twinaphex d28cadef01 Cleanups; turn more functions into static functions 2019-07-27 04:13:33 +02:00
twinaphex 65b4c2595e Update set keyboard mapping code for input driver 2019-07-27 02:21:24 +02:00
twinaphex abcfcca1d2 Merge dynamic.c into retroarch.c 2019-07-10 09:54:25 +02:00
twinaphex 6ff25fea2b Move macros 2019-07-09 16:36:29 +02:00
twinaphex 9c73d3305d Insert input_joypad_pressed into drivers themselves 2019-06-23 18:20:48 +02:00
twinaphex 6bc1802914 Move run_ahead.c to retroarch.c - most of the runloop
should now be self-contained in one file. Allows us to
turn more functions static, remove more extraneous functions
that just consisted of a single line (mostly getters/setters), etc.
2019-06-20 09:30:44 +02:00
twinaphex 68cbd5048c Convert input_conv_analog_id_to_bind into macro 2019-06-19 05:16:24 +02:00
twinaphex b9c33713b4 Merge input_driver.c with retroarch.c 2019-06-17 18:59:56 +02:00
twinaphex b6fd875230 (input_driver.c) Simplifications 2019-04-21 15:48:56 +02:00
twinaphex f6fec009d2 input_config_get_prefix becomes static function 2019-04-21 07:56:20 +02:00
twinaphex af2805406d Move more functionality to input_driver.c ; make more functions static 2019-04-21 07:30:14 +02:00
twinaphex 270e95bc97 Turn a lot of input_config_parse functions static 2019-04-21 06:42:13 +02:00
Brad Parker 10df615d14 add "Send Debug Info" option under Help 2019-03-07 19:17:54 -05:00
twinaphex ebae7ebc79 Input driver - Get rid of 'own driver' mechanism 2019-02-27 17:17:34 +01:00
Rob Loach fa875692c3
Added menu toggle for 'Down+Select' 2019-01-28 11:43:57 -05:00
Twinaphex cb596aec3a
Merge pull request #7820 from meepingsnesroms/master
Buttons are only 16 bits so only use uint16_t to prevent wasting 6 bytes
2019-01-13 04:55:34 +01:00
twinaphex c98b2e2292 Buildfixes and more static code analysis warning fixes 2019-01-10 22:24:43 +01:00
Twinaphex 40997473ed
Merge branch 'master' into orbis2 2019-01-08 20:18:08 +01:00
orbea bfc366decc Squeeze extra blank lines with cat(1).
Example:

find . -type f -iname '*.c' | while read -r i; do
  cat -s "$i" > "$i.new"
  mv "$i.new" "$i"
done
2019-01-08 11:04:58 -08:00
Francisco José García García 9c5a934529 [ORBIS] Untested input driver 2018-12-30 01:29:34 +01:00
krzys-h f6c8a0c5c2 Add UWP input driver
Keyboard, mouse and touch support: done
2018-12-28 22:09:30 +01:00
meepingsnesroms a6f097c873 Buttons are only 16 bits so only use uint16_t to prevent wasting 6 bytes 2018-12-25 14:33:43 -08:00
Brad Parker 458bb9fbb5 add option to toggle menu by holding down start button 2018-12-19 14:53:17 -05:00
Francisco Javier Trujillo Mata 0880bd00b0 PS2 is compiling with null drivers 2018-11-09 22:40:50 +01:00
twinaphex 527228e571 Add L + R Menu toggle 2018-10-01 01:36:53 +02:00
twinaphex 4f2c108088 Add another toggle 2018-10-01 00:21:07 +02:00
Twinaphex 467aa30131 Cleanups 2018-06-21 07:26:05 +02:00
gblues 6eebbe4213 Build fix for PC
== DETAILS
Hooray for conditional compile directives.

Moving things around broke things in unexpected ways on non-WiiU builds.

Well, not *completely* unexpected. But still.

Changes:

- Move some typedefs around to avoid circular include dependencies
- Include the file where the HID driver definition got moved to

== TESTING
- verified build for Wii U still runs successfully
- did a local build without any errors (some weird warnings, but since they
  happen in code I didn't change, I'm assuming they're pre-existing?)
2018-04-15 00:04:49 -07:00
gblues fb5b31faf3 Merge branch 'master' into gblues/hid 2018-04-14 14:18:03 -07:00
twinaphex a82bb0ec94 Create special type input_bits_t 2018-04-08 20:21:12 +02:00
radius d8d22a9c40 remap-redux part2: simplify this code a bit, still not working 2018-04-08 12:13:47 -05:00
gblues 9bc5a15c2d Enable pads to register in any order
== DETAILS

Whereas the last commit had a hack (that disabled the wiimote
driver in the process), this has.. well, a *different* hack that
allows pads to register in any order.

Note that due to the initialization routines, the gamepad will still
likely always get slot 0. Not sure if this can be overridden via config
or not.

== TESTING

Tested locally with GC adapter
2018-04-01 18:52:26 -07:00
gblues 0100d58ffb WIP: evolve driver implementation
== DETAILS

I've created the concept of a hid_driver_instance_t which is basically
a central place to store the hid pad driver, hid subsystem driver,
the pad list, and the instance data for the above in a central location.

The HID pad device drivers can use it to perform HID operations in a
generic manner.

This is more-or-less a pause point so I can catch up with upstream.

== TESTING

Haven't tested this yet. Compiles without warnings though!
2018-03-29 23:37:11 -07:00
twinaphex 5139241e87 Fix Python codepath 2018-02-19 09:11:33 +01:00
Toad King 21d928ba0e add joypad driver for emscripten 2018-01-14 00:15:30 -06:00
radius 3b334b60d6 add display name and config name to autoconf 2018-01-11 17:06:14 -05:00
gblues 0ae7ffe0d3 Clean up dumb compile warnings, fix crash bug
== DETAILS

- the free() method of the hid_driver_t interface needs its
  parameter defined as const in order for the compiler to stop
  complaining about losing const-ness.
- if a joypad list is created with <MAX_USERS slots in it, the
  destroy() function will crash because it assumes there are MAX_USERS
  entries.

  To do this, the allocate function creates n+1 slots, and gives the
  last slot a canary value that the destroy() method can then watch for
  when iterating through the list.
2017-12-30 04:43:27 +01:00
gblues 661e5bf50b Implement new functions in hid_driver_t in WiiU driver
== DETAILS

This implements the WiiU-specific functions.

Since the wiiu_hid_t data structure contains the handle and interface
index, the method signatures can be simplified quite a bit. And since
(at least for now) we want these to be synchronous, we don't need to
expose the callback parameters.
2017-12-30 04:41:19 +01:00
gblues 678c4093c1 Start adapting the dual shock 3 driver to use the new driver format.
== DETAILS

The handshake stuff is derived from the old HID2VPAD, just in knowing
what data goes in what report.

- Added the HID_REPORT_ flags to syshid.h
- Renamed the generic "REPORT_TYPE" flags to be meaningful
- also fixed incorrect parameter list for set_protocol
== TESTING
The functions aren't implemented in wiiu_hid.c just yet,
so this is gonna crash if you try to run it.
2017-12-30 04:41:12 +01:00
gblues 5b37ced196 Update HID pad driver architecture
== DETAILS

The current HID implementation assumes a very low-level USB library
is being used. This causes a problem on Wii U, because the Cafe OS
only exposes a high-level interface.

To get these functions exposed to the HID pad drivers, I had to make
three changes:

1. I added the legacy "send_control" function to the HID driver
   interface
2. I modified the signature of pad_connection_pad_init() to send the
   driver pointer instead of the function pointer
3. I updated the HID pad drivers to keep the pointer to the driver
   instead of the function pointer, and updated the calls into the
   send_control function as appropriate
4. I updated the HID drivers to use the new pad init signature

== TESTING
Untested, in theory it should work without a hitch because at this
point all I've done is abstract things a little. I still need to
update the HID pad drivers to use the Wii U-specific calls as
appropriate.
2017-12-30 04:41:01 +01:00
gblues c1496a8600 WIP - reorganizing input data
== DETAILS

Looking at the apple input driver gave me an idea--moving the
HID driver into the wiiu_input_t data instead of piggy-backing
it off the wiiu_joypad driver.

- Remove changes to wiiu_joypad
- Add equivalent to wiiu_input

This is probably broke as hell. Haven't tried to compile.
2017-12-30 04:40:43 +01:00
gblues 1beba28d02 Only call HIDSetup/HidTeardown once
== DETAILS
I did a minimalist edit of the HID thread that stripped out all
HID* syscalls, and this stopped the crashing. I then re-added just
the HIDSetup() and HIDTeardown() calls, and the crash came back.

This smells like an OS bug. To work around it, I've put the
HIDSetup() and HIDTeardown() calls into the app init/shutdown
section, so they only get called once in the application lifetime
and not each time the input driver is initialized.
2017-12-30 04:40:15 +01:00
Nathan Strong e80d99dbae Delete controller_patcher; start on proper HID driver
== DETAILS

We discovered that the controller_patcher code was causing
the WiiU to intermittently crash when switching ROMs.

Changes:

- Completely extricates the controller_patcher code
- Create a skeleton wiiu_hid driver
- Wire up the build system to build/link it successfully

== TESTING

Has not been tested. Probably doesn't crash, since the
skeleton driver is just a copy of the null driver.
2017-12-30 04:38:57 +01:00
twinaphex a6afddae04 current_input_data and current_input are no longer globals 2017-12-29 23:03:25 +01:00
misson20000 6d2a7b1f26 Nintendo Switch (libtransistor) port 2017-12-29 00:10:01 +01:00
twinaphex 69f85556a3 Get rid of meta_key_pressed 2017-12-18 05:59:57 +01:00
David Walters 0d189ae067 Don't limit available input devices to user count. 2017-12-05 21:21:29 +00:00
David Walters c5bdc02d6f replace uint64_t with retro_bits_t* for pad buttons state 2017-11-28 10:04:34 +00:00
David Walters c733f96a16 listen for mouse buttons/wheel when binding input 2017-11-26 15:42:47 +00:00
David Walters 1d70fef70c load/save mbutton assignments to retroarch config 2017-11-26 11:54:10 +00:00
David Walters b190ac1943 Add 'mbutton' field to retro_keybind struct 2017-11-26 11:49:37 +00:00
David Walters 5be7921445 reimplement using retro_bits_t; pass by ref; raise bind limit to 256 2017-11-24 11:19:17 +00:00
David Walters 5294d43bf1 use C89 compatible comment style 2017-11-24 09:28:26 +00:00
David Walters b0e383d5f0 Extend input bind limit to 128 2017-11-23 23:04:09 +00:00
David Walters 795057bacf Support for RETRO_DEVICE_INDEX_ANALOG_BUTTON 2017-11-17 22:46:23 +00:00
twinaphex fcf6228dce Turn into char pointer array 2017-09-27 20:11:44 +02:00
twinaphex b79f95668b Turn it into char pointer array 2017-09-27 20:08:37 +02:00
radius fe8a0657b4 add input_mapper scafolding 2017-09-11 00:20:20 -05:00
twinaphex d1a41a742f Reduce joykey_label/joyaxis_label char arrays 2017-09-08 06:01:21 +02:00
twinaphex 44a1a429c8 Change type of pid/vid to uint16_t 2017-08-31 12:14:27 +02:00
twinaphex e16371b8a5 Merge input_config.c and input_driver.c 2017-08-31 02:25:04 +02:00
twinaphex d8f27886ad Reduce size of input driver ids to uint16_t - should be enough 2017-08-30 14:02:18 +02:00
twinaphex 5e0e970c92 Cleanups 2017-06-11 19:48:40 +02:00
twinaphex 0751cb238d Add HAVE_HID ifdefs 2017-06-11 18:12:38 +02:00
twinaphex 060753258a Combine input_driver.c and input_keyboard.c 2017-06-11 17:51:12 +02:00
twinaphex 612cb54cfe Merge input_hid_driver 2017-06-11 08:56:36 +02:00
twinaphex 5d78c2209f Remove obsolete header 2017-06-06 08:30:01 +02:00
twinaphex efdfb29d50 Turn input_joypad_is_pressed into static inline function 2017-06-06 08:12:53 +02:00
twinaphex f307135d1d Split up wayland input driver into separate driver; and
improve mouse support for menu
2017-06-06 07:34:33 +02:00
twinaphex 6b3dbff75f Merge input_driver.c and input_joypad_driver.c 2017-06-06 05:56:02 +02:00
twinaphex d7de9facc3 Simplify input_keys_pressed 2017-05-21 22:31:15 +02:00
twinaphex 77d83b4782 Cleanups 2017-05-21 21:55:20 +02:00
twinaphex f8f25602e8 Get rid of old_input variable 2017-05-21 21:24:01 +02:00
twinaphex a35e452ec3 Use trigger_input only for menu 2017-05-21 21:19:07 +02:00
twinaphex 68ecade37d Revert "Call button combo toggle for quick menu toggle from runloop_check_state"
This reverts commit 4d4b00f877.
2017-05-21 20:57:36 +02:00
twinaphex 4d4b00f877 Call button combo toggle for quick menu toggle from runloop_check_state 2017-05-21 20:53:33 +02:00
Zoran Vuckovic 1bc945e3dc Add Windows raw input driver 2017-05-18 18:48:41 +02:00
twinaphex 2906bec7a8 Create input_driver_get_uint 2017-05-11 07:36:21 +02:00
twinaphex ef8094836f Create input_driver_get_float 2017-05-10 07:07:06 +02:00
twinaphex d9c5013d42 Pass settings struct around 2017-05-06 06:46:48 +02:00
twinaphex bdaf00032e Add comments 2017-01-26 02:49:42 +01:00
twinaphex be617c530b Expand input_keys_pressed 2017-01-25 04:31:55 +01:00
Brad Parker 57949227df DOS: initial input/joypad driver 2017-01-24 00:55:58 -05:00
twinaphex 96c8ca5a09 Header update #1 2017-01-22 13:40:32 +01:00
twinaphex 8bd12368ef Pass joypad_driver name to input_driver_init function and make
sure we don't need to access the settings struct from the
input driver
2017-01-10 17:59:48 +01:00
twinaphex d48141041d Pass joypad_info to input_state function callback - less
settings pointer grabbing
2017-01-10 17:40:21 +01:00
Hans-Kristian Arntzen b2059dcb79 Implement basic Wayland keyboard and mouse. 2016-12-17 20:28:08 +01:00
twinaphex e32d93d886 Remove functions 2016-12-07 08:14:04 +01:00
twinaphex 04a3c3f15e Remove unused function input_driver_unset_flushing_input 2016-12-07 08:11:59 +01:00
twinaphex a12d0d082d Move input_translate_coord_viewport to video_driver.c 2016-12-07 08:07:11 +01:00
twinaphex e3620278a8 Add HAVE_MENU ifdefs for menu code 2016-12-07 03:16:34 +01:00
twinaphex 4b1c24adf9 - Move input flushing hack to input_keys_pressed functions
- Move menu binding state hack to menu_input_keys_pressed
2016-12-06 20:50:29 +01:00
twinaphex 77df0ef3ae Rebase input_key_pressed/input_menu_keys_pressed 2016-12-06 18:12:35 +01:00
Adriano Moura 6b99eeaf88 Implements a hotkey for toggling mouse grabbing, hiding and hotkey blocking. Usefull for playing tyrquake with kb/m. 2016-12-06 03:32:28 -02:00
twinaphex b7ea2306af Remove unused input_driver_unset_hotkey_block 2016-12-05 05:40:51 +01:00
twinaphex ecbfc7fd8a (input_driver.c) Cleanups 2016-12-05 05:34:38 +01:00
twinaphex 2ba311274e Simplify input_translate_coord_viewport 2016-12-05 05:18:36 +01:00
twinaphex bbbcc97f57 Simplify input_push_analog_dpad 2016-12-04 22:20:47 +01:00