Commit Graph

4367 Commits

Author SHA1 Message Date
LibretroAdmin 61e24132bf (task_save.c) Simplification in control flow
(snprintf) Try to reduce or simplify snprintf calls, only tend to
use it for processing integers/numbers and avoid it for regular
string concatenation (NOTE: we try to be a bit safer about it to
address earlier cited criticism, although we don't consider concatenating
3 or 4 characters at the end to be insecure)
(msg_hash_to_str) Try to avoid duplicate calls to the same localized
string when we can just cache the results once instead locally
2022-08-27 07:55:02 +02:00
LibretroAdmin da13fb0f48 Don't include errno.h in files that don't justify its use 2022-08-25 05:19:30 +02:00
LibretroAdmin 10a351228b * Rewrite some snprintfs
* task_steam.c - add license header
2022-08-20 19:17:28 +02:00
LibretroAdmin 4c7e316aa2 Turn functions static 2022-08-17 16:47:44 +02:00
LibretroAdmin 94ed25be56
Cleanups (#14296)
- (database_info.c) Optimizations for database_info_build_query_enum() -
 it would call strlcat at the very least 3 times, normally more than that.
 Every strlcat call is at least one or more strlens. Reduce it all down
 to manual string concatenation and one strlcat
- (database_info_build_query_enum) - always NULL terminates string so no need for NULL termination done by callee
* (menu_displaylist) use smaller strings for basename paths, remove one unnecessary string
in menu_displaylist.c function
- (disk_index_file.c) Avoid another trivial string concatenation by doing
it manually after fill_pathname_join_special
- (fill_pathname_join_delim) since fill_pathname_join_delim() now has a return value, use it for 
string concatenation
- (platform_unix) - Use BUFSIZ as size for a buffer in system_property_get
- some other trivial strlcat usage replacements
2022-08-06 18:04:40 +02:00
LibretroAdmin b2634ea588 * Create fill_pathname_join_special - and specify fill_pathname_join
as deprecated.
* Use fill_pathname_join_special in the vast majority of cases where
we can ensure out_path is a new empty string
* Get rid of some extension concatenation with strlcat where encountered
* Some general cleanups with NULL termination of strings that get immediately
passed to strlcpy/strlcpy-adjacent functions
2022-08-04 14:19:38 +02:00
Cthulhu-throwaway 9b10579a54
(Network) Fix getaddrinfo_retro (#14261) 2022-07-31 11:22:28 +02:00
libretroadmin 8ac1a36259 Don't do NULL termination on strings when passing to strlcpy and/or
a file_path function that calls strlcpy under the hood
2022-07-26 07:01:10 +02:00
libretroadmin a6a4b845a4 Some string simplifications - don't NULL terminate if we pass
string to strlcpy and/or a file_path function using strlcpy under
the hood - don't do strlcpy for trivial setting of 2/3 char strings
2022-07-25 04:39:08 +02:00
LibretroAdmin 29774f5b7a
Small opts (#14186)
* (joypad_connection) Small optimizations -
* Turn functions static where possible
* Hose strlen call out of loop

* (input_driver.c) General cleanups:
* Some small code/style nits

task_screenshot.c:
* Move widget callback function for screenshots to task_screenshot.c

(file_path.c):
* Turn get_pathname_num_slashes into static function
* path_linked_list_free - always returns true, so get rid of return value
* path_linked_list_new - fix function signature
* path_get_archive_delim - do not NULL-terminate string, already done by strlcpy later on

General:
* Slight optimizations - use int/size_t for loop counter variable instead of unsigned
* Take advantage of fact that strlcpy already NULL-terminates, so don't do this explicitly
outside if we're just going to end up calling strlcpy/fill_pathname_join on it anyway
2022-07-19 10:01:33 +02:00
libretroadmin 0a12062e1c Remove unnecessary content_crc in bsv_movie_init_playback 2022-07-17 04:26:49 +02:00
libretroadmin 4b1766cf61 Silence more -Wdocumentation warnings 2022-07-15 01:12:04 +02:00
libretroadmin eb2c3e35d4 Silence some of the warnings being generated by Objective-C 2022-07-15 00:33:08 +02:00
libretroadmin f7194e167f use path_basename_nocompression where it is safe to do so 2022-07-12 19:14:12 +02:00
libretroadmin d706c9c5bf Start deprecating trivial functions in file_path.c 2022-07-11 19:56:46 +02:00
libretroadmin 14afdf0e87 (Android) Backport 2020e9ce6a -
* Gingerbread support
* Touchpads support
* builtin Xperia Play autoconfig profile
2022-07-08 21:03:19 +02:00
aldebaran27 58decac935
Increase DEFAULT_MAX_PADS to 8 for ODROIDGO2, since that impacts the RG351[X] consoles. The RG351[X] have a USB host controller and can have an arbitrary number of USB gamepads. (#14122) 2022-07-02 01:06:46 +02:00
libretroadmin 38f6ad95f4 (Winraw) Get rid of some debug logs 2022-06-26 06:12:30 +02:00
sonninnos 1ad9b20b09
(WinRaw) Clear key states when unfocused (#14080) 2022-06-21 18:01:28 +02:00
LibretroAdmin 4a38831c47
Try to reduce fixed size char arrays from PATH_MAX_LENGTH to lower sizes (#14062)
* Try to reduce fixed size char arrays from PATH_MAX_LENGTH to lower sizes
2022-06-18 19:07:15 +02:00
StormedBubbles 53d0e161e1
Fix lightgun scaling on Y axis 2022-06-16 22:16:32 -04:00
sonninnos 53be17aee2 Block pointer input when overlay is pressed 2022-06-16 16:49:51 +03:00
sonninnos 8d9f772dce (WINRAW) Fix pointer device position 2022-06-16 11:34:54 +03:00
libretroadmin 85cd386cb3 (Input) Cleanups 2022-06-04 08:55:35 +02:00
libretroadmin c9149895f5 (GCC12) Get rid of warning: the comparison will always evaluate as 'true' for the pointer operand in 'binds + (sizetype)((long long unsigned int)port * 4032)' must not be NULL [-Waddress] 2022-06-04 08:50:35 +02:00
libretroadmin 96a485f885 Move struct and macros for input to input_types.h 2022-05-29 21:58:39 +02:00
libretroadmin 9590fdd0d4 Cleanups pt.2 2022-05-22 20:29:53 +02:00
Francisco Javier Trujillo Mata 6366fcf8e3 [ORBIS] Remove legacy implementation and compile with Werror 2022-05-21 17:10:35 +02:00
Antonio Jose Ramos Marquez 9dd060dbc8 [ORBIS] some changes for input 2022-05-21 16:31:10 +02:00
OsirizX c6d51fdb32 [ORBIS] Initial changes for PS4 2022-05-21 16:31:10 +02:00
libretroadmin 49bf60cc90 (Win32) Cleanups 2022-05-17 13:21:56 +02:00
LibretroAdmin 533d746f64
Merge pull request #13649 from phcoder/ctrl
Add a configurable workaround for Android reconnecting devices
2022-05-12 20:56:58 +02:00
jdgleaver dbcce3f564
Analog button mapping fixes (#13913) 2022-05-05 20:47:23 +02:00
Vladimir Serbinenko c2db12c727
Enable menu toggle button on retrofw devices (#13889) 2022-04-26 09:59:36 +02:00
Tony 044e1ec655
(WinRaw) Fix multiple light guns (#13840)
* (WinRaw) Fix multiple light guns

* Strip non-ASCII characters from mouse display names
2022-04-08 21:46:00 +02:00
Vladimir Serbinenko 2ef2ff1b36 Add a configurable workaround for Android reconnecting devices
Closes https://github.com/libretro/RetroArch/issues/3414

I have investigated the issue. The crux of the problem is that on Android there
is no way distinguishing 2 scenarios:
1) 2 identical bluetooth controllers A and B and first there are button presses
only on controller A and then on controller B
2) the same controller disconnects and reconnects.
Android doesn't give bluetooth mac address of where the touch came from, only
opaque ID and this opaque ID changes after reconnect. Hence without changes to
android this is infeasible without giving up the ability for 2 users to play on
identical controllers.

I guess that this sacrifice makes sense for affected users
2022-04-05 18:40:27 +02:00
twinaphex c8d57fe667 (CXX_BUILD) Some CXX_BUILD fixes 2022-03-30 15:13:28 +02:00
revvv 1cd6413e24 Wii U: Fix USB get_device_name(), don't truncate to three chars 2022-03-29 18:25:27 +01:00
OsirizX 80b06c37fe [PSL1GHT] Add experimental PSMove support for ps3 2022-03-27 18:03:40 +02:00
revvv 78e7d23c14 Fix USB gamepad support
1. get_axis() didn't use AXIS_NEG_GET() / AXIS_POS_GET()
2. packet_handler() needs byte shift
3. log messages need SWAP_IF_BIG()
2022-03-27 04:35:06 +01:00
revvv b6ae697fad Make find_connection_entry() more specific
Controllers with same VID/PID are distinguished by the device name.
1. The Wii U only sends a prefix of the device name.
2. The check preferred the device name over VID/PID which was not
   intended.

Example: The device name "USB Gamepad" is truncated to "USB" which
was mapped to "Generic SNES USB Controller", although VID/PID did not
match.
2022-03-27 04:35:06 +01:00
revvv 75f94950bf Use "Retrode" as device name
Otherwise autoconfig file can't be found on the Wii U:
VID/PID are not available, so it has to match with 'input_device' and I
don't want to add additional autoconfig files with different
'input_device' strings.
2022-03-27 04:35:06 +01:00
twinaphex 03ce03eb81 Remove unused variable 2022-03-25 16:19:39 +01:00
sonninnos 6fcf291df4 Fix analog stick not working with 'Unified Menu Controls' 2022-03-24 13:46:57 +01:00
Colin Kinloch 60fab1c4a1 (Wayland) Create wl_data_device only when wl_seat and wl_data_device_manager exist 2022-03-23 06:52:16 +01:00
revvv b98b9471d9 Refactored to use new multi_pad interface 2022-03-22 18:17:50 +01:00
revvv 9b00a932d5 Remove special treatment for Retrode gamepad adapter 2022-03-22 18:17:50 +01:00
Colin Kinloch d95bc2dd54 (Wayland) Dynamically load libdecor at runtime 2022-03-22 06:58:41 +01:00
Colin Kinloch 47c850c7fd (Wayland) Dedupe VK/GL code 2022-03-21 07:50:34 +01:00
Colin Kinloch 82c69995f0 (Wayland) SHM anti-collision for the splash screen 2022-03-20 18:31:30 +01:00
Colin Kinloch 065fb5acee (Wayland) Skip splash screen if window is not ready 2022-03-18 16:29:49 +01:00
jdgleaver ea77410037 Add 'Manage Remap Files' submenu + automatically save input remaps when closing content 2022-03-16 18:59:49 +01:00
revvv 492a83e6d5 Wii: Fix find_connection_entry(): needs unsigned int
Otherwise the USB gamepad cannot be found, if VID/PID has leading zero.
For example: Retrode gamepad adapter:
             vid=1027 (0x403) pid=38849      (0x97c1) becomes
             vid=1027 (0x403) pid=-26687 (0xffff97c1)
2022-03-15 17:43:46 +01:00
jdgleaver b08314cf60 Prevent 'global' configuration of input libretro device type 2022-03-15 17:43:28 +01:00
Colin Kinloch 86ca2006ea
(Wayland) Fallback to shm_open when memfd_create fails (#13740) 2022-03-14 19:20:29 +01:00
Nikos Chantziaras b094c58081
Add hotkey for toggling sync to exact content framerate (#13725)
* Add hotkey for toggling sync to exact content framerate

* CHANGES.md: add sync to exact content framerate toggle hotkey
2022-03-10 17:21:08 +01:00
Colin Kinloch 3b08d63b23
(Wayland) Initial drag and drop (wl_data_offer) support (#13515) 2022-03-09 16:34:47 +01:00
twinaphex 9bcee062ff Cleanups/warnings 2022-03-07 19:32:01 +01:00
Vladimir Serbinenko c11a798467
Series of djgpp fixes (#13705)
* features_cpu: Fix clock for djgpp

* frontend_dos_set_fork: Fix wrong id names

* dos_input: Fix missing indexing

* dos_joypad: Fix wrong id name

* Fix menu drawing

Menu is already prescaled to VGA_WIDTH x VGA_HEIGHT in vga_menu_frame. We need
to always use those dimensions

* Change dos compilation from griffin to common

* Set vga menu size to 320x200

* Add DOS compilation in gitlab-ci.yml
2022-03-05 15:53:18 +01:00
Tony e8e8404741
(WinRaw) Enable mouse overlay control (#13688) 2022-03-01 09:45:07 +01:00
Tony f0d9add1b2
(DInput/WinRaw) Ignore 'unknown/undefined' key (#13660) 2022-02-24 07:10:47 +01:00
Colin Kinloch 6dec52fda7
(Wayland) Fix wayland vulkan not reacting to initial resize (#13640)
(Wayland) Correct log stamps for GL or Vulkan

(Wayland) Fix style issues and sync formatting on identical code in GL and Vulkan
2022-02-22 08:58:46 +01:00
yoshisuga bc02f8319e
[iOS] New iOS 13 project to support Swift; Custom keyboard and touch mouse support (#13435)
* Support for Swift, added emulator keyboard

* fixed toggle key handling using magic number hack for now

* fixed keyboard transparency slider for now with suboptimal fix; add gesture recognizer to hide/show keyboard

* Support CocoaView extensions in Swift; move keyboard delegate impl and setup to swift extension

* moved keyboard view model creation out of EmulatorKeyboard

* implement key pressed delegate in swift extension

* added input method for directly sending RETROK_* codes to support a touchscreen keyboard; assign keyboard model delegates; updated keyboard layout (added F1-F12 keys); change shift, control and alt keys to be modifiers

* enable focus mode when custom keyboard is shown; enable/disable overlay when custom keyboard is toggled

* Specify -DHAVE_OPENGLES2 instead of -DHAVE_OPENGLES3 since glsym_es3.h does not compile in iOS 14.5
Fix tvOS build using compiler flags

* Create new project for iOS 13 deploy target; add check for deploy target to conditionally compile for new iOS 13 specific feature (custom keyboard)

* force disable core info caching for iOS, use opengl es2 for debug

* Add flag for iOS custom keyboard - 3-finger swipe up to show, 3-finger swipe down to hide

* use OpenGLES2 instead; using ES3 results in compile time errors on iOS 14.5

* code cleanup

* Updated references to -DDONT_WANT_ARM_ASM_OPTIMIZATIONS flag

* Add JIT support for non-jailbroken devices

* iOS: Add support for touch mouse handler

* Added a HAVE_IOS_TOUCHMOUSE preprocessor macro so that it builds under the iOS11_Metal xcode project

* Changed click-and-drag behavior to double tap hold and drag

* Visual improvements to the emulator keyboard: updated colors, improved key-press effect
2022-02-22 08:21:34 +01:00
Colin Kinloch b2527b43e8
(Wayland) Show window early to get screen info (#13591)
* (Wayland) Show window early to get screen info

* Report current monitor size on initial get_video_size call

* Fullscreen to monitor selected in settings

* Fullscreen on current monitor when setting is set to automatic

* Fallback to shm_open when memfd_create is not supported
2022-02-18 19:59:41 +01:00
Autechre b45a192416
Revert "(Wayland) Show window early to get screen info (#13582)" (#13590)
This reverts commit 4bb2c14293.
2022-02-01 12:47:53 +01:00
Colin Kinloch 4bb2c14293
(Wayland) Show window early to get screen info (#13582)
* Report current monitor size on initial get_video_size call

* Fullscreen to monitor selected in settings

* Fullscreen on current monitor when setting is set to automatic
2022-02-01 10:30:34 +01:00
Tony 6d5d2e722d
Logging cleanups (#13579) 2022-01-31 18:05:23 +01:00
Colin Kinloch a431760829
(Wayland) Release keys and mouse buttons on lost focus (#13567) 2022-01-29 19:57:06 +01:00
twinaphex 60eaf14afc C89_BUILDFIX 2022-01-29 10:55:31 +01:00
Dystopian 0afdb2a0cf
Improve udev logging (#13549) 2022-01-29 10:57:38 +01:00
Francisco Javier Trujillo Mata 86b47b4859
[PSP] Update Retroarch to latest PSPDev status (#13544)
* Added newlib changes

* Add action to launch PPSSPP simulator

* Remove legacy config for the stack and heap

* Add pthread

* Simplify kernel_functions and improve references to HAVE_KERNEL_PRX

* Add some flags

* Improve audio init/deinit

* Improve exit by clicking home

* Add CI for PSP1

* Update PSP.yml
2022-01-25 03:50:18 +01:00
Ryan Kuba 6ae1270e5c
remove test for standard mapping in controller detection (#13528) 2022-01-24 16:31:03 +01:00
Keith Bowes 38e74ee3cf
Restores mouse-grab toggling in Wayland. (#13537)
* Fixes mouse-grab toggling in Wayland.

Fixes #13536

* Indicate that input_wl_grab_mouse is a necessary function.

It might prevent it from being removed again in future cleanups.
2022-01-24 16:22:21 +01:00
twinaphex 5241d3e5d6 Cleanups 2022-01-20 06:09:43 +01:00
twinaphex cc756e4126 Silence some warnings 2022-01-19 19:08:22 +01:00
Dystopian 2095fc53f8
Fix webOS build and run (#13480) 2022-01-12 07:12:34 +01:00
Cthulhu-throwaway 9579810579
Build fix for --disable-menu (#13419) 2021-12-26 15:18:57 +01:00
Aleksey Samoilov f17deb90c7
[Wayland] Fix toplevel close (#13415) 2021-12-25 11:19:27 +01:00
Colin Kinloch 0168fe0303
(Wayland) Ignore mouse clicks on window decoration (#13412) 2021-12-25 04:08:22 +01:00
Colin Kinloch f0392474f2
(Wayland) Add libdecor for client side decoration (#13397) 2021-12-24 14:20:45 +01:00
twinaphex 393e42a497 (Wayland) Buildfix 2021-12-24 05:25:30 +01:00
Colin Kinloch c48d533950
(Wayland) Add scroll wheel support (#13398) 2021-12-24 03:42:33 +01:00
Nikos Chantziaras 0357b6c922
Add on-screen statistics toggle hotkey (#13381)
* Add on-screen statistics toggle hotkey

* CHANGES.md: Add technical statistics hotkey
2021-12-21 00:03:35 +01:00
Cthulhu-throwaway 690c802921
Netplay Stuff (#13375)
* Netplay Stuff

## PROTOCOL FALLBACK
In order to support older clients a protocol fallback system was introduced.
The host will no longer send its header automatically after a TCP connection is established, instead, it awaits for the client to send his before determining which protocol this connection is going to operate on.
Netplay has now two protocols, a low protocol and a high protocol; the low protocol is the minimum protocol it supports, while the high protocol is the highest protocol it can operate on.
To fully support older clients, a hack was necessary: sending the high protocol in the unused client's header salt field, while keeping the protocol field to the low protocol. Without this hack we would only be able to support older clients if a newer client was the host.
Any future system can make use of this system by checking connection->netplay_protocol, which is available for both the client and host.

## NETPLAY CHAT
Starting with protocol 6, netplay chat is available through the new NETPLAY_CMD_PLAYER_CHAT command.
Limitations of the command code, which causes a disconnection on unknown commands, makes this system not possible on protocol 5.
Protocol 5 connections can neither send nor receive chat, but other netplay operations are unaffected.
Clients send chat as a string to the server, and it's the server's sole responsability to relay chat messages.
As of now, sending chat uses RetroArch's input menu, while the display of on-screen chat uses a widget overlay and RetroArch's notifications as a fallback.
If a new overlay and/or input system is desired, no backwards compatibility changes need to be made.
Only clients in playing mode (as opposed to spectating mode) can send and receive chat.

## SETTINGS SHARING
Some settings are better used when both host and clients share the same configuration.
As of protocol 6, the following settings will be shared from host to clients (without altering a client's configuration file): input latency frames and allow pausing.

## NETPLAY TUNNEL/MITM
With the current MITM system being defunct (at least as of 1.9.X), a new system was in order to solve most if not all of the problems with the current system.
This new system uses a tunneling approach, which is similar to most VPN and tunneling services around.

Tunnel commands:
RATS[unique id] (RetroArch Tunnel Session) - 16 bytes -> When this command is sent with a zeroed unique id, the tunnel server interprets this as a netplay host wanting to create a new session, in this case, the same command is returned to the host, but now with its unique session id. When a client needs to connect to a host, this command is sent with the unique session id of the host, causing the tunnel server to send a RATL command to the host.
RATL[unique id] (RetroArch Tunnel Link) - 16 bytes -> The tunnel server sends this command to the host when a client wants to connect to the host. Once the host receives this command, it establishes a new connection to the tunnel server, sending this command together with the client's unique id through this new connection, causing the tunnel server to link this connection to the connection of the client.
RATP (RetroArch Tunnel Ping) - 4 bytes -> The tunnel server sends this command to verify that the host, whom the session belongs to, is still around. The host replies with the same command. A session is closed if the tunnel server can not verify that the host is alive.

Operations:
Host -> Instead of listening and accepting connections, it connects to the tunnel server, requests a new session and then monitor this connection for new linking requests. Once a request is received, it establishes a new connection to the tunnel server for linking with a client. The tunnel server's address and port are obtained by querying the lobby server. The host will publish its session id together with the rest of its info to the lobby server.
Client -> It connects to the tunnel server and then sends the session id of the host it wants to connect to. A host's session id is obtained from the json data sent by the lobby server.

Improvements (from current MITM system):
No longer a risk of TCP port exhaustion; we only use one port now at the tunnel server.
Very little cpu usage. About 95% net I/O bound now.
Future backwards compatible with any and all changes to netplay as it no longer runs any netplay logic at MITM servers.
No longer operates the host in client mode, which was a source of many of the current problems.
Cleaner and more maintainable system and code.

Notable functions:
netplay_mitm_query -> Grabs the tunnel's address and port from the lobby server.
init_tcp_socket -> Handles the creation and operation mode of the TCP socket based on whether it's host, host+MITM or client.
handle_mitm_connection -> Creates and completes linking connections and replies to ping commands (only 1 of each per call to not affect performance).

## MISC
Ping Limiter: If a client's estimated latency to the server is higher than this value, connection will be dropped just before finishing the netplay handshake.
Ping Counter: A ping counter (similar to the FPS one) can be shown in the bottom right corner of the screen, if you are connected to a host.
LAN Discovery: Refactored and moved to its own "Refresh Netplay LAN List" button.

## FIXES
Many minor fixes to the current netplay implementation are also included.

* Remove NETPLAY_TEST_BUILD
2021-12-19 16:58:01 +01:00
arpruss e5e6f343ac
convert abs mouse from screen to viewport coordinates; fix relative m… (#13258)
* convert abs mouse from screen to viewport coordinates; fix relative mouse code to work in screen mode

* C89 compatibility

* revert accidental include
2021-12-18 17:52:27 +01:00
Tony 8cc423e036
Logging cleanups (#13370) 2021-12-17 18:04:24 +01:00
Francisco Javier Trujillo Mata 1cd0938cc3
[PS2] Improve Compilation (#13359)
* Allow parallel compilation in PS2

* Allow to compile with griffin or common compilation in PS2

* Enable dummy core to be used in other platforms

* Use threads in YML config

* Add the compilation to PS2 in GitHub Actions
2021-12-15 19:01:56 +01:00
twinaphex bfeffb2423 Fix local header path includes 2021-12-04 16:11:02 +01:00
gblues bf9706395d
Fix gamepad disconnect on unrecognized HID device (#13321)
== DETAILS
So, the reason the gamepad was getting deregistered was
because adapter free code wasn't properly handling null-interface
adapters, causing the gamepad to match erroneously and get
deregistered.

This doesn't fix the weird "Generic SNES USB" detection issue,
but it should make it non-fatal.

Co-authored-by: Nathan Strong <nstrong@tripwire.com>
2021-12-04 12:43:58 +01:00
gblues 1dd15ac516
WIIU: Fix keyboard support (#13308)
== DETAILS
The problem was caused by changing the driver lookup point. The deferred
lookup resulted in the WIIU trying to treat the keyboard as a gamepad which ...
didn't work.

This change short-circuits at the connection event by ignoring mouse &
keyboard connection events.

Tested this with a dev build.

Co-authored-by: Nathan Strong <nstrong@tripwire.com>
2021-12-02 12:43:19 +01:00
Aaron Ramirez 97f3fca139
Fixes a bug where the Gyroscope and Accelerometer would not be re-enabled when the app regains focus or is resumed. (#13298) 2021-11-29 16:53:13 +01:00
twinaphex b4137915e8 Move code to proper locations 2021-11-23 16:58:36 +01:00
twinaphex c2c36177b8 Move two variables to input_driver.c 2021-11-22 15:26:54 +01:00
Autechre 2b87cd9313
Create runloop.c and split up runloop code to this new file; (#13269)
* Create runloop.c and split up runloop code to this new file;
retroarch.c now 207Kb and runloop.c 301Kb

* Define empty runloop_secondary_core_destroy
2021-11-22 03:27:23 +01:00
Tomáš Kelemen (vudiq) 0cf437e375
Lakka/Nintendo Switch: disable rumble gain
Rumble gain breaks controlls on Nintendo Switch port of Lakka, probably
due to issue in the driver).

Upstream of patch used by Lakka at build time
1943ad296e/packages/libretro/retroarch/patches/retroarch-06-switch_disable_rumble_gain.patch
2021-11-18 00:36:11 +01:00
Jean-André Santoni 6a99832a4d
Lakka: Patch to fix keyboard typing
Upstream of patch used by Lakka at build time
1943ad296e/packages/libretro/retroarch/patches/retroarch-01-xkb-fix.patch
2021-11-18 00:36:11 +01:00
twinaphex efa16a8fca Revert "(Netplay) Cthulhu88 -"
This reverts commit cb4028fd3d.
2021-11-12 19:00:42 +01:00
twinaphex 86f899c844 Revert "Shorten character arrays that are passed to fill_pathname_base_noext"
This reverts commit 318108ac82.
2021-11-10 08:22:19 +01:00
twinaphex cb4028fd3d (Netplay) Cthulhu88 -
* Netplay Chat menu
* Toggleable bind for chat (bound to ~ [tilde] by default)
2021-11-10 02:41:02 +01:00
twinaphex 318108ac82 Shorten character arrays that are passed to fill_pathname_base_noext 2021-11-10 00:09:33 +01:00
twinaphex 619398bbe4 Backport parts of 73c0760236 2021-11-09 23:12:57 +01:00
twinaphex f4c5852cfa Move state from global_t to input_state_t 2021-11-09 06:27:43 +01:00
twinaphex f671ce4f8c Move global->name to runloop_st 2021-11-09 06:03:00 +01:00
twinaphex 88c771fc66 Cleanups 2021-11-07 01:44:45 +01:00
twinaphex c0585fed60 (winraw_input.c) Cleanups 2021-11-06 15:07:35 +01:00
twinaphex 61d30cdc31 Move input code from retroarch.c to input_driver.c 2021-11-06 04:34:54 +01:00
grant2258 1ae36ee9a7
udev fix dolphinbar and safeguard against not adding devices with no mouse or touch buttons detected (#13143)
* udev fixes

* updates

* small updates

* fix condition

Co-authored-by: grant2258 <you@example.com>
2021-11-05 23:59:17 +01:00
twinaphex db9283b57c Silence some warnings 2021-11-05 04:49:26 +01:00
twinaphex 21beb6064a Silence some warnings 2021-11-05 03:58:26 +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
twinaphex 1a78d91348 MSVC buildfix 2021-11-03 16:50:41 +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
twinaphex 5ec93d2493 (HID) Fix some warnings 2021-10-20 02:23:01 +02:00
twinaphex 1dc77507a8 Fix command stdin - courtesy of Cthulhu 2021-10-19 22:23:07 +02: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
grant2258 6e8a3945d5 add extra abs check for dolphinbar 2021-10-18 03:43:49 +01:00
Nathan Strong 12a44e0365 Fix crashes reported by ploggy
== DETAILS

The crashes he reported in the gbatemp thread are due to iface
being null (since it's an unsupported device) and unchecked
iface dereferences.
2021-10-17 00:13:48 -07:00
Nathan Strong 5b4b766459 Fix wiimotes regression
== DETAILS
- only call disconnect when we're actually disconnecting a remote
  (e.g. read errors or remote goes to sleep).
- clean up some compile warnings introduced by others (mainly
  unused variables)
2021-10-16 23:56:15 -07:00
Nathan Strong 81c6d3809a Finish up the OSX DS3 driver
== DETAILS
Put the finishing touches on getting the DS3 to work on Mac OSX.

Basically, there's some differences in the HID interface bewtween
wiiu and osx where OSX expects the first byte of the report to be
the report ID, while wiiu expects that byte to be trimmed off.

I was able to put this behavior in the respective HID
implementations, which eliminated the confusing packet offset
ifdefs.

And, I was able to get the LEDs working again.
2021-10-16 14:52:56 -07:00
Nathan Strong 729c219f1a Rewrite DS3 driver
== DETAILS
The DS3 driver previously only worked with the Wii U HID implementation.

I adapted this driver from the Linux driver for the DS3. It's not quite
100%--I haven't got the LEDs to work properly--but it's functional.

Going to continue tweaking it to see if I can get the LEDs to work.
2021-10-16 14:52:56 -07:00
Nathan Strong 7ed3ca7f97 WIP commit
Start trying to adapt the linux DS3 driver instead of our
hacked-together support.
2021-10-16 14:52:56 -07:00
Autechre c1b002e454
Merge pull request #13125 from grant2258/mouse
Udev pointer pressed update to support relative devices pointer pressed
2021-10-16 22:10:36 +02:00
grant2258 1fca7507dc cleanup 2021-10-16 19:36:35 +01:00
grant2258 a68e5205bd add relative left mouse button when pointer device is not abs 2021-10-16 19:26:40 +01: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
Autechre 0a888f7868
Move video state to gfx/video_driver.c - reduces filesize of retroarch.c to 809kb (#13104)
* Move video state to gfx/video_driver.c - reduces filesize of retroarch.c
to 809Kb
2021-10-13 14:56:22 +02:00
jdgleaver f1ac1ad9f9 (Dingux) Fix HAS_ANALOG/HAS_MENU_TOGGLE defines in sdl_dingux joypad driver 2021-10-13 12:53:54 +01:00
Kirby Kevinson 177d05144a
Fix keyboard input on Wayland (#13102)
Fixes #13036
2021-10-11 13:20:41 +02:00
gblues dd6c70a083
Fix a couple regressions (#13101)
== DETAILS

- rewrote the HID deregistration algorithm; it should no longer
  cause issues when dealing with multiple pads of the same HID/VID
  combo
- fix initialization bug that caused wiimotes to fail to register
  without an accessory attached
2021-10-11 09:39:13 +02:00
twinaphex bcc7581250 (joypad_connection.c) Cleanups - style nits - comment out some logs
that were generating warnings
2021-10-09 16:19:54 +02:00
Salvador 58e7dd8a1a
Add Miyoo target (#12860)
* add miyoo target
2021-10-08 13:53:49 +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 e39bc07e31 Fix implicit declaration 2021-10-08 06:57:37 +02:00
Nathan Strong ea249b3827 Get the WIIU GCA working on Mac OSX
== DETAILS
The GCA uses a weird HID class that our current filters don't
catch, so we add it.

Needed to do a small amount of tweaking on the GCA driver to
account for iohidmanager weirdness.
2021-10-06 23:11:22 -07:00
Autechre 3f179a5762
Merge pull request #12632 from Sunderland93/remove-xdg-shell-v6
[Wayland] Remove xdg-shell-v6 protocol
2021-10-07 05:10:53 +02:00
Autechre 54cbeecbb7
Merge pull request #13075 from libretro/move-more-code-to-input-driver
Move more code over to input_driver.c
2021-10-06 12:38:21 +02:00
Nathan Strong 01e96585a3 Fix crash when connecting DS3 to Mac
== DETAILS
The OSX HID driver doesn't implement `set_protocol()` and crashes
with an NPE, so we guard it.
2021-10-05 23:57:09 -07: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
twinaphex 55bf2b0083 (input/connect) Style nits 2021-10-06 02:52:19 +02:00
twinaphex f81a231481 (joypad_connection) Cleanups - get rid of warning for old-style function
definition
2021-10-06 02:28:55 +02:00
Nathan Strong e8ec65ecf7 squelch format warning 2021-10-05 19:05:12 +00:00
Nathan Strong 3e91e3fbc9 fix up non-wiiu side of ifdefs for ds3 2021-10-05 18:15:19 +00:00
Nathan Strong 002c9a30c0 Implement button() for most HID drivers
== DETAILS
The HID drivers in `input/connect/` were missing an implementation
for button(), so I added it. The only exception is the wii driver,
which is really complicated and more than I wanted to try to tackle--
especially since WIIU has its own wiimote drivers.
2021-10-05 17:43:03 +00:00
Nathan Strong e02e345a28 Make GCA driver compatible with other HID drivers
== DETAILS
Use a little trickery to ensure the GCA driver continues working
with other HID implementation.

I've expanded the joypad implementation to support multi-pad devices.
However, this requires changes to each HID implementation to actually
function.

I've made the necessary changes for WIIU, but I don't have the means
of making the change in the other HID implementations.

So, I've built in a backwards-compatibilty mode for the driver.

The trick is to have an identifier byte at the top of both data structs
that the driver returns. We can then use that byte to determine which
of the structs has been passed to the pad functions and act accordingly.

In the GCA case, for non-wiiu platforms, it will simply expose port 1
of the GCA and the other 3 ports do nothing.
2021-10-05 09:47:03 -07:00
Nathan Strong 2715b4c9c0 get gamecube adapter working 2021-10-05 09:23:08 -07:00
Nathan Strong c832828ddb Figured out the cause of crash
== DETAILS
cause of crash: trying to deference init when it's null
the reason it was going into deregister: the HID/VID lookup was
failing because it wasn't getting initialized first
cause of 2nd crash: the "end of pad list" method looked for an entry
with a magic value, so we add an end marker
2021-10-05 09:23:08 -07:00
Nathan Strong a4d8ce7753 Try to support multi-pad HID devices
== DETAILS
I tried to modify the joypad connection interface to support
multi-pad HID devices ... it doesn't work. I'm not sure why.
2021-10-05 09:23:08 -07:00
Nathan Strong 9846ebb171 enable GCA adapter, minor cleanup
== DETAILS

I'm going to need to re-implement the abstraction between HID device
and gamepad; the changes here lay down some foundation for that work.

- reduce logging priority of some statements I modified while debugging
- factor out the pad driver lookup into its own method
- fix so the pad driver list isn't re-initialized every invocation
- add the button() method for the GCA driver
2021-10-05 09:23:08 -07: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
p-sam 54d2ac9f43 libnx: Splitted Joycons button mapping
- Minus/Plus is always Plus when splitted (JOYPAD_START)
- StickR/StickL is always StickL when splitted (JOYPAD_L3)
2021-10-01 20:18:54 +02:00
twinaphex fde3406d1b Get rid of input_event_get_osk_ptr/get_osk_grid 2021-10-01 07:37:33 +02: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 12c81bc073 Replace input_state_get_ptr call 2021-09-30 21:31:37 +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
twinaphex e886e908d5 Create consistent naming conventions - use retroarch_ instead
of rarch_ for some functions for all functions coming from retroarch.h
2021-09-28 12:56:10 +02:00
twinaphex 8ef9065c86 Get rid of menu_driver_is_alive - we don't want these one/two-line getters/setters anymore 2021-09-28 10:27:00 +02:00
grant2258 a327fdb6fe
add mouse relative check and set appropiatley to fix issue (#12994)
* re add this after failed rebase

* update

* temp fix for device friendly naming as it is for testing

* add device friendly names in the appropiate place

* add/remove hotplug dev to ra input mouse port list

Co-authored-by: grant2258 <you@example.com>
2021-09-24 18:31:20 +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
M4xw 931eb3221b [LIBNX] Fix Split Joycon 2021-09-23 13:45:22 +02:00
twinaphex d2af43d457 Cleanups 2021-09-20 21:08:53 +02:00
twinaphex eb895f9947 move more code out of retroarch.c 2021-09-18 21:14:15 +02:00
gblues 78858a9474
Fix analog inputs on HID devices (#12991)
== DETAILS

File this one under "I'm not sure how this ever worked."

I mean, it did (in 1.8.8). I'm not sure what changed, but ultimately what I did was
a bunch of comparative testing against 1.8.8:

- I confirmed the packet data was still being read successfully
- I confirmed that the axis value being passed into pad->get_axis() had
  not changed
- I confirmed the work done in `gamepad_read_axis_data()` was working the same
  between 1.8.8 and master

With the only difference between 1.8.8 and current being the return value from
`gamepad_read_axis_data()`, I just rewrote the method to work properly, and
also fixed up the default axis mapping.

I tested this with a sixaxis controller and GCA, configuring the analog-to-digital
control override to use the right stick.
2021-09-15 03:30:05 +02:00
twinaphex 90775e7306 Silence warnings/errors 2021-09-13 20:30:22 +02:00
twinaphex 3c69a941da Move code over to input_driver.c 2021-09-13 18:33:53 +02:00
jdgleaver 12f787547c
Add workaround to fix keyboard input when using x11+udev (#12981) 2021-09-13 18:02:40 +02:00
Autechre e24440d4a9
Merge pull request #12976 from grant2258/mouse_index
this function is called more than once dont use static
2021-09-13 11:44:28 +02:00
grant2258 88b15c1b1d this function is called more than once dont use static 2021-09-12 20:58:49 +01:00
twinaphex ad4b51b903 Move cde from retroarch.c to input_driver.c 2021-09-12 19:27:12 +02:00
twinaphex b5138b6122 Move input_config_get_bind_string to input_driver.c 2021-09-12 17:41:00 +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 276b4fd72c Move more code over from retroarch.c to input_driver.c 2021-09-07 13:08:31 +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
bulzipke 8adc24ecbc
(3DS) Add bottom screen menu (#12470)
* (3DS) Add bottom screen menu
 -> User can save/load state on botom screen with thumbnail.
 -> Call a save_state_to_file() when RAM state has data to write a disk.
 -> If the bottom screen needs updating, swap the bottom framebuffers.

Add: SAVE/LODE STATE TO RAM
 -> This is useful for devices with slow I/O
 -> 3DS bottom save state use CMD_EVENT_SAVE_STATE_TO_RAM
 -> 3DS bottom load state use CMD_EVENT_LOAD_STATE when RAM state has no data
 -> 3DS bottom load state use CMD_EVENT_LOAD_STATE_FROM_RAM when RAM sate has data

* Rewrite path_get_state to retroarch_get_current_savestate_path

* Fix unterminated state_path
2021-09-03 18:14:03 +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
sonninnos ca311246b1 C89 buildfix 2021-08-24 22:32:47 +03:00
Autechre dbb74ba5ab
Merge pull request #12823 from markwkidd/input-drivers
input_driver refactor
2021-08-24 18:45:20 +02:00
Autechre 4e188c0f26
Merge pull request #12830 from icculus/udev_keyboard_detect_fix
udev_input.c: Look for "ID_INPUT_KEY", not "ID_INPUT_KEYBOARD"
2021-08-24 18:42:38 +02:00
sonninnos 957b71cfdc (WINRAW) Fix crash when overlay is enabled 2021-08-24 17:03:28 +03:00
sonninnos 26d6c8243a (WINRAW) Add missing analog keybinds 2021-08-21 22:01:12 +03:00
Mark W. Kidd 5f834a8cb3 input_driver refactor 2021-08-19 20:02:39 -04:00
Ryan C. Gordon 9a6faa3ddd
udev_input.c: Look for "ID_INPUT_KEY", not "ID_INPUT_KEYBOARD"
This fixes programs using /dev/uinput to create a virtual keyboard failing
to be detected on startup. Usual symptom is some sort of GPIO-based
controller that looks like a keyboard to the OS and can control
EmulationStation, but fails to work in-game unless you restart the program
while the game is running (in which case udev_input.c's hotplug code, which
was using the correct key, would pick it up).
2021-08-19 16:00:57 -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
twinaphex 20ef0667b0 Add initial webOS port courtesy of informatic/webosbrew/mariotaku 2021-08-11 20:04:11 +02:00
twinaphex 013dd30bde We have to uniquely name pointer_status struct for both dinput
and winraw because otherwise Griffin builds will fail
2021-08-11 03:44:34 +02:00
twinaphex 13a2d2419f (PSL1GHT) Fix function prototype for 'button' pad driver
(Task save) Fix warning in platform port
2021-08-09 20:25:27 +02:00
twinaphex bb30dc3dee After gblues' change, the rest of the button function callbacks
for the other joypad drivers still had int16_t as the return type
instead of int32_t - fix this
2021-08-08 21:48:19 +02: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
Autechre 390f914357
Merge pull request #12573 from markwkidd/wayland-input
wayland input driver multimouse/multigun fixup
2021-08-07 20:25:23 +02:00
ComradeEcho 35c2ec993b
Remove code that duplicates controllers 2021-08-07 11:43:50 -05:00
Adie ce4fce12c0 Implement changes to fix macOS controller duplication bug 2021-08-06 22:02:43 -05:00
Autechre 1661d4e969
Merge pull request #12756 from sonninnos/winraw-alt-sticky
(WINRAW) Alt sticky fix
2021-08-07 03:54:43 +02:00
twinaphex f459472f6d Fix leaks - we were not honoring the ownership policy/create rule
for various CoreFoundation functions with 'Copy' or 'Create' in the title
2021-08-07 03:46:08 +02:00
sonninnos 6170fc45ae (WINRAW) Cleanups 2021-08-07 04:31:32 +03:00
twinaphex c1ed271a12 (Mac/IOHIDManager) Fix leak of elements_raw and elements in iohidmanager_hid_device_add_device 2021-08-07 03:30:17 +02:00
sonninnos 079070daf7 (WINRAW) Prevent Alt getting stuck when Alt-Tabbing 2021-08-07 04:24:20 +03:00
sonninnos 2178f9d36f (WINRAW) Add pointer status 2021-08-06 23:12:38 +03:00
sonninnos bd3533f05d Friendly names for mice where available 2021-08-06 00:21:17 +03:00
sonninnos 2c47d94bf5 (WINRAW) Change legacy virtual keys to scan codes 2021-08-04 19:23:56 +03:00
Mark W. Kidd 109f4fafec wayland input driver fixups 2021-08-02 18:05:24 -04:00
amtz d0612f906d Limit udev device scan to subsystem 'input'
This change makes the call to 'udev_enumerate_scan_devices' much faster.
In particular, for some bluetooth devices, this function may implicitly
read its battery's virtual file 'uevent', e.g.

/sys/devices/*/usb1/1-1/*/bluetooth/hci0/*/power_supply/hid-*-battery/uevent

Reading this file may (for unknown reasons) block up to 10 seconds.
Since udev_enumerate_scan_devices is called 4 times (for keyboard,
mouse, touchpad, and joypad) during startup this may cause a
considerable delay.

Limiting the scan to subsystem 'input' yields the same devices but makes
the scan faster and does not read 'uevent' of the input controller's
power_supply.
2021-08-02 13:17:00 +02:00
sonninnos 2962707d5f (WINRAW) Trigger joypad driver reinit on DEVICECHANGE 2021-08-01 22:35:27 +03:00
Autechre 0c2299396c
Merge pull request #12711 from Poligraf/retrofw
Add retrofw port
2021-07-29 13:41:13 +02:00
Poligraf 9000e81498
Add retrofw port 2021-07-29 22:16:59 +12:00
R-YaTian 1d988d374a
libnx: Fix split joycons 2021-07-29 12:18:11 +08:00
Autechre 910d729d50
Merge pull request #12661 from markwkidd/menu-input
consolidate menu_input.h declarations
2021-07-29 01:14:06 +02:00
p-sam 0f5f8798ea libnx: input fixes
- fix poll missing for controller 2-8
- fix layout not applied correctly and hangs when splitting joycons
2021-07-28 21:49:09 +02:00
twinaphex 9e1ad64e89 (winraw_input.c) Fixed some typos and style nits 2021-07-25 16:36:48 +02:00
Ben Templeman 48e4b02fad Fixed absolute co-ords for CRT and non crt users
Fixed typo

added delay between winraw rect change to fix roslution changing issues.

added more comments

added delay reset

Fixed typo

updated comments

added RECT size to log

updated logging
2021-07-25 11:06:34 +01: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
Autechre 1071c93c82
Merge pull request #12609 from markwkidd/input-drivers
add source comments to input_drivers.h
2021-07-23 06:33:08 +02:00
Mark W. Kidd 8038d899d6 add documentation to input_driver.h 2021-07-19 12:05:28 -04:00
Ash Logan 27b02d66aa (Wii U) Ignore some bogus KPAD results
This API is completely bonkers, seems to have no idea what the error 
conditions are
2021-07-19 16:59:41 +10:00
Mark W. Kidd 64672b4b63 consolidate menu_input.h declarations 2021-07-15 14:19:38 -04:00
John Parton f6aeb717ba Basic rs90 build
DINGUX_BETA has clock_gettime libogc
Add tinyalsa support to rs90
2021-07-13 11:36:48 -05:00
Nicolas Roehm b3c929499e
[Upd] error message 2021-07-10 14:10:12 +02:00
Aleksey Samoilov 146804fcbc Remove xdg_shell_v6 support 2021-07-10 14:22:58 +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
Autechre ed3412c004
Merge pull request #12618 from markwkidd/input-remapping
consolidate and comment input_remapping.h
2021-07-08 14:22:51 +02:00
Autechre 7dba607d76
Merge pull request #12579 from grant2258/touchpad
udev fixes add pointer pressed to pointer device to allow udev users to access this device
2021-07-08 12:04:04 +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
M4xw d00c2a6407 [Libnx] Style nits 2021-06-28 17:38:17 +02:00
p-sam ac8a977492 Replace deprecated HID APIs 2021-06-28 17:38:17 +02:00
p-sam 1bc588acbd Fix building with libnx 4.0.0 2021-06-28 17:38:17 +02:00
Grant d6a1c21fe1 udev fixes] 2021-06-26 23:09:47 +01:00
jdgleaver 3a82cf980d 'Analog to Digital Type' usability improvements 2021-06-23 14:28:45 +01:00
Autechre 7b47f5f49a
Merge pull request #12556 from sonninnos/winraw-mouse
(WINRAW) Mouse access violation fix
2021-06-23 00:19:37 +02:00
Grant c73592d379 skip mouse with no button errors and keep the rest 2021-06-22 23:00:50 +01:00
Grant 4ba0ba4c70 fix up logging that can confuse users 2021-06-22 22:06:19 +01:00
sonninnos 11dba60ea7 (WINRAW) Mouse access violation fix 2021-06-22 19:47:56 +03:00
Autechre bd937eb49f
Merge pull request #12536 from grant2258/udev
only add mouse if it has buttons and add vebose device friendly names
2021-06-22 17:23:19 +02:00
Autechre 6986caed5b
Merge pull request #11388 from pjft/dual-lightgun
Change udev driver for dual lightgun support in X11
2021-06-21 18:06:35 +02:00
Autechre 0a75b51b29
Merge pull request #12534 from jdgleaver/input-port-remapping
Add support for mapping multiple controllers to a single input device
2021-06-21 15:28:34 +02:00
jdgleaver 973f5cda6d Add support for mapping multiple controllers to a single input device 2021-06-21 12:42:38 +01:00
Grant 6e2709d62a cleanup 2021-06-19 08:47:35 +01:00
Grant eef86d5f72 fix game focus mode 2021-06-19 07:59:06 +01:00
Grant 863aaa5b9d Revert "fix game focus mode on udev as well"
This reverts commit 54eed63418.
2021-06-19 07:44:02 +01:00
Grant 54eed63418 fix game focus mode on udev as well 2021-06-19 07:00:09 +01:00
Grant 7915b040a9 only add mouse if it ha buttons and add vebose device friendly names 2021-06-18 03:55:25 +01:00
Mark W. Kidd f74fddf3fd do not duplicate port 0 mouse and gun inputs to other ports 2021-06-09 17:20:13 -04:00
Ben 4b2f27eff8 Ver 0.9.2 SR2 (Switchres API) Implimantation
Fixed SR close match refresh bug.
Added menu high resolution option.
Fixed desktop restore bug cuusing endless resolution change requests.
Fixed file conflicts
Added destop restore resolution back in for manu only.
Pulled Switchres fixes.
Added better PI rsolution support.

Ver 0.7 SR2 (Switchres API) Implimantation

Removed HH experimetal check. This is better done via teh switchres.ini at present.
Fixed refresh rate bug. Now new resolution and refesh is added correctly.
Removed SR deinit from menu restore. Meanu now stays at last content resolution.

Ver 0.6.2 SR2 (Switchres API) Implimantation

Fixed super resolution bug casuing abnormal video size and aspect ratio
Fixed logging issue casuing seg falts on RA exit

Ver 0.6 SR2 (Switchres API) Implimantation

Ver 0.2 SR2 (Switchres API) Implimantation

Added forced super resolutions.
Added Multi-monitor/monitor selection support.
Added desktop resolution restore when switching back to menu only.
Added new menu items for 31KHz standard and 120hz monitor profiles.
Added new menu item INI. load monitor profile from switchrss.ini.
Fixed winraw driver. Coordinates new refreshed after a resolution change.
Fixed Menu aspect ratio in super resolutions.
Removed static glabals. These have been added to videocrt_switch struct.

Ver 0.1 SR2 (Switchres API) Implimantation

Removed old CRTSwitchRes method. Added new SR2 API implimantaion.
Resolution swithcing is now done by switchres libs. Both Linux and Windows
working with native and super resolutions. Working multi-monitor support
with monitor index selection. Working 31KHz support with standard and 120Hxz
modes. The monitor index selection is still done via the RA UI. Only choose
native and 15KHz form the CRT options in the RA UI as all options are now set
in the switchres.ini. All other CRT optoins in the RA UI currently do nothing.

Added SR wrapper to fix compile issues. Added back RPi functionality

Fixed windows resize/scaling issues on resolution change

Thanks @Calamity no more need for crt_switch_driver_refresh()

Fix broken case after prevous commit

Monitor preset options 15/31KHz now active. Added new meu option.

Moitor persets can now be choosen fom the RA UI. 15KHz and 31KHz will set
arcade_15 and aracde_31 respectivly. New option INI, if this is chosen your
monitor preset will be selected from your switchres.ini file.

Added 3KHhz, 120Hz. for old RA users. Renamed 31KHz to 31 KHz,  Standard

Fixed winraw input coordinates after switching resolution.

Code cleanup

Fixed menu aspect ratio issue

Added menu resolution restore after closing content

Fixed aspect ratio after menu resolution restore.

code clean up

Fxed menu Resulition Restore Aspect Ratio. When SR uses non integer scalled resolution.

super width bug with restoring menu resolution fix

added super resolution check after setting desktop resolutoion variables

when menu active only sr_deinit() used to restore desktop mode.

Fixed menu sr_deinit bug. now setting sr_active false

Removed static globals, added them to video_switch struct

Fixex compile bug due to comment //

Fixed compile issues doe to c++ comments in teh switchres_wrapper.h

Temporarily removed SR2 logging to fix compile isses for c90

added logging back in. Removed support for winnt and osx

Added define for C89. Disabled SR if defined C89

Removed all RA compile fixes fro C89 C90 etc. Swithing now working again.

Put Switchres behind HAVE_SR2. HAVE_SR2=no by default. --enable-sr2

Ver 0.5 SR2 Implimentation.

Ver 0.4 SR2 Implimantation.

Bake SR inside RA

Removed temporary log files

Disable switchres when C89/C99 builds.

Removed C89 and C90 checks for SR

Fixed switchres_wrapper.h location

Ver 0.3 SR2 Implimenation

Dissable logging for C89 __STDC__

Fix For RPi

fixed missing EOL

fixed RPi function definition

added vidrocrt_switch stuct to RPI funcion

fixed xoffset for RPi

Removed old RPi function call

SR disabled for videocore until VC4 switching ported

Reverted back to state 5c8a56c Bake SR inside RA

Use native win32 api for threads.

Fix static lib linking
LIBERROR would be defined twice otherwise + improper function names prefixed by __imp_

Added lidstc++ to makefile.common for switchres

Fixed RPi switching. Disabled Switchres for videocore unill it is ported.

removed RAA.log. Should not exist

Added check for when SR fails to set mode with an aspect ratio fix.

added video driver re init for RPi

GB, GBA and GBC core check, adjusted reseolutions and scale. Please turn on integer scalling in the RA UI

Added logas back in. Checking STDC verstion >= C11

Fixed c89 for loop declaration.

Code clean up. Added new functions

Fix resolution switching bug introduces with HH code clean up.

Fixed menu restore bug on closw content after code clean up

Moved SR logging to relevant RA logs

Update makefile. Checks for X11 and xrandr

fixed makefile

Use native win32 api for threads.

Fix static lib linking
LIBERROR would be defined twice otherwise + improper function names prefixed by __imp_

Update switchres_wrapper.* header comments

Update year copyright

DRMKMS: build only if libdrm has the required version

XRANDR: build only if xrandr is available

Simplified maklefile

Fixed RPI compile error with unsued functions.

As before

Disable Griffin. No switching support available. Never has been

Removed log file 1

Added Win32 static define

Added SR source

Removed Videocore check on destroy SR

Moved SR deinit to trigger earlier on RA exit.

Fixed compile error after upstream rebase

Fixed aspect ration bug cused by super resolutions. Temporarily disbabled SR logging

Re inabled runtim eSR loggind. Disableed all RARCH logging on retro_deinit_drivers

Removed srdeinit from menu restore. Menu stays in current reolution until a fix can be found

Fixed refresh rate changes when no reolution change is detected.

Forgot to add teh resolution cahge in with the refresh change oops

Fixed endless no detection log.

Removed HH check. This can been better adjusted using the switchres.ini

fixed compile issue

Added better PI crt switching and fixed typo

Pulled Swicthres fixes. Updated desktop restore resolution.

removed unused makefile

Lockec menu refresh to 60hz

fixed missing new line

Fixed file conflicts

Forced 640x480@60 for menu

Added high resolution menu option

Removed item logg checker

Fixed typos

Removed unused functions

Fixed SR close match refesh bug.

Fixed typo
2021-06-04 08:32:56 -07:00
jdgleaver 8e54b4cec9 (Show Inputs on Overlay) DISABLE_MENU=1 buildfix + Qt settings update 2021-05-26 18:15:23 +01:00
Francisco José García García 87a7795331 [VITA] Fix input driver for PSTV 2021-05-21 10:54:02 +02:00
twinaphex 35543ecd91 Move defines files over to libretro-common 2021-05-18 22:15:04 +02:00
unknown de4343caeb PSL1GHT joypad restored 2021-05-16 20:04:43 +02:00
David Carlier 3b7e0a8db1 FreeBSD build fix proposal 2021-05-01 15:37:14 +01:00
Szunti 3191fec54c Fix crash in sdl input driver when analogs are bound. 2021-04-22 03:20:39 +02:00
twinaphex cfe9d60f51 Get rid of button_is_pressed 2021-04-15 06:55:35 +02:00
twinaphex 3841fecc59 Cleanups 2021-04-11 17:01:13 +02:00
twinaphex f1cf5ceb82 (input drivers) Cut down on code duplication 2021-04-11 16:31:46 +02:00
twinaphex 05a2623875 (udev input) Cut down on code duplication 2021-04-11 06:37:49 +02:00
twinaphex 1f506615d3 (x11_input.c) Cut down on code duplication 2021-04-11 06:29:36 +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
Jonathan 5c6cd1b48a
Add scaling to pointer input (#12213)
So far, if display is scaled, overlays gets correctly drawn but touch
input is not correctly scaled, resulting in an unusable overlay.

This happens for touches in menu too.

This commit aims to introduce this scaling factor adding it to the
config file, eg:

input_touch_scale = "2"
2021-04-06 13:15:43 +02:00
twinaphex 2fbcc99b24 RARCH_LOG_BUFFER - doesn't need early return 2021-04-04 20:05:00 +02:00
Todd Laney be8dd0dba1 prevent crash on controller connect.
disable system button gestures on iOS 14.
remove deprecation warnings.
2021-04-03 09:28:49 -07:00
jdgleaver 0a08437e0a Add OpenDingux Beta support 2021-03-25 16:19:42 +00:00
twinaphex 943c3f2f21 One DISABLE_MENU buildfix 2021-03-23 13:35:41 +01:00
twinaphex 76ddfa022e Get rid of RARCH_LOG in wayland_common - gets rid of warning/error 2021-03-22 23:35:14 +01:00
twinaphex e5ca68a518 Simplify video_driver_get_ptr 2021-03-21 17:33:44 +01:00
sonninnos 1e95683c06 (WINRAW) Key position fixes 2021-03-20 00:58:11 +02:00
twinaphex 938c8f3abc Fix some tvOS warnings 2021-03-15 01:52:18 +01:00
sonninnos ce29b70ae9 (X11) Remove useless XGrabs 2021-03-08 19:58:36 +02:00
Toad King c29241ec9e emscripten: only report back one screen pointer for rwebinput
fixes lockup when clicking on an overlay
2021-02-15 15:09:37 -06:00
sonninnos de7da62acd (WINRAW+DINPUT) Mouse grab cleanup 2021-02-09 18:42:07 +02:00
twinaphex 3607d03ff8 Get rid of warning on older OSX SDK versions 2021-02-09 16:20:40 +01:00
twinaphex bf806f09ac kIOHIDElementTypeInput_NULL is apparently not available on previous OSX SDK versions 2021-02-09 16:14:20 +01:00
sonninnos aad12cc663 (Windows) Mouse grabbing/clipping with alt-tab 2021-02-07 20:18:04 +02:00
sonninnos e39ade0f05 (WIN32) Cursor clipping for grabbed mouse 2021-02-02 14:15:58 +02:00
sonninnos 94446ab488 (WINRAW) Prevent outside window mouse clicks when grabbed 2021-02-01 23:22:34 +02:00
Autechre e282cfe2fe
(IOHIDManager) Fix enumeration value 'kIOHIDElementTypeInput_NULL' (#11944)
not handled in switch warning
2021-01-26 19:39:36 +01:00
jdgleaver b9691597d1
Add 'L2 + R2' menu toggle gamepad combo (#11935) 2021-01-24 16:33:13 +01:00
Autechre 7ea1d7d0da
Revert "Mac buildfixes (#11933)" (#11934)
This reverts commit 18a6880900.
2021-01-24 03:56:05 +01:00
Autechre 18a6880900
Mac buildfixes (#11933)
* (Metal/WindowListener) Fix duplicate symbol errors by
moving implementation of WindowListener to cocoa_common.m

* (Apple) Cleanup some conditionals

* (Cocoa) Cut down on OSX ifdefs in Cocoa-specific code
2021-01-24 03:53:10 +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
jdgleaver ce47fe7e28 (X11) Enable keyboard input when mouse cursor is not inside the RetroArch window but window still has focus 2021-01-20 10:24:07 +00:00
Twinaphex eea07ea367 (COcoa GL/Cocoa Common) Refactor code for eventual splitting up
of cocoa_gl_ctx.m into two files
2021-01-18 15:41:30 +01:00
pjft 0a83817f25
Merge branch 'master' into dual-lightgun 2021-01-18 11:23:44 +00:00
twinaphex 875cb06a93 (iOS) Fix signature on apple_gamecontroller_joypad_init 2021-01-16 20:05:53 +01:00
jdgleaver b1ee5a2421 (X11) Fix mouse input when mouse is grabbed 2021-01-16 13:57:25 +00:00
myfreeweb 65b1ae8a41
Remove incorrect ifdef for Wayland on non-Linux - fix #10056 2021-01-14 16:36:14 +03:00