Commit graph

11867 commits

Author SHA1 Message Date
Anonymous Maarten d1c5038f16 testautomation: don't do float equality tests
(cherry picked from commit 474c8d0073b0fb4b14b65b79c7e620db1332e4f3)
2024-01-09 06:06:46 -08:00
Sam Lantinga f62d1220ac Restore the previously initialized subsystems after the Init/Quit test
Fixes https://github.com/libsdl-org/SDL/issues/8796
2024-01-08 14:32:52 -08:00
Sam Lantinga 4c11307a4e Only initialize audio drivers that have been requested
If testautomation is running with only a specific audio driver enabled, we shouldn't try to open other ones, as they might fail.

Fixes https://github.com/libsdl-org/SDL/issues/8797
2024-01-08 13:38:29 -08:00
Simon McVittie b1a82b5772 gamecontroller: Fix function name in cherry-picked documentation
SDL_GetGamepadAxis() is a SDL3-specific name: SDL2 calls gamepads
"game controllers".

Fixes: d3c21666 "gamepad: Clarify range and direction of axes"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-08 11:09:55 -08:00
Anonymous Maarten 3ff56fda1a testautomation: only require accelerated renderer with non-dummy video driver
Backported from SDL3 commit 85e3099b.

Co-authored-by: Simon McVittie <smcv@collabora.com>
Resolves: https://github.com/libsdl-org/SDL/issues/8799
2024-01-08 11:01:06 -08:00
Simon McVittie 64754f3a2a test: When listing test-cases, say which ones are disabled
When a test has been disabled because it's known not to work reliably
or it's a test for unimplemented functionality, we probably don't want
to encourage developers and testers to run it and report its failures
as a bug.

Helps: #8798, #8800
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-08 09:50:11 -08:00
Sam Lantinga d3c21666de gamepad: Clarify range and direction of axes
It would be easy to assume that all APIs that reference
SDL_JOYSTICK_AXIS_MAX work the same way, but they do not: triggers
generally use the full signed 16-bit range in the lower-level joystick
API, but are normalized to be non-negative by the higher-level gamepad
API.

We also never said explicitly which direction is positive here.
Experimentally, it's right (X), down (Y), and pressed (triggers).

Resolves: https://github.com/libsdl-org/SDL/issues/8793
Signed-off-by: Simon McVittie <smcv@collabora.com>

(cherry picked from commit 059fb560ba98df5668e1cf1c88560b3156e0fb66)
2024-01-08 09:48:04 -08:00
Sam Lantinga 5e12e4b813 Updated documentation for SDL_HINT_SHUTDOWN_DBUS_ON_QUIT
(cherry picked from commit 3deefa6b438922d5d55cb881482f8550f51978b7)
2024-01-07 14:24:56 -08:00
Semphris 8c4e4d57b3 Add hint to make SDL handle dbus_shutdown()
(cherry picked from commit 2348e8b6a2598af2790937a62ee49cdb02d6bd28)
2024-01-07 14:23:57 -08:00
Sam Lantinga ca3b8fe91d Fixed build 2024-01-06 08:33:30 -08:00
Sam Lantinga e1c3dcb403 Don't try to send the PS third-party feature request to the Logitech G815 keyboard
Fixes https://github.com/libsdl-org/SDL/issues/8373

(cherry picked from commit d3daba791aafa9a10db5b948fc33e62f75dff7e4)
2024-01-06 08:30:20 -08:00
Sam Lantinga c309546e8c Fixed warning: no previous prototype for function 'SDL_GetGameControllerTypeFromString' [-Wmissing-prototypes] 2024-01-06 08:23:55 -08:00
Sam Lantinga 0e913a22db Renamed ShowTextInput/HideTextInput to ShowScreenKeyboard/HideScreenKeyboard on Android
This better reflects the actual implementation and makes SDL_HINT_ENABLE_SCREEN_KEYBOARD work on Android.

Fixes https://github.com/libsdl-org/SDL/issues/8652

(cherry picked from commit 014a63b4b5b94ce50f329eddb345f5434654305b)
2024-01-06 08:23:11 -08:00
Sam Lantinga be29ca0189 Use the application requested size to determine automatic orientation on iOS
Fixes https://github.com/libsdl-org/SDL/issues/8201

(cherry picked from commit e3b5999bb4fe9bc8413630215d928f90347073d1)
2024-01-06 07:39:25 -08:00
Sam Lantinga f892ae10d6 updateKeyboard should use the SDL window's screen instead of the view window's screen, which may be nil.
Fixes https://github.com/libsdl-org/SDL/issues/8200

(cherry picked from commit 3a9a52fe6c40aee8d174bb756b4a339d35386633)
2024-01-06 07:37:14 -08:00
Sam Lantinga 674e894574 Added mapping for the RX Gamepad, e.g. Pandora Box 7
Fixes https://github.com/libsdl-org/SDL/issues/8217

