Fix FFB issues: Outrun, Initial D, PXN V10 crash, T500RS timeout #116
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses 4 open issues reported by the community:
#107 — Outrun on MAME: no FFB until crash/off-track
The
OutrunActivehandler rejectedBank_Motor_Direction == 0, preventing the FFB state machine from initializing properly. All other implementations (RacingActive1, PDriftActive) accept all values unconditionally.#82 — Demul Initial D: constant wheel shaking since v2.0.0.52
The 0x86 spring command lacked proper validation (
ffb[1] > 0x00) unlike other commands (0x85, 0x84). This caused spurious spring effects from garbage data. Fixed across all 10 affected game files: Demul, InitialD0v131, InitialD0v211, InitialD0v230, InitialD4, InitialD4Japan, InitialD5, IDTAv231, KODrive, SWDC2018.#108 — MAME crashes at launch with PXN V10 wheel
No NULL check on the haptic device pointer, and no validation of
SDL_HapticNewEffectreturn values. Devices that don't support all effect types crashed at initialization. Now usesSDL_HapticQueryto check supported effects before creating them, and all Trigger functions guard against NULL haptic / invalid effect IDs.EffectCollectionmembers are initialized to -1. Also fixesSDL_Initerror handling (theifblock had no body).#103 — T500RS: FFB stops working after short time
Constant, Damper, and Inertia effects used
configFeedbackLength(120ms default) as their duration and ran only once. When the game didn't re-trigger fast enough (e.g. sustained force during a long turn), the effect expired and the wheel went limp. Changed toSDL_HAPTIC_INFINITY, matching the pattern already used for Spring effects.Test plan