Repository navigation
Conversation
Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
…un and timer Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
|
Code read of 0e19b9d (not run). The approach looks right (locking of starts_ under g().mu, the stop-and-restart bump, pause/mute/expiry still clearing sdl_running_/endless_, kind validated at CreateForceFeedbackEffect). Two points:
AI-assisted (Claude Code). |
… even at the same total length Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
|
Thanks @Envyre, both points were right.
|
|
Tested Setup: MSVC 19.44.35207 (VS 2022 Build Tools), Windows SDK 10.0.26100.0, Visual Studio 17 2022 generator, RelWithDebInfo, SDL3 3.4.20 fetched with
The 353 checks match your Windows 10 run. AI-assisted (Claude Code). |
|
Tested 2ebd361 on NVIDIA GeForce RTX 4070 SUPER (621.14, Vulkan 1.4.357), Windows 11, MSVC 14.51: pass
AI-assisted. |
Claimed in the coordination issue as: new RT item (claim)
Depends on: #7385 (same function; this branch is on top of it, so its commit shows here until it lands)
@ItsNotRexed: an exe/recomp PR, as you asked.
What and why
Microsoft's
IGameInputForceFeedbackEffect::SetParamsreference says the duration timer is not refreshed when the duration doesn't change, only when a different duration is given or the effect is stopped and restarted.ForceFeedbackEffect::syncre-ran SDL's effect and resetrun_at_on every change, so a title that callsSetParamseach frame on a finite effect (the documented use) restarted it each time and it never ran out.When a finite effect is already running with the same total length and play count, the poll thread now only updates SDL's effect and keeps the run and its timer. A new duration or a new play count still runs it again from the start (1 x 200 ms to 2 x 100 ms is the same total length, but SDL needs the 2 iterations).
SetStatecounts its moves to Running instarts_, so a stop and restart between two polls also starts a new run, as the reference says it should.Tested
Windows 10 22H2 (19045), RTX 2060 / NVIDIA 566.14, Ryzen 5 2600X, clang-cl 23.1.6 + lld-link with the VS 2022 14.44 STL, Windows SDK 10.0.26100, Ninja, SDL3 3.4.20 fetched, at
2ebd361d9:gameinput_test(ctest): 353 checks, 0 failures.0e19b9d98'sgameinput.cpp(before the play count was kept): 1 failure, the 10 s x 1 to 5 s x 2 check, where SDL is never run with the 2 iterations.0e19b9d98, with gameinput: SetParams refuses parameters of another effect kind #7385'sgameinput.cpp(4965a5d8e, this PR's parent): 4 failures. Same-durationSetParamsruns the effect again, and it is still running when the 200 ms it started with are over. The new-duration and stop/restart checks fail there only because that extra run shifts the run count.The timing check sleeps 50 ms before
SetParamsand 180 ms after, so with the fix the 200 ms are always over by then. No upper bound on any sleep.No game files. AI-assisted (Claude Code).
Checklist
docs/design.md, with how it was confirmed. (no translator change)