(cherry picked from commit e100992c17ac58c243aa5b57151189963f6d1d4b)
2024-01-06 06:19:30 -08:00
J. Neuschäfer b1ad45acdd Fix memory barriers on ARMv5
The ARM926EJ-S Technical Reference Manual states:

> You can only access CP15 registers with MRC and MCR instructions in a
> privileged mode. CDP, LDC, STC, MCRR, and MRRC instructions, and unprivileged
> MRC or MCR instructions to CP15 cause the Undefined instruction exception to
> be taken.

Furthermore, `MCR p15, 0, <Rd>, c7, c10, 5` (later called Data Memory Barrier)
is not specified for the ARM926. Thus, SDL should not use these cache
instructions on ARMv5.

(cherry picked from commit 139a0931a3ee9808f13e7faecdf9fc4590348f9e)
2024-01-05 09:01:30 -08:00
jfmu eb1b9b418c SDL_audio.c: Fix crash if we switch from direct output to streaming, and if the buffersizes change. 2024-01-04 19:41:38 -05:00
Ozkan Sezer 7b4f1ef01b yuv2rgb: warning fixes and comment out unused code
(cherry picked from commit 46de6241d79c6f4531dbb729b2ed5992ec61b4a2)
(cherry picked from commit 0bd77a5b93494ca88bfd1a86fe106e7bb1d90133)
(cherry picked from commit f341c06552c8618c1178287880fcb8775decfbd3)
(cherry picked from commit 4d2f9f3a324884add7245e8cd13ee06af907c306)
(cherry picked from commit 06f8f9a891194d86ff93a5856f80510d39b75272)
(cherry picked from commit 0c4cb3d1539fefa66c05d131385e35fb2a205fa3)
(cherry picked from commit 0dad56354ceb4222be569e6969475adeec5a1ca1)
2024-01-03 09:07:50 -05:00
Vicki Pfau 41bf6b5a51 Add basic rumble support to Steam Deck
(cherry picked from commit bec1b8f849b782ca7d815337380c5f2b42ed60ce)
2024-01-01 21:48:41 -08:00
Sam Lantinga 0fc3574464 Updated copyright for 2024 2024-01-01 13:19:49 -08:00
Sam Lantinga d649f95723 Use GNU sed if available
Fixes update-copyright.sh on macOS, which doesn't support the -b option.

(cherry picked from commit a357021800b4af2b850476bcd87be5648923b847)
2024-01-01 13:18:35 -08:00
Sam Lantinga 4f8dd2d39d Speed up processing of update-copyright.sh
(cherry picked from commit 78ccadd5a22bd60c015598fa0abad92705d5ea0f)
2024-01-01 13:18:35 -08:00
Simon McVittie b02c8267f9 sdl2.m4: Call $PKG_CONFIG rather than hard-coding pkg-config
When cross-compiling, pkg.m4 will set the PKG_CONFIG variable
to a suitable pkg-config executable, which might be a
host-architecture-prefixed name like aarch64-linux-gnu-pkg-config. This
ensures that we will use a suitable search path that is suitable for
the host architecture (the machine we are compiling for) rather than
the build architecture (the machine we are compiling on) to find
dependency libraries like SDL. When using pkg-config as a substitute
for sdl2-config, we will similarly need to use the
host-architecture-prefixed pkg-config.

Setting the PKG_CONFIG environment variable is also the canonical way to
request that a different pkg-config implementation be used, if that
becomes necessary for some reason.

Co-authored-by: Helmut Grohne <helmut@subdivi.de>
Bug-Debian: https://bugs.debian.org/1059749
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-01 08:27:02 -08:00
SDL Wiki Bot 0f8f4f6764 Sync SDL3 wiki -> header
(cherry picked from commit 5df3eac925af8491259032ed275c1ec3e0e8e80b)
2023-12-27 14:49:59 -08:00
Reilly Brogan 8030e7546a Fix static build with libdecor 0.2.0
(cherry picked from commit 4ce935b9106a0311436e41c5f28f00db30a93de1)
2023-12-26 16:30:32 -08:00
Reilly Brogan 5dfb0c19c8 Fix static build with libdrm 2.4.116 2023-12-26 16:29:01 -08:00
Alynne 2afbb5713c Add Access Controller
(cherry picked from commit cae657140c9436a18dac94356efeb7b2a60208a0)
2023-12-26 09:58:47 -08:00
Tyson Whitehead 3b1e0e163b Try SDL_UDEV_deviceclass to detect joysticks even if in a container
The udev container issue is mostly to do with device notifications
and netlink. The device classification stuff just pokes file in /sys
and /run/udev. Doesn't hurt to try it first for classifying joysticks
and then fall to the guess heuristics if it fails.
2023-12-24 16:02:38 -08:00
Sam Lantinga 857e5b08c3 Fixed trying to add a game controller mapping for the accelerometer on iOS
Fixes https://github.com/libsdl-org/SDL/issues/8716

