Commit Graph

338 Commits

Author SHA1 Message Date
twinaphex 318108ac82 Shorten character arrays that are passed to fill_pathname_base_noext 2021-11-10 00:09:33 +01:00
twinaphex f4c5852cfa Move state from global_t to input_state_t 2021-11-09 06:27:43 +01:00
twinaphex 61d30cdc31 Move input code from retroarch.c to input_driver.c 2021-11-06 04:34:54 +01:00
Jamiras 088aa7dcb9
add github action for c89 build (#13186)
* add retroarch.yml

* fix c89 errors

* attempt to add dependencies

* update comments
2021-11-05 00:05:13 +01:00
Autechre 80e0114ccf
Move collect_system_input to input_driver.c (#13183) 2021-11-03 16:48:57 +01:00
gblues 1ef78d3e3d
Any pad can control the menu (#13173)
* Any pad can control the menu

== DETAILS
I am not sure I've quite got it so that any pad can *open* the
menu, but I do have it so any pad can control it.

- split out the input processing into a separate method
- track down and squish some hairy bugs that boiled down to
  bad pointer math
- it looks like `menu_driver.c` has a mix of line endings, so I
  ran it through `dos2unix` so it has consistent line endings
  again.
- verified that this change did not impact actual cores

* optimize out cumulative_bits

* Incorporate PR feedback

Many thanks to @jdgleaver for providing these optimizations.

* apply one more optimization
2021-11-03 16:32:15 +01:00
Autechre 514534f99b
Move more state to runloop_state (#13124)
* Move more state to runloop state

* remove unused variable

* Cleanup

* Move more state to runloop_state

* Remove unused variable

* Cleanups

* move input_remapping functions over to input_driver.c

* Some buildfixes
2021-10-18 15:23:22 +02:00
twinaphex 9184d0e114 Move hid_data to input_st 2021-10-15 16:31:31 +02:00
twinaphex f070da6dfc Move code to menu_driver.c and input_driver.c 2021-10-13 15:40:01 +02:00
twinaphex 3d710db798 input_state_wrapper symbol name was causing collisions with certain
cores on statically linked platforms
2021-10-08 12:50:45 +02:00
twinaphex 61ee2274e6 Move more code over to input_driver.c - BSV code in particular but
also input state function callbacks - retroarch.c code size reduced
to 874Kb
2021-10-06 05:57:39 +02:00
Nathan Strong 5da1cd08ff Unify the HID driver architecture
== DETAILS
When I first implemented the Wii U HID architecture, I ended up
having to design my own implementation because, at the time, I did
not have a way to read the HID device string to allow the existing
code to successfully detect the gamepad.

After spending some time experimenting, I've figured out how to
do this. And that means I can better align the HID driver with other
platforms.

change summary:

- create a single state structure for all three sub-types of wiiu pads
  (kpad, wpad, and hid)
- eliminate confusing duplicate pad lists
- eliminate confusing duplicate HID pad drivers (ds3, gamecube
  adapter, etc)
- ensure the ds3 driver still works
2021-10-05 09:23:08 -07:00
Nathan Strong 9edb449471 wip commit 2021-10-05 09:10:41 -07:00
Autechre 8807e2957e
Input refactors pt3 (#13053)
* Move more internal state over to input_driver.c and menu_driver.c -
retroarch.c now down to 893kb
- Remove now unused p_rarch pointers in functions
2021-10-01 07:18:30 +02:00
twinaphex e9a4e811ac Move more code and variables from rarch_state out to input_driver
and menu_driver
2021-10-01 00:41:50 +02:00
twinaphex 49fbed2423 Get rid of input_mouse_grabbed - move retroarch types to
retroarch_types.h
2021-09-30 23:22:50 +02:00
twinaphex dbe414e1e1 move input_poll_overlay to input_driver.c 2021-09-30 21:29:35 +02:00
twinaphex ddceb51f89 Get rid of some needless getters/setters 2021-09-30 21:10:12 +02:00
twinaphex ef875f6102 Create input_state_get_ptr - move to input_driver.c -
also moved over the functions that had a dependence on this
state - retroarch.c reduced to 979kb now
2021-09-30 20:54:56 +02:00
Ben Hamilton (Ben Gertzfield) 1970786932
New feature: Use gamepad combo to quit Retroarch (#13017)
* Refactor menu toggle combo button logic to allow quit combo button

* Quit gamepad combo

* Fixes from @jdgleaver
2021-09-24 18:30:46 +02:00
twinaphex 3c69a941da Move code over to input_driver.c 2021-09-13 18:33:53 +02:00
twinaphex 6c79cebc6e Move input_overlay_auto_rotate_ out of retroarch.c and into
input_driver.c
2021-09-09 14:24:42 +02:00
twinaphex 81e7dab159 Move code out of retroarch.c and into input_driver.c 2021-09-09 14:11:46 +02:00
Michael Burgardt 303d17e2e6 Rebase 'Add generic rumble gain to input settings' by davidgfnet 2021-09-08 19:52:32 +02:00
twinaphex c9e587a5a7 Move more input code over to input_driver.c from retroarch.c 2021-09-07 14:55:37 +02:00
twinaphex 67defbcf26 Transfer code over from retroarch.c to input_driver.c 2021-09-07 12:42:03 +02:00
twinaphex 3a78b46862 Move code to input_driver.c 2021-09-07 10:17:06 +02:00
twinaphex 722166cb15 Move functions from retroarch.c to input_driver.c 2021-09-07 07:11:42 +02:00
twinaphex 7c665702a8 Move input_driver_toggle_button_combo to input_driver.c 2021-09-07 06:50:18 +02:00
twinaphex 220dfe4dbf Move code in retroarch.c over to configuration file 2021-08-30 16:52:05 +02:00
twinaphex 0194ce91bf Get rid of getters/setters in big driver files from now 2021-08-26 13:27:44 +02:00
Mark W. Kidd 5f834a8cb3 input_driver refactor 2021-08-19 20:02:39 -04:00
Autechre ae327a769b
Revert "input refactoring: create input_driver.c" 2021-08-18 18:45:53 +02:00
Autechre a66b1b3e48
Merge pull request #12703 from markwkidd/input-drivers
input refactoring: create input_driver.c
2021-08-18 18:17:43 +02:00
Mark W. Kidd 5a8920c862 input_driver refactor 2021-08-17 08:56:29 -04:00
Nathan Strong feb4f266fa WIIU: Fix L3/R3 buttons
== DETAILS
After a bisect, the culprit was changing the gamepad interface from
returing a single button (bool) to multiple (int16).

The issue is that the Wii U gamepad (and presumably the Pro controller too)
have more than 16 buttons, which means some buttons get lost. Notably, L3 (18)
and R3 (17).

The solution: use int32 instead of int16.

I did a test build and confirmed that this change restores L3/R3 functionality
with the gamepad. Don't have a pro controller to test, but it should work too.
2021-08-07 23:23:33 -07:00
sonninnos bd3533f05d Friendly names for mice where available 2021-08-06 00:21:17 +03:00
Mark W. Kidd e3d2a9b614 Merge branch 'master' of http://github.com/markwkidd/retroarch into menu-input 2021-07-23 10:27:49 -04:00
Mark W. Kidd 8038d899d6 add documentation to input_driver.h 2021-07-19 12:05:28 -04:00
Mark W. Kidd 64672b4b63 consolidate menu_input.h declarations 2021-07-15 14:19:38 -04:00
Autechre 7b55b03c96
Merge pull request #12617 from markwkidd/input-cleanup
consolidate 'input define' enums to input_defines.h
2021-07-09 15:30:02 +02:00
Mark W. Kidd b17dd28ff2 consolidate and comment input_remapping.h 2021-07-06 16:13:43 -04:00
Mark W. Kidd 523d7d6ee8 consolidate input defines 2021-07-05 15:18:17 -04:00
Autechre e1270742b9
Merge pull request #12582 from markwkidd/input-drivers
add comments in order to document input_driver.h
2021-07-02 00:21:09 +02:00
Mark W. Kidd fb2b3695d9 remove unused enum input_device_type 2021-06-30 19:05:56 -04:00
Mark W. Kidd b0831bf1a0 comment documentation for input_driver.h 2021-06-29 20:12:44 -04:00
twinaphex cfe9d60f51 Get rid of button_is_pressed 2021-04-15 06:55:35 +02:00
twinaphex ca5ce839ce Small cleanups to button input handling code - several parameters
were no longer used
2021-04-10 19:06:56 +02:00
jdgleaver b9691597d1
Add 'L2 + R2' menu toggle gamepad combo (#11935) 2021-01-24 16:33:13 +01:00
AKuHAK 3c0633839f
(PS2) added Multitap support (up to 8 players) (#11928)
* (PS2) added Multitap support (up to 8 players)

* (PS2) revert some identation changes

* (PS2) fix for non-analog controllers
* fix for not recognized digital and other non-standart controllers
* fixed ps2_joypad_destroy
2021-01-24 00:04:04 +01:00
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