Commit Graph

210 Commits

Author SHA1 Message Date
Flyinghead 6fca05f00e sdl: set default axis direction for all axes
Fixes regression with known gamepads.
Only use initial state for unknown controllers.
Issue #2014
2025-07-22 15:24:05 +02:00
Flyinghead 8c07a2e1d6 sdl: detect half-axes using initial state. Fix axis range and direction
Assume that full axes are roughly centered at start up and determine
which axis are half ones, and the axis direction.
Fixes driving wheel pedals range to the expected [0, 32767].
Issue #2014
2025-07-18 11:38:15 +02:00
James 54b06a5c34
Recover DreamLink hardware after load state (#2003) 2025-07-10 20:32:00 +02:00
Rikki Gibson 4fe2f4760f DreamConn: do not lock mutex multiple times 2025-07-07 11:28:27 +02:00
Isaac Marovitz af043c55cd
CMake Refactors (#1979)
Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>
2025-06-24 16:33:12 +02:00
Flyinghead df93c069f2 sdl: add sdl_gamepad.cpp 2025-06-16 18:50:37 +02:00
Flyinghead 8801b2ae16 haptic: add sine effect. implement spring for midi FFB
Add sine effect to haptic api and stop using maple rumble for naomi FFB.
Emulate spring in midi FFB. Thanks to njz3 for his help on decoding the
protocol.
Don't use exponential scale for rumble when using haptic sine effect.

serialize Sh4OCache::writeBack/ThroughBufferCycles
2025-06-16 17:50:36 +02:00
Flyinghead 7e7f645f37 sdl: use SDL_HAPTIC_STEERING_AXIS instead of SDL_HAPTIC_CARTESIAN
tentative fix for Issue #1962
2025-06-13 11:58:19 +02:00
Flyinghead bb5bd71437 Merge remote-tracking branch 'origin/master' into dev 2025-06-07 16:08:03 +02:00
Flyinghead e8217ca0c5 fix input mapping regressions
Emulator keyboard bindings no longer working when UI is open (Exit).
All-ports mapping not being loaded correctly.
All-ports mapping not working on ports B,C and D.
Restore automatic binding of opposite key/axis.
caused by 64b9e51af0
2025-06-07 16:05:34 +02:00
nexus382 64b9e51af0
button mapping multi binds (#1938)
Add button combination mappping support
- Implement tracking of pressed buttons in GamepadDevice
- Add ability to detect button combinations- Fix mapping system to preserve individual button mappings
- Ensure buttons can work both individually and as part of combinations
- Ensured trigger buttons can be the first button in a combination
- Maintained detection state when binding multiple buttons
- Added special handling to recognize both original and normalized trigger codes

---------

Co-authored-by: James Smith <jmsmith86@gmail.com>
2025-06-03 16:28:51 +02:00
Flyinghead 39d68ec7fa sdl: don't reset haptic gain to 0 on exit
Issue #1963
2025-06-01 10:52:29 +02:00
scribam c3275d3c6f ci: update bsd workflows 2025-05-21 23:22:47 +02:00
James eacadf24a6
DreamPicoPort Mapping Updates (for maraca support) (#1940)
Add rightx and righty for DreamPicoPort (for maraca support)
Add secondary d-pad to dreampicoport mapping
Allow DreamLink device to dictate button/axis name; set custom button names in DreamPicoPort to known codes
2025-05-19 10:37:03 +02:00
nexus382 f62582a4bd
Screen position bug fix with multiple monitors (#1916) 2025-04-28 18:58:33 +02:00
James Smith 1273c06d4b Load mapping for sdl_gamepad through loadMapping() and getDefaultMapping() instead of custom implementation 2025-04-16 21:05:40 +02:00
James 34fda43d9c
DreamPicoPort fixes/enhancements (#1892)
* added getFunctionDefinitions
* Set DreamPort device default deadzone to 0% while preserving user customization
* Fixed default dead zone 0% for DreamPicoPort; set UsePhysicalVmuMemory default to true
* Use DisabledScope for UsePhysicalVmuMemory; moved DreamLinkGamepad::getDefaultMapping() to protected scope to match parent
* Set unique ID for DreamPicoPort devices so they enumerate the same way by flycast on every load
* Implement DreamLinkGamepad::resetMappingToDefault() and set C, D, and Z buttons for DreamPicoPort
---------
Co-authored-by: Nexus382 <anthonyscordino@gmail.com>
2025-04-07 19:23:14 +02:00
James 2631706fe2
Enable physical VMU memory access (#1881) 2025-03-22 15:59:42 +01:00
Mike Kosek 9cdd0aab9f
Rename DreamPort to DreamPicoPort (#1850)
* Renamed DreamPort to DreamPicoPort
* Removed fallback to deprecated config keys
2025-02-22 08:11:05 +01:00
James 4e74619d9e
Harden serial comm interface (#1847)
* Harden serial interface
* Fixed build errors
* Minor tweaks
* Automatically attached A->A, B->B, etc
* Interfaces go in decending order
* Do a modulo in case I decide to move interface numbers
* Do specifically mod 4
* Call SDL_JoystickGetDeviceInstanceID which seems to help with a Windows bug
* Made MapleDevices smart pointers so they can freely be swapped out without leaking
* Fixed issues some issues reported by kosekmi
* Added missing bracket
* Fixed another compile issue
* Fixed a missing else
* If device had no serial number, fall down to checking name
* Use new DreamPort firmware dynamics
* Added missing parens
* Fixed screen blanking issue
* Added const
* Reset VMU Screen on game/emulator exit
* Added gameTermination() hook to hardware gamepad
* Send SW port on game termination
* Added checks so port is only sent if data is valid
* Fixed bug: wait for write to complete in sendCmd
* Fixed bug leading to multiple pointers to VMU and Rumble pack
---------

Co-authored-by: Mike Kosek <mike@kosek.de>
2025-02-16 17:36:57 +01:00
James 77ed9c20de
Connect to DreamConn only once registered (#1828) 2025-02-03 18:19:22 +01:00
James a35e8214df
Serial comm update (#1820)
* Broke apart DreamConn and DreamcastControllerUsb implementations; added serial timeouts; process serial in thread; removed crc from DreamcastControllerUsb sdl definition

* Added missing include statements

* Changed INFO_LOG to NOTICE_LOG on a couple of lines

* Clear the read queue once string is pulled off of it
2025-01-28 17:27:26 +01:00
Mike Kosek 34104724a6 Added config file override for DreamcastControllerUsb Serial Device 2025-01-27 17:30:46 +01:00
Mike Kosek 26d386f833 Fixed handling of asio::io_context 2025-01-25 17:02:18 +01:00
Mike Kosek ce0060126e Now adding mappings for Dreamcast Controller USB during input_sdl_init() 2025-01-25 17:02:18 +01:00
Mike Kosek 4389a3ffa6 Reverted Dreamcast Controller USB mapping workaround 2025-01-25 17:02:18 +01:00
Flyinghead b3fa453d75 dreamconn: asio::serial_port isn't defined on all platforms 2025-01-25 17:02:18 +01:00
Mike Kosek 32c274f407 Updated serial device search on Windows to select only matching VID/PID 2025-01-25 17:02:18 +01:00
Mike Kosek cb2d3e3776 Maple Message to Dreamcast Controller USB now prefixed for compatibility with newest version 2025-01-25 17:02:18 +01:00
Mike Kosek 28f5dd983e Now properly setting and checking left/right Trigger 2025-01-25 17:02:18 +01:00
Mike Kosek 160828a4c7 Overrode default mapping for DreamcastControllerUsb on MacOS/Windows 2025-01-25 17:02:18 +01:00
Mike Kosek aee932808e Removed unused function getDreamcastControllerType() 2025-01-25 17:02:18 +01:00
Mike Kosek 77636391fc Enabled the usage of VMUs and Rumble Packs with Original DC Controllers 2025-01-25 17:02:18 +01:00
Flyinghead a3902fc278 sdl: disable rumble when rumble power is set to 0
Issue #1766
Issue #1783
2025-01-05 22:06:37 +01:00
Flyinghead ee1a7167f6 dreamconn: open pause menu when LT+RT+Start is pressed
Issue #1305
2024-12-28 15:39:11 +01:00
Flyinghead 10aaec1619 dreamconn: send data with socket to avoid fragmentation. Build fix
Issue #1305
2024-12-28 12:21:26 +01:00
Flyinghead 553f77c675 dreamconn: send buzzer messages. Rename controller. Use asio iostream
Issue #1305
2024-12-27 18:47:12 +01:00
Flyinghead b9fdd5070b dreamconn: detect dreamconn+ with VID/PID. Send maple data as text.
Create DreamConn gamepad when detected.
Send/receive maple data in ascii dump form.
Simplify maple device creation.

Issue #1305
2024-12-20 20:02:58 +01:00
Flyinghead 6c3d77b012 more windows build fix 2024-12-16 18:14:21 +01:00
Flyinghead dfd4dbebc4 fix windows build 2024-12-16 17:34:38 +01:00
Flyinghead 34a5e7f47d input: dreamconn+ support prototype
Issue #1305
2024-12-16 17:17:45 +01:00
Flyinghead a99aa5217b sdl: don't run null haptic effects. Stop effects instead
Tentative fix for Issue #1766
2024-12-07 18:57:40 +01:00
Flyinghead 2b83df86cd boxart: don't save database when pausing (android, uwp)
Avoids ANR on android. Unnecessary since database is now saved
regularly.
2024-07-20 10:07:18 +02:00
Flyinghead 719fd70860 sdl: always open haptic interface. use default rumble except for wheels
Always open joysticks haptic interface if available and create FFB
effects if supported.
Use default joystick rumble except for racing wheels (sine effect)
Revert 4e3d1caf3f
2024-06-23 16:06:50 +02:00
Flyinghead 4e3d1caf3f input: temporary logging for failed haptic effects 2024-06-04 13:27:26 +02:00
Flyinghead adeba60ba9 input: ffb support for arcade games. rumble support (f355, 18wheeler)
SDL force feedback for racing wheels.
Support for jvs ffb (f355, 18wheeler), atomiswave (maxspeed, ftspeed)
and midi ffb (initd, clubk, kingrt66, sgdrvsim).
Simple haptic rumble for f355 and 18wheeler.
2024-06-01 11:03:14 +02:00
Flyinghead 336706e728 move most os_* funcs to oslib
add os_DestroyWindow and os_UpdateInputState
2024-04-12 17:37:45 +02:00
Flyinghead 06a6e26588 get rid of os_GetSeconds()
replace it with std::chrono-based getTimeMs()
2024-04-11 15:25:25 +02:00
Flyinghead 9e916ca1c9 minor input and lua fixes
Make macOS keyboard class with haptic code
Call SDL_JoystickSetPlayerIndex using maple port
Add Network event for LUA
Set proper controller unique id on iOS
rumblePower wasn't copied over new mappings.
2024-04-10 17:24:47 +02:00
Flyinghead 588035d9eb set currently played game name in the window title
Issue #28
2024-03-01 12:00:24 +01:00