(cherry picked from commit 0e5ea3cc4b98d061688a098836254ab6470b07e8)
2023-12-24 11:22:22 -08:00
Sam Lantinga 49eb375a59 Added SDL2.framework to the embedded frameworks for SDL test programs
Fixes https://github.com/libsdl-org/SDL/issues/8737
2023-12-24 09:17:48 -08:00
Sam Lantinga aeda6a8e6f Record the initial input report mode and only restore simple mode if that's what we started with
Fixes https://github.com/libsdl-org/SDL/issues/8108
Closes https://github.com/libsdl-org/SDL/pull/8115

(cherry picked from commit c3d84c3342f61b808462c7437784af5df4906273)
2023-12-24 08:23:36 -08:00
Sam Lantinga fe76c40716 Added a runtime check for BLUETOOTH_CONNECT in addition to BLUETOOTH (thanks @perepujal!)
Fixes https://github.com/libsdl-org/SDL/issues/8731

(cherry picked from commit bb0e0ae0809c42e5a20f7e13aad8a34b8e7145cf)
2023-12-24 06:51:48 -08:00
Julian Uy 884c21c565 Use common generic syscond for platforms with no cond implementation 2023-12-24 06:35:59 -08:00
Julian Uy 557d8e2f24 PS2 use WaitSemaEx for waiting for semaphore with timeout 2023-12-24 06:34:45 -08:00
Sylvain 3a8032f491 Make sure the string is terminated, fixed invalid read in SDL_PrivateGameControllerParseControllerConfigString()
(cherry picked from commit 312f98c2a1edaf9590fc06d10f201996c059d869)
2023-12-23 12:58:54 -08:00
Lukas Senionis e7c4575719 Use crc16 return value when calculating GUID
Fixes the regression introduced by 919cd56b20

(cherry picked from commit a2e05480d63cac530269c846422e7de3b44e830f)
2023-12-21 07:00:57 -08:00
Ozkan Sezer 39a0013900 Makefile.os2: -DSDL_USE_LIBICONV to fix linkage for GNU libiconv option 2023-12-21 08:55:04 +03:00
Ozkan Sezer ca26cde4e1 SDL_config_os2.h: enable SDL_JOYSTICK_VIRTUAL 2023-12-21 08:55:02 +03:00
Sam Lantinga eba591a910 Fixed Xcode project 2023-12-20 19:42:43 -08:00
Sam Lantinga 919cd56b20 Use the original manufacturer and product strings for the joystick CRC
This allows the most information possible for the CRC string, which is used to differentiate controllers with the same VID/PID.

Fixes https://github.com/libsdl-org/SDL/issues/8724

(cherry picked from commit 1f1ee6f77c492e17a9691c367110c11529fab3fb)
2023-12-20 19:25:35 -08:00
Ozkan Sezer d76097dc5e fix os/2 and watcom builds after commit 7bb0e839a6 2023-12-21 01:11:24 +03:00
Sam Lantinga 2fecefce19 Updated Xcode project with Steam Deck controller driver 2023-12-20 13:29:58 -08:00
Sam Lantinga 7bb0e839a6 Added Steam Input API support for game controllers
Added support for getting the real controller info, as well as the function SDL_GameControllerGetSteamHandle() to get the Steam Input API handle, from the virtual gamepads provided by Steam.

Also added an event SDL_CONTROLLERSTEAMHANDLEUPDATED which is triggered when a controller's API handle changes, e.g. the controllers were reassigned slots in the Steam UI.

(cherry picked from commit c981a597dc7c69e7532796b3a206071807479d35)
2023-12-20 13:29:57 -08:00
Sylvain 9720672374 Fix compilation / same as sdl2-compat
testautomation_platform.c:351:28: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  351 |     result = SDL_SetError("%s", testError);
      |                            ^~
/home/slvn/release/Release_SDL/sdl2-compat/test/testautomation_platform.c:364:64: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  364 |                             "SDL_GetError(): expected message '%s', was message: '%s'",
(cherry picked from commit 56f111dffc2828d67fd8e0402b0fe1193c48ce26)
2023-12-20 22:29:51 +03:00
Vicki Pfau 5240071b1c Sync more Steam Controller header definitions for the Steam Deck
(cherry picked from commit a8f4f40d08a28ca0ef4f518509639f2553d8a123)
2023-12-20 06:50:54 -08:00
Ozkan Sezer 5773c347d5 test/watcom.mif: disable W201 warning for testautomation_stdlib.c. 2023-12-17 20:51:10 +03:00
Ozkan Sezer 3ac69c6210 test/watcom.mif: remove a stale rule. 2023-12-17 20:51:02 +03:00
Sam Lantinga 91f8b4dea2 Added a controller name for the Steam virtual gamepad
(cherry picked from commit 4d5949dcf64f2633b1b435fb0c22a3b0b44d855f)
2023-12-17 10:08:17 -08:00
Sam Lantinga 2aadef022e Pass through the name of the controller for the XInput mapping
(cherry picked from commit e6d88b254add377743de7bf33a7a4fec8cec79c3)
2023-12-17 09:32:54 -08